/// <summary>
 /// Returns a list of products.
 /// </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='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <CustomerSubscription> > ListNextAsync(this ICustomerSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Returns a list of products.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroup'>
 /// Name of the resource group.
 /// </param>
 /// <param name='registrationName'>
 /// Name of the Azure Stack registration.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <CustomerSubscription> > ListAsync(this ICustomerSubscriptionsOperations operations, string resourceGroup, string registrationName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroup, registrationName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates a new customer subscription under a registration.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroup'>
 /// Name of the resource group.
 /// </param>
 /// <param name='registrationName'>
 /// Name of the Azure Stack registration.
 /// </param>
 /// <param name='customerSubscriptionName'>
 /// Name of the product.
 /// </param>
 /// <param name='customerCreationParameters'>
 /// Parameters use to create a customer subscription.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CustomerSubscription> CreateAsync(this ICustomerSubscriptionsOperations operations, string resourceGroup, string registrationName, string customerSubscriptionName, CustomerSubscription customerCreationParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroup, registrationName, customerSubscriptionName, customerCreationParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #4
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations            = new Operations(this);
     Products              = new ProductsOperations(this);
     Registrations         = new RegistrationsOperations(this);
     CustomerSubscriptions = new CustomerSubscriptionsOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2017-06-01";
     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()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     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 TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <summary>
 /// Returns the specified product.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroup'>
 /// Name of the resource group.
 /// </param>
 /// <param name='registrationName'>
 /// Name of the Azure Stack registration.
 /// </param>
 /// <param name='customerSubscriptionName'>
 /// Name of the product.
 /// </param>
 public static CustomerSubscription Get(this ICustomerSubscriptionsOperations operations, string resourceGroup, string registrationName, string customerSubscriptionName)
 {
     return(operations.GetAsync(resourceGroup, registrationName, customerSubscriptionName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Returns a list of products.
 /// </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>
 public static IPage <CustomerSubscription> ListNext(this ICustomerSubscriptionsOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates a new customer subscription under a registration.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroup'>
 /// Name of the resource group.
 /// </param>
 /// <param name='registrationName'>
 /// Name of the Azure Stack registration.
 /// </param>
 /// <param name='customerSubscriptionName'>
 /// Name of the product.
 /// </param>
 /// <param name='customerCreationParameters'>
 /// Parameters use to create a customer subscription.
 /// </param>
 public static CustomerSubscription Create(this ICustomerSubscriptionsOperations operations, string resourceGroup, string registrationName, string customerSubscriptionName, CustomerSubscription customerCreationParameters)
 {
     return(operations.CreateAsync(resourceGroup, registrationName, customerSubscriptionName, customerCreationParameters).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes a customer subscription under a registration.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroup'>
 /// Name of the resource group.
 /// </param>
 /// <param name='registrationName'>
 /// Name of the Azure Stack registration.
 /// </param>
 /// <param name='customerSubscriptionName'>
 /// Name of the product.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this ICustomerSubscriptionsOperations operations, string resourceGroup, string registrationName, string customerSubscriptionName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroup, registrationName, customerSubscriptionName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Deletes a customer subscription under a registration.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroup'>
 /// Name of the resource group.
 /// </param>
 /// <param name='registrationName'>
 /// Name of the Azure Stack registration.
 /// </param>
 /// <param name='customerSubscriptionName'>
 /// Name of the product.
 /// </param>
 public static void Delete(this ICustomerSubscriptionsOperations operations, string resourceGroup, string registrationName, string customerSubscriptionName)
 {
     operations.DeleteAsync(resourceGroup, registrationName, customerSubscriptionName).GetAwaiter().GetResult();
 }