示例#1
0
 /// <summary>
 /// Lists the charges by invoice section id for given start and end date. Start
 /// and end date are used to determine the billing period. For current month,
 /// the data will be provided from month to date. If there are no chages for a
 /// month then that month will show all zeroes.
 /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountId'>
 /// BillingAccount ID
 /// </param>
 /// <param name='invoiceSectionId'>
 /// Invoice Section Id.
 /// </param>
 /// <param name='startDate'>
 /// Start date
 /// </param>
 /// <param name='endDate'>
 /// End date
 /// </param>
 /// <param name='apply'>
 /// May be used to group charges by properties/productName.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ChargesListByInvoiceSection> ListAsync(this IChargesByInvoiceSectionOperations operations, string billingAccountId, string invoiceSectionId, string startDate, string endDate, string apply = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(billingAccountId, invoiceSectionId, startDate, endDate, apply, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations = new Operations(this);
     CreditSummaryByBillingProfile = new CreditSummaryByBillingProfileOperations(this);
     EventsByBillingProfile        = new EventsByBillingProfileOperations(this);
     LotsByBillingProfile          = new LotsByBillingProfileOperations(this);
     InvoicePricesheet             = new InvoicePricesheetOperations(this);
     BillingProfilePricesheet      = new BillingProfilePricesheetOperations(this);
     ChargesByBillingAccount       = new ChargesByBillingAccountOperations(this);
     ChargesByBillingProfile       = new ChargesByBillingProfileOperations(this);
     ChargesByInvoiceSection       = new ChargesByInvoiceSectionOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-11-01-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()
         }
     };
     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());
 }
示例#3
0
 /// <summary>
 /// Lists the charges by invoice section id for given start and end date. Start
 /// and end date are used to determine the billing period. For current month,
 /// the data will be provided from month to date. If there are no chages for a
 /// month then that month will show all zeroes.
 /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" />
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountId'>
 /// BillingAccount ID
 /// </param>
 /// <param name='invoiceSectionId'>
 /// Invoice Section Id.
 /// </param>
 /// <param name='startDate'>
 /// Start date
 /// </param>
 /// <param name='endDate'>
 /// End date
 /// </param>
 /// <param name='apply'>
 /// May be used to group charges by properties/productName.
 /// </param>
 public static ChargesListByInvoiceSection List(this IChargesByInvoiceSectionOperations operations, string billingAccountId, string invoiceSectionId, string startDate, string endDate, string apply = default(string))
 {
     return(operations.ListAsync(billingAccountId, invoiceSectionId, startDate, endDate, apply).GetAwaiter().GetResult());
 }