Exemplo n.º 1
0
 /// <summary>
 /// Retrieves an event route.
 /// Status codes:
 /// 200 (OK): Success.
 /// 404 (Not Found): There is no event route with the provided id.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for an event route. The id is unique within event routes and case
 /// sensitive.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <EventRoute> GetByIdAsync(this IEventRoutesOperations operations, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetByIdWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Retrieves all event routes.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='eventRoutesListOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <EventRoute> > ListAsync(this IEventRoutesOperations operations, EventRoutesListOptions eventRoutesListOptions = default(EventRoutesListOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(eventRoutesListOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     DigitalTwinModels = new DigitalTwinModelsOperations(this);
     Query             = new QueryOperations(this);
     DigitalTwins      = new DigitalTwinsOperations(this);
     EventRoutes       = new EventRoutesOperations(this);
     BaseUri           = new System.Uri("http://localhost");
     ApiVersion        = "2020-05-31-preview";
     AcceptLanguage    = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Exemplo n.º 4
0
 /// <summary>
 /// Retrieves an event route.
 /// Status codes:
 /// 200 (OK): Success.
 /// 404 (Not Found): There is no event route with the provided id.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for an event route. The id is unique within event routes and case
 /// sensitive.
 /// </param>
 public static EventRoute GetById(this IEventRoutesOperations operations, string id)
 {
     return(operations.GetByIdAsync(id).GetAwaiter().GetResult());
 }
Exemplo n.º 5
0
 /// <summary>
 /// Retrieves all event routes.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='eventRoutesListOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IPage <EventRoute> List(this IEventRoutesOperations operations, EventRoutesListOptions eventRoutesListOptions = default(EventRoutesListOptions))
 {
     return(operations.ListAsync(eventRoutesListOptions).GetAwaiter().GetResult());
 }
Exemplo n.º 6
0
 /// <summary>
 /// Retrieves all event routes.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='eventRoutesListOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IPage <EventRoute> ListNext(this IEventRoutesOperations operations, string nextPageLink, EventRoutesListOptions eventRoutesListOptions = default(EventRoutesListOptions))
 {
     return(operations.ListNextAsync(nextPageLink, eventRoutesListOptions).GetAwaiter().GetResult());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Deletes an event route.
 /// Status codes:
 /// 200 (OK): Success.
 /// 404 (Not Found): There is no event route with the provided id.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for an event route. The id is unique within event routes and case
 /// sensitive.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IEventRoutesOperations operations, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Exemplo n.º 8
0
 /// <summary>
 /// Deletes an event route.
 /// Status codes:
 /// 200 (OK): Success.
 /// 404 (Not Found): There is no event route with the provided id.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for an event route. The id is unique within event routes and case
 /// sensitive.
 /// </param>
 public static void Delete(this IEventRoutesOperations operations, string id)
 {
     operations.DeleteAsync(id).GetAwaiter().GetResult();
 }
Exemplo n.º 9
0
 /// <summary>
 /// Adds or replaces an event route.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for an event route. The id is unique within event routes and case
 /// sensitive.
 /// </param>
 /// <param name='eventRoute'>
 /// The event route data
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task AddAsync(this IEventRoutesOperations operations, string id, EventRoute eventRoute = default(EventRoute), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.AddWithHttpMessagesAsync(id, eventRoute, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Exemplo n.º 10
0
 /// <summary>
 /// Adds or replaces an event route.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for an event route. The id is unique within event routes and case
 /// sensitive.
 /// </param>
 /// <param name='eventRoute'>
 /// The event route data
 /// </param>
 public static void Add(this IEventRoutesOperations operations, string id, EventRoute eventRoute = default(EventRoute))
 {
     operations.AddAsync(id, eventRoute).GetAwaiter().GetResult();
 }