Beispiel #1
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     UsageDetails                     = new UsageDetailsOperations(this);
     Marketplaces                     = new MarketplacesOperations(this);
     Budgets                          = new BudgetsOperations(this);
     Tags                             = new TagsOperations(this);
     Charges                          = new ChargesOperations(this);
     Balances                         = new BalancesOperations(this);
     ReservationsSummaries            = new ReservationsSummariesOperations(this);
     ReservationsDetails              = new ReservationsDetailsOperations(this);
     ReservationRecommendations       = new ReservationRecommendationsOperations(this);
     PriceSheet                       = new PriceSheetOperations(this);
     Forecasts                        = new ForecastsOperations(this);
     Operations                       = new Operations(this);
     AggregatedCost                   = new AggregatedCostOperations(this);
     BaseUri                          = new System.Uri("https://management.azure.com");
     ApiVersion                       = "2019-04-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());
 }
 /// <summary>
 /// Provides the aggregate cost of a management group and all child management
 /// groups by specified billing period
 /// <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='managementGroupId'>
 /// Azure Management Group ID.
 /// </param>
 /// <param name='billingPeriodName'>
 /// Billing Period Name.
 /// </param>
 public static ManagementGroupAggregatedCostResult GetForBillingPeriodByManagementGroup(this IAggregatedCostOperations operations, string managementGroupId, string billingPeriodName)
 {
     return(operations.GetForBillingPeriodByManagementGroupAsync(managementGroupId, billingPeriodName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Provides the aggregate cost of a management group and all child management
 /// groups by current billing period.
 /// <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='managementGroupId'>
 /// Azure Management Group ID.
 /// </param>
 /// <param name='filter'>
 /// May be used to filter aggregated cost by properties/usageStart (Utc time),
 /// properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le',
 /// 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag
 /// filter is a key value pair string where key and value is separated by a
 /// colon (:).
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ManagementGroupAggregatedCostResult> GetByManagementGroupAsync(this IAggregatedCostOperations operations, string managementGroupId, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetByManagementGroupWithHttpMessagesAsync(managementGroupId, filter, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Provides the aggregate cost of a management group and all child management
 /// groups by current billing period.
 /// <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='managementGroupId'>
 /// Azure Management Group ID.
 /// </param>
 /// <param name='filter'>
 /// May be used to filter aggregated cost by properties/usageStart (Utc time),
 /// properties/usageEnd (Utc time). The filter supports 'eq', 'lt', 'gt', 'le',
 /// 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag
 /// filter is a key value pair string where key and value is separated by a
 /// colon (:).
 /// </param>
 public static ManagementGroupAggregatedCostResult GetByManagementGroup(this IAggregatedCostOperations operations, string managementGroupId, string filter = default(string))
 {
     return(operations.GetByManagementGroupAsync(managementGroupId, filter).GetAwaiter().GetResult());
 }