/// <summary>
 /// Download price sheet for an invoice.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountName'>
 /// billing Account Id.
 /// </param>
 /// <param name='billingProfileName'>
 /// Billing Profile Id.
 /// </param>
 /// <param name='invoiceName'>
 /// Invoice Id.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <DownloadUrl> DownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.DownloadWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the price sheet for a scope by subscriptionId. Price sheet is
 /// available via this API only for May 1, 2014 or later.
 /// <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='expand'>
 /// May be used to expand the properties/meterDetails within a price sheet. By
 /// default, these fields are not included when returning price sheet.
 /// </param>
 /// <param name='skiptoken'>
 /// Skiptoken is only used if a previous operation returned a partial result.
 /// If a previous response contains a nextLink element, the value of the
 /// nextLink element will include a skiptoken parameter that specifies a
 /// starting point to use for subsequent calls.
 /// </param>
 /// <param name='top'>
 /// May be used to limit the number of results to the top N results.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <PriceSheetResult> GetAsync(this IPriceSheetOperations operations, string expand = default(string), string skiptoken = default(string), int?top = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(expand, skiptoken, top, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#3
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     UsageDetails          = new UsageDetailsOperations(this);
     Marketplaces          = new MarketplacesOperations(this);
     ReservationsSummaries = new ReservationsSummariesOperations(this);
     ReservationsDetails   = new ReservationsDetailsOperations(this);
     Budgets        = new BudgetsOperations(this);
     Operations     = new Operations(this);
     PriceSheet     = new PriceSheetOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-01-31";
     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>
 /// Gets the price sheet for a scope by subscriptionId. Price sheet is
 /// available via this API only for May 1, 2014 or later.
 /// <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='expand'>
 /// May be used to expand the properties/meterDetails within a price sheet. By
 /// default, these fields are not included when returning price sheet.
 /// </param>
 /// <param name='skiptoken'>
 /// Skiptoken is only used if a previous operation returned a partial result.
 /// If a previous response contains a nextLink element, the value of the
 /// nextLink element will include a skiptoken parameter that specifies a
 /// starting point to use for subsequent calls.
 /// </param>
 /// <param name='top'>
 /// May be used to limit the number of results to the top N results.
 /// </param>
 public static PriceSheetResult Get(this IPriceSheetOperations operations, string expand = default(string), string skiptoken = default(string), int?top = default(int?))
 {
     return(operations.GetAsync(expand, skiptoken, top).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get the price sheet for a scope by subscriptionId and billing period. Price
 /// sheet is available via this API only for May 1, 2014 or later.
 /// <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='billingPeriodName'>
 /// Billing Period Name.
 /// </param>
 /// <param name='expand'>
 /// May be used to expand the properties/meterDetails within a price sheet. By
 /// default, these fields are not included when returning price sheet.
 /// </param>
 /// <param name='skiptoken'>
 /// Skiptoken is only used if a previous operation returned a partial result.
 /// If a previous response contains a nextLink element, the value of the
 /// nextLink element will include a skiptoken parameter that specifies a
 /// starting point to use for subsequent calls.
 /// </param>
 /// <param name='top'>
 /// May be used to limit the number of results to the top N results.
 /// </param>
 public static PriceSheetResult GetByBillingPeriod(this IPriceSheetOperations operations, string billingPeriodName, string expand = default(string), string skiptoken = default(string), int?top = default(int?))
 {
     return(operations.GetByBillingPeriodAsync(billingPeriodName, expand, skiptoken, top).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Download price sheet for a billing profile.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountName'>
 /// billing Account Id.
 /// </param>
 /// <param name='billingProfileName'>
 /// Billing Profile Id.
 /// </param>
 public static DownloadUrl DownloadByBillingProfile(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName)
 {
     return(operations.DownloadByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Download price sheet for an invoice.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='billingAccountName'>
 /// billing Account Id.
 /// </param>
 /// <param name='billingProfileName'>
 /// Billing Profile Id.
 /// </param>
 /// <param name='invoiceName'>
 /// Invoice Id.
 /// </param>
 public static DownloadUrl BeginDownload(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName)
 {
     return(operations.BeginDownloadAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult());
 }