Skip to content

Commit

Permalink
[AutoPR Microsoft.Azure.Management.CostManagement] Supporting Managem…
Browse files Browse the repository at this point in the history
…ent Group scope for Exports (#94)

* Update swagger_to_sdk_config.json

* Update swagger_to_sdk_config.json

* Update swagger_to_sdk_config.json

* Update swagger_to_sdk_config.json

* Generated from 967f9659d62a831649ef83f6a52cf2e35dbb87bd

Fixed model validation
  • Loading branch information
openapi-sdkautomation[bot] authored and azuresdkci committed Oct 23, 2019
1 parent 2b81f1c commit 90b767b
Show file tree
Hide file tree
Showing 52 changed files with 8,141 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>

namespace Microsoft.Azure.Management.CostManagement
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Threading;
using System.Threading.Tasks;

/// <summary>
/// Extension methods for BudgetOperations.
/// </summary>
public static partial class BudgetOperationsExtensions
{
/// <summary>
/// Gets the budget for the scope by budget name.
/// <see href="https://docs.microsoft.com/en-us/rest/api/cost-management/" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope associated with budget operations. This includes
/// '/subscriptions/{subscriptionId}/' for subscription scope,
/// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
/// resourceGroup scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
/// Billing Account scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
/// for Department scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
/// for EnrollmentAccount scope,
/// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
/// Management Group scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
/// for billingProfile scope,
/// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
/// for invoiceSection scope.
/// </param>
/// <param name='budgetName'>
/// Budget Name.
/// </param>
public static BudgetModel Get(this IBudgetOperations operations, string scope, string budgetName)
{
return operations.GetAsync(scope, budgetName).GetAwaiter().GetResult();
}

/// <summary>
/// Gets the budget for the scope by budget name.
/// <see href="https://docs.microsoft.com/en-us/rest/api/cost-management/" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope associated with budget operations. This includes
/// '/subscriptions/{subscriptionId}/' for subscription scope,
/// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
/// resourceGroup scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
/// Billing Account scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
/// for Department scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
/// for EnrollmentAccount scope,
/// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
/// Management Group scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
/// for billingProfile scope,
/// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
/// for invoiceSection scope.
/// </param>
/// <param name='budgetName'>
/// Budget Name.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<BudgetModel> GetAsync(this IBudgetOperations operations, string scope, string budgetName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(scope, budgetName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// The operation to create or update a budget. Update operation requires
/// latest eTag to be set in the request mandatorily. You may obtain the latest
/// eTag by performing a get operation. Create operation does not require eTag.
/// <see href="https://docs.microsoft.com/en-us/rest/api/cost-management/" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope associated with budget operations. This includes
/// '/subscriptions/{subscriptionId}/' for subscription scope,
/// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
/// resourceGroup scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
/// Billing Account scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
/// for Department scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
/// for EnrollmentAccount scope,
/// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
/// Management Group scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
/// for billingProfile scope,
/// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
/// for invoiceSection scope.
/// </param>
/// <param name='budgetName'>
/// Budget Name.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Create Budget operation.
/// </param>
public static BudgetModel CreateOrUpdate(this IBudgetOperations operations, string scope, string budgetName, BudgetModel parameters = default(BudgetModel))
{
return operations.CreateOrUpdateAsync(scope, budgetName, parameters).GetAwaiter().GetResult();
}

/// <summary>
/// The operation to create or update a budget. Update operation requires
/// latest eTag to be set in the request mandatorily. You may obtain the latest
/// eTag by performing a get operation. Create operation does not require eTag.
/// <see href="https://docs.microsoft.com/en-us/rest/api/cost-management/" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope associated with budget operations. This includes
/// '/subscriptions/{subscriptionId}/' for subscription scope,
/// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
/// resourceGroup scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
/// Billing Account scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
/// for Department scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
/// for EnrollmentAccount scope,
/// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
/// Management Group scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
/// for billingProfile scope,
/// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
/// for invoiceSection scope.
/// </param>
/// <param name='budgetName'>
/// Budget Name.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Create Budget operation.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<BudgetModel> CreateOrUpdateAsync(this IBudgetOperations operations, string scope, string budgetName, BudgetModel parameters = default(BudgetModel), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, budgetName, parameters, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
}

/// <summary>
/// The operation to delete a budget.
/// <see href="https://docs.microsoft.com/en-us/rest/api/cost-management/" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope associated with budget operations. This includes
/// '/subscriptions/{subscriptionId}/' for subscription scope,
/// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
/// resourceGroup scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
/// Billing Account scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
/// for Department scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
/// for EnrollmentAccount scope,
/// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
/// Management Group scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
/// for billingProfile scope,
/// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
/// for invoiceSection scope.
/// </param>
/// <param name='budgetName'>
/// Budget Name.
/// </param>
public static void Delete(this IBudgetOperations operations, string scope, string budgetName)
{
operations.DeleteAsync(scope, budgetName).GetAwaiter().GetResult();
}

/// <summary>
/// The operation to delete a budget.
/// <see href="https://docs.microsoft.com/en-us/rest/api/cost-management/" />
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='scope'>
/// The scope associated with budget operations. This includes
/// '/subscriptions/{subscriptionId}/' for subscription scope,
/// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
/// resourceGroup scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
/// Billing Account scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
/// for Department scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
/// for EnrollmentAccount scope,
/// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
/// Management Group scope,
/// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
/// for billingProfile scope,
/// 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
/// for invoiceSection scope.
/// </param>
/// <param name='budgetName'>
/// Budget Name.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task DeleteAsync(this IBudgetOperations operations, string scope, string budgetName, CancellationToken cancellationToken = default(CancellationToken))
{
(await operations.DeleteWithHttpMessagesAsync(scope, budgetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}

}
}
Loading

0 comments on commit 90b767b

Please sign in to comment.