Ejemplo n.º 1
0
        internal async Task UploadAssetStateAsync(string assetID, AssetToken token, object stateData)
        {
            var path    = string.Format("{0}asset-connectivity/assets/{1}/state", APIRoot, assetID);
            var payload = JsonConvert.SerializeObject(stateData);
            var hash    = token.AuthHash.Replace("DEVICEHASH ", string.Empty);

            await PostAsync(
                path,
                payload,
                "application/json",
                new AuthenticationHeaderValue("devicehash", hash));
        }
Ejemplo n.º 2
0
        internal async Task UploadAssetStateAsync(string assetID, AssetToken token, Dictionary <string, object> stateData)
        {
            var path    = string.Format("{0}asset-connectivity/assets/{1}/state", APIRoot, assetID);
            var payload = new JObject();
            var hash    = token.AuthHash.Replace("DEVICEHASH ", string.Empty);

            foreach (var datum in stateData)
            {
                payload.Add(datum.Key, new JValue(datum.Value));
            }

            await PostAsync(
                path,
                payload.ToString(),
                "application/json",
                new AuthenticationHeaderValue("devicehash", hash));
        }
Ejemplo n.º 3
0
 public async Task UploadAssetStateAsync(string assetID, AssetToken token, Dictionary <string, object> stateData)
 {
     await m_session.RequestService.UploadAssetStateAsync(assetID, token, stateData);
 }
Ejemplo n.º 4
0
 public async Task UploadAssetStateAsync(Asset asset, AssetToken token, object stateData)
 {
     await UploadAssetStateAsync(asset.AssetID, token, stateData);
 }