示例#1
0
 /// <summary>
 /// Get Billing Account Policy.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountId'>
 /// Billing Account Id.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <BillingAccountPoliciesResponse> GetPolicyAsync(this IBillingAccountOperations operations, string billingAccountId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetPolicyWithHttpMessagesAsync(billingAccountId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Subscriptions      = new SubscriptionsOperations(this);
     Tenants            = new TenantsOperations(this);
     Subscription       = new SubscriptionOperations(this);
     Operations         = new Operations(this);
     Alias              = new AliasOperations(this);
     SubscriptionPolicy = new SubscriptionPolicyOperations(this);
     BillingAccount     = new BillingAccountOperations(this);
     BaseUri            = new System.Uri("https://management.azure.com");
     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());
 }
示例#3
0
 /// <summary>
 /// Get Billing Account Policy.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountId'>
 /// Billing Account Id.
 /// </param>
 public static BillingAccountPoliciesResponse GetPolicy(this IBillingAccountOperations operations, string billingAccountId)
 {
     return(operations.GetPolicyAsync(billingAccountId).GetAwaiter().GetResult());
 }