Esempio n. 1
0
 /// <param name='operations'>
 /// Reference to the IOTGateway.IFieldGateway.
 /// </param>
 /// <param name='telemetry'>
 /// Required.
 /// </param>
 public static object SendTelemetryByTelemetry(this IFieldGateway operations, TelemetryData telemetry)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IFieldGateway)s).SendTelemetryByTelemetryAsync(telemetry);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Esempio n. 2
0
 /// <param name='operations'>
 /// Reference to the IOTGateway.IFieldGateway.
 /// </param>
 /// <param name='deviceId'>
 /// Required.
 /// </param>
 public static string RegisterByDeviceid(this IFieldGateway operations, string deviceId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IFieldGateway)s).RegisterByDeviceidAsync(deviceId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the WebFieldGateway class.
 /// </summary>
 /// <param name='rootHandler'>
 /// Optional. The http client handler used to handle http transport.
 /// </param>
 /// <param name='handlers'>
 /// Optional. The set of delegating handlers to insert in the http
 /// client pipeline.
 /// </param>
 public WebFieldGateway(HttpClientHandler rootHandler, params DelegatingHandler[] handlers)
     : base(rootHandler, handlers)
 {
     this._fieldGateway = new FieldGateway(this);
     this._baseUri      = new Uri("http://skswebjobhost.azurewebsites.net:80");
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the WebFieldGateway class.
 /// </summary>
 public WebFieldGateway()
     : base()
 {
     this._fieldGateway = new FieldGateway(this);
     this._baseUri      = new Uri("http://skswebjobhost.azurewebsites.net:80");
 }
Esempio n. 5
0
        /// <param name='operations'>
        /// Reference to the IOTGateway.IFieldGateway.
        /// </param>
        /// <param name='deviceId'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <string> RegisterByDeviceidAsync(this IFieldGateway operations, string deviceId, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <string> result = await operations.RegisterByDeviceidWithOperationResponseAsync(deviceId, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }
Esempio n. 6
0
        /// <param name='operations'>
        /// Reference to the IOTGateway.IFieldGateway.
        /// </param>
        /// <param name='telemetry'>
        /// Required.
        /// </param>
        /// <param name='cancellationToken'>
        /// Cancellation token.
        /// </param>
        public static async Task <object> SendTelemetryByTelemetryAsync(this IFieldGateway operations, TelemetryData telemetry, CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            Microsoft.Rest.HttpOperationResponse <object> result = await operations.SendTelemetryByTelemetryWithOperationResponseAsync(telemetry, cancellationToken).ConfigureAwait(false);

            return(result.Body);
        }