diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.cs
index 39dd36a238d12..d922a0b43aa91 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.cs
@@ -51,7 +51,9 @@ internal AddressOperations(BillingManagementClient client)
public BillingManagementClient Client { get; private set; }
///
- /// Validates the address.
+ /// Validates an address. Use the operation to validate an address before using
+ /// it as soldTo or a billTo address.
+ ///
///
///
///
@@ -86,6 +88,10 @@ internal AddressOperations(BillingManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "address");
}
+ if (address != null)
+ {
+ address.Validate();
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs
index c0e8399bdcc2c..820680b6ba611 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs
@@ -22,7 +22,9 @@ namespace Microsoft.Azure.Management.Billing
public static partial class AddressOperationsExtensions
{
///
- /// Validates the address.
+ /// Validates an address. Use the operation to validate an address before using
+ /// it as soldTo or a billTo address.
+ ///
///
///
/// The operations group for this extension method.
@@ -35,7 +37,9 @@ public static ValidateAddressResponse Validate(this IAddressOperations operation
}
///
- /// Validates the address.
+ /// Validates an address. Use the operation to validate an address before using
+ /// it as soldTo or a billTo address.
+ ///
///
///
/// The operations group for this extension method.
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs
index 355ab9591a9b8..1d43b32dd3954 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs
@@ -51,10 +51,11 @@ internal AgreementsOperations(BillingManagementClient client)
public BillingManagementClient Client { get; private set; }
///
- /// Lists all agreements for a billing account.
+ /// Lists the agreements for a billing account.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
/// May be used to expand the participants.
@@ -80,7 +81,7 @@ internal AgreementsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -203,7 +204,7 @@ internal AgreementsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -216,7 +217,7 @@ internal AgreementsOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -236,13 +237,14 @@ internal AgreementsOperations(BillingManagementClient client)
}
///
- /// Get the agreement by name.
+ /// Gets an agreement by ID.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Agreement Id.
+ /// The ID that uniquely identifies an agreement.
///
///
/// May be used to expand the participants.
@@ -429,5 +431,174 @@ internal AgreementsOperations(BillingManagementClient client)
return _result;
}
+ ///
+ /// Lists the agreements for a billing account.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
}
}
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs
index 459d373677610..e5377e98818aa 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs
@@ -22,30 +22,32 @@ namespace Microsoft.Azure.Management.Billing
public static partial class AgreementsOperationsExtensions
{
///
- /// Lists all agreements for a billing account.
+ /// Lists the agreements for a billing account.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
/// May be used to expand the participants.
///
- public static AgreementListResult ListByBillingAccount(this IAgreementsOperations operations, string billingAccountName, string expand = default(string))
+ public static IPage ListByBillingAccount(this IAgreementsOperations operations, string billingAccountName, string expand = default(string))
{
return operations.ListByBillingAccountAsync(billingAccountName, expand).GetAwaiter().GetResult();
}
///
- /// Lists all agreements for a billing account.
+ /// Lists the agreements for a billing account.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
/// May be used to expand the participants.
@@ -53,7 +55,7 @@ public static partial class AgreementsOperationsExtensions
///
/// The cancellation token.
///
- public static async Task ListByBillingAccountAsync(this IAgreementsOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByBillingAccountAsync(this IAgreementsOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false))
{
@@ -62,16 +64,17 @@ public static partial class AgreementsOperationsExtensions
}
///
- /// Get the agreement by name.
+ /// Gets an agreement by ID.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Agreement Id.
+ /// The ID that uniquely identifies an agreement.
///
///
/// May be used to expand the participants.
@@ -82,16 +85,17 @@ public static partial class AgreementsOperationsExtensions
}
///
- /// Get the agreement by name.
+ /// Gets an agreement by ID.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Agreement Id.
+ /// The ID that uniquely identifies an agreement.
///
///
/// May be used to expand the participants.
@@ -107,5 +111,41 @@ public static partial class AgreementsOperationsExtensions
}
}
+ ///
+ /// Lists the agreements for a billing account.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListByBillingAccountNext(this IAgreementsOperations operations, string nextPageLink)
+ {
+ return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the agreements for a billing account.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByBillingAccountNextAsync(this IAgreementsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
}
}
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AvailableBalancesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AvailableBalancesOperations.cs
index d5c456a3192df..0d741b8bb43d9 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AvailableBalancesOperations.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AvailableBalancesOperations.cs
@@ -51,14 +51,17 @@ internal AvailableBalancesOperations(BillingManagementClient client)
public BillingManagementClient Client { get; private set; }
///
- /// The latest available credit balance for a given billingAccountName and
- /// billingProfileName.
+ /// The available credit balance for a billing profile. This is the balance
+ /// that can be used for pay now to settle due or past due invoices. The
+ /// operation is supported only for billing accounts with agreement type
+ /// Microsoft Customer Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
/// Headers that will be added to request.
@@ -81,7 +84,7 @@ internal AvailableBalancesOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (billingAccountName == null)
{
@@ -105,7 +108,7 @@ internal AvailableBalancesOperations(BillingManagementClient client)
tracingParameters.Add("billingAccountName", billingAccountName);
tracingParameters.Add("billingProfileName", billingProfileName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfile", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AvailableBalancesOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AvailableBalancesOperationsExtensions.cs
index e1e1a592f1373..88f874001632d 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AvailableBalancesOperationsExtensions.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AvailableBalancesOperationsExtensions.cs
@@ -22,42 +22,48 @@ namespace Microsoft.Azure.Management.Billing
public static partial class AvailableBalancesOperationsExtensions
{
///
- /// The latest available credit balance for a given billingAccountName and
- /// billingProfileName.
+ /// The available credit balance for a billing profile. This is the balance
+ /// that can be used for pay now to settle due or past due invoices. The
+ /// operation is supported only for billing accounts with agreement type
+ /// Microsoft Customer Agreement.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
- public static AvailableBalance GetByBillingProfile(this IAvailableBalancesOperations operations, string billingAccountName, string billingProfileName)
+ public static AvailableBalance Get(this IAvailableBalancesOperations operations, string billingAccountName, string billingProfileName)
{
- return operations.GetByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult();
+ return operations.GetAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult();
}
///
- /// The latest available credit balance for a given billingAccountName and
- /// billingProfileName.
+ /// The available credit balance for a billing profile. This is the balance
+ /// that can be used for pay now to settle due or past due invoices. The
+ /// operation is supported only for billing accounts with agreement type
+ /// Microsoft Customer Agreement.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
/// The cancellation token.
///
- public static async Task GetByBillingProfileAsync(this IAvailableBalancesOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IAvailableBalancesOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs
index 53bd623684138..b2d052925aeef 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs
@@ -51,10 +51,11 @@ internal BillingAccountsOperations(BillingManagementClient client)
public BillingManagementClient Client { get; private set; }
///
- /// Lists all billing accounts for a user which he has access to.
+ /// Lists the billing accounts that a user has access to.
+ ///
///
///
- /// May be used to expand the address, invoiceSections and billingProfiles.
+ /// May be used to expand the soldTo, invoice sections and billing profiles.
///
///
/// Headers that will be added to request.
@@ -77,7 +78,7 @@ internal BillingAccountsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -194,7 +195,7 @@ internal BillingAccountsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -207,7 +208,7 @@ internal BillingAccountsOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -227,13 +228,14 @@ internal BillingAccountsOperations(BillingManagementClient client)
}
///
- /// Get the billing account by id.
+ /// Gets a billing account by its ID.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// May be used to expand the address, invoiceSections and billingProfiles.
+ /// May be used to expand the soldTo, invoice sections and billing profiles.
///
///
/// Headers that will be added to request.
@@ -412,10 +414,38 @@ internal BillingAccountsOperations(BillingManagementClient client)
}
///
- /// Lists all invoice sections with create subscription permission for a user.
+ /// Updates the properties of a billing account. Currently, displayName and
+ /// address can be updated. The operation is supported only for billing
+ /// accounts with agreement type Microsoft Customer Agreement.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing account
+ /// operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string billingAccountName, BillingAccountUpdateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(billingAccountName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Lists the invoice sections for which the user has permission to create
+ /// Azure subscriptions. The operation is supported only for billing accounts
+ /// with agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
///
///
/// Headers that will be added to request.
@@ -589,7 +619,373 @@ internal BillingAccountsOperations(BillingManagementClient client)
}
///
- /// Lists all invoice sections with create subscription permission for a user.
+ /// Updates the properties of a billing account. Currently, displayName and
+ /// address can be updated. The operation is supported only for billing
+ /// accounts with agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing account
+ /// operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, BillingAccountUpdateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (billingAccountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("billingAccountName", billingAccountName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}").ToString();
+ _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the billing accounts that a user has access to.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the invoice sections for which the user has permission to create
+ /// Azure subscriptions. The operation is supported only for billing accounts
+ /// with agreement type Microsoft Customer Agreement.
+ ///
///
///
/// The NextLink from the previous successful call to List operation.
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs
index b9d8804580187..077b97c61b0eb 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs
@@ -22,32 +22,34 @@ namespace Microsoft.Azure.Management.Billing
public static partial class BillingAccountsOperationsExtensions
{
///
- /// Lists all billing accounts for a user which he has access to.
+ /// Lists the billing accounts that a user has access to.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// May be used to expand the address, invoiceSections and billingProfiles.
+ /// May be used to expand the soldTo, invoice sections and billing profiles.
///
- public static BillingAccountListResult List(this IBillingAccountsOperations operations, string expand = default(string))
+ public static IPage List(this IBillingAccountsOperations operations, string expand = default(string))
{
return operations.ListAsync(expand).GetAwaiter().GetResult();
}
///
- /// Lists all billing accounts for a user which he has access to.
+ /// Lists the billing accounts that a user has access to.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// May be used to expand the address, invoiceSections and billingProfiles.
+ /// May be used to expand the soldTo, invoice sections and billing profiles.
///
///
/// The cancellation token.
///
- public static async Task ListAsync(this IBillingAccountsOperations operations, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListAsync(this IBillingAccountsOperations operations, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false))
{
@@ -56,16 +58,17 @@ public static partial class BillingAccountsOperationsExtensions
}
///
- /// Get the billing account by id.
+ /// Gets a billing account by its ID.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// May be used to expand the address, invoiceSections and billingProfiles.
+ /// May be used to expand the soldTo, invoice sections and billing profiles.
///
public static BillingAccount Get(this IBillingAccountsOperations operations, string billingAccountName, string expand = default(string))
{
@@ -73,16 +76,17 @@ public static partial class BillingAccountsOperationsExtensions
}
///
- /// Get the billing account by id.
+ /// Gets a billing account by its ID.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// May be used to expand the address, invoiceSections and billingProfiles.
+ /// May be used to expand the soldTo, invoice sections and billing profiles.
///
///
/// The cancellation token.
@@ -94,15 +98,64 @@ public static partial class BillingAccountsOperationsExtensions
return _result.Body;
}
}
-
+
+ ///
+ /// Updates the properties of a billing account. Currently, displayName and
+ /// address can be updated. The operation is supported only for billing
+ /// accounts with agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing account
+ /// operation.
+ ///
+ public static BillingAccount Update(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters)
+ {
+ return operations.UpdateAsync(billingAccountName, parameters).GetAwaiter().GetResult();
+ }
+
///
- /// Lists all invoice sections with create subscription permission for a user.
+ /// Updates the properties of a billing account. Currently, displayName and
+ /// address can be updated. The operation is supported only for billing
+ /// accounts with agreement type Microsoft Customer Agreement.
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing account
+ /// operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the invoice sections for which the user has permission to create
+ /// Azure subscriptions. The operation is supported only for billing accounts
+ /// with agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
///
public static IPage ListInvoiceSectionsByCreateSubscriptionPermission(this IBillingAccountsOperations operations, string billingAccountName)
{
@@ -110,13 +163,16 @@ public static IPage ListInvoiceSectionsBy
}
///
- /// Lists all invoice sections with create subscription permission for a user.
+ /// Lists the invoice sections for which the user has permission to create
+ /// Azure subscriptions. The operation is supported only for billing accounts
+ /// with agreement type Microsoft Customer Agreement.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
/// The cancellation token.
@@ -130,7 +186,92 @@ public static IPage ListInvoiceSectionsBy
}
///
- /// Lists all invoice sections with create subscription permission for a user.
+ /// Updates the properties of a billing account. Currently, displayName and
+ /// address can be updated. The operation is supported only for billing
+ /// accounts with agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing account
+ /// operation.
+ ///
+ public static BillingAccount BeginUpdate(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters)
+ {
+ return operations.BeginUpdateAsync(billingAccountName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates the properties of a billing account. Currently, displayName and
+ /// address can be updated. The operation is supported only for billing
+ /// accounts with agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing account
+ /// operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginUpdateAsync(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the billing accounts that a user has access to.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IBillingAccountsOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the billing accounts that a user has access to.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListNextAsync(this IBillingAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the invoice sections for which the user has permission to create
+ /// Azure subscriptions. The operation is supported only for billing accounts
+ /// with agreement type Microsoft Customer Agreement.
+ ///
///
///
/// The operations group for this extension method.
@@ -144,7 +285,10 @@ public static IPage ListInvoiceSectionsBy
}
///
- /// Lists all invoice sections with create subscription permission for a user.
+ /// Lists the invoice sections for which the user has permission to create
+ /// Azure subscriptions. The operation is supported only for billing accounts
+ /// with agreement type Microsoft Customer Agreement.
+ ///
///
///
/// The operations group for this extension method.
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs
index e380551c5058d..6792e2b316106 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs
@@ -48,13 +48,13 @@ public partial class BillingManagementClient : ServiceClient
- /// Version of the API to be used with the client request. The current version
- /// is 2019-10-01-preview.
+ /// The version of the API to be used with the client request. The current
+ /// version is 2020-05-01.
///
public string ApiVersion { get; private set; }
///
- /// Azure Subscription ID.
+ /// The ID that uniquely identifies an Azure subscription.
///
public string SubscriptionId { get; set; }
@@ -81,11 +81,6 @@ public partial class BillingManagementClient : ServiceClient
public virtual IBillingAccountsOperations BillingAccounts { get; private set; }
- ///
- /// Gets the IPaymentMethodsOperations.
- ///
- public virtual IPaymentMethodsOperations PaymentMethods { get; private set; }
-
///
/// Gets the IAddressOperations.
///
@@ -96,6 +91,11 @@ public partial class BillingManagementClient : ServiceClient
public virtual IAvailableBalancesOperations AvailableBalances { get; private set; }
+ ///
+ /// Gets the IInstructionsOperations.
+ ///
+ public virtual IInstructionsOperations Instructions { get; private set; }
+
///
/// Gets the IBillingProfilesOperations.
///
@@ -126,20 +126,15 @@ public partial class BillingManagementClient : ServiceClient
public virtual IProductsOperations Products { get; private set; }
- ///
- /// Gets the ITransactionsOperations.
- ///
- public virtual ITransactionsOperations Transactions { get; private set; }
-
///
/// Gets the IInvoicesOperations.
///
public virtual IInvoicesOperations Invoices { get; private set; }
///
- /// Gets the IPriceSheetOperations.
+ /// Gets the ITransactionsOperations.
///
- public virtual IPriceSheetOperations PriceSheet { get; private set; }
+ public virtual ITransactionsOperations Transactions { get; private set; }
///
/// Gets the IPoliciesOperations.
@@ -413,18 +408,17 @@ public BillingManagementClient(System.Uri baseUri, ServiceClientCredentials cred
private void Initialize()
{
BillingAccounts = new BillingAccountsOperations(this);
- PaymentMethods = new PaymentMethodsOperations(this);
Address = new AddressOperations(this);
AvailableBalances = new AvailableBalancesOperations(this);
+ Instructions = new InstructionsOperations(this);
BillingProfiles = new BillingProfilesOperations(this);
Customers = new CustomersOperations(this);
InvoiceSections = new InvoiceSectionsOperations(this);
BillingPermissions = new BillingPermissionsOperations(this);
BillingSubscriptions = new BillingSubscriptionsOperations(this);
Products = new ProductsOperations(this);
- Transactions = new TransactionsOperations(this);
Invoices = new InvoicesOperations(this);
- PriceSheet = new PriceSheetOperations(this);
+ Transactions = new TransactionsOperations(this);
Policies = new PoliciesOperations(this);
BillingProperty = new BillingPropertyOperations(this);
Operations = new Operations(this);
@@ -432,7 +426,7 @@ private void Initialize()
BillingRoleAssignments = new BillingRoleAssignmentsOperations(this);
Agreements = new AgreementsOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2019-10-01-preview";
+ ApiVersion = "2020-05-01";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs
index 391530e8e1671..69e92624c14a9 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs
@@ -51,13 +51,14 @@ internal BillingPermissionsOperations(BillingManagementClient client)
public BillingManagementClient Client { get; private set; }
///
- /// Lists all billing permissions the caller has for a customer.
+ /// Lists the billing permissions the caller has for a customer.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Customer name.
+ /// The ID that uniquely identifies a customer.
///
///
/// Headers that will be added to request.
@@ -80,7 +81,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -204,7 +205,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -217,7 +218,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -237,10 +238,11 @@ internal BillingPermissionsOperations(BillingManagementClient client)
}
///
- /// Lists all billing permissions for the caller under a billing account.
+ /// Lists the billing permissions the caller has on a billing account.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
/// Headers that will be added to request.
@@ -263,7 +265,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -381,7 +383,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -394,7 +396,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -414,16 +416,17 @@ internal BillingPermissionsOperations(BillingManagementClient client)
}
///
- /// Lists all billing permissions for the caller under invoice section.
+ /// Lists the billing permissions the caller has on an invoice section.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// InvoiceSection Id.
+ /// The ID that uniquely identifies an invoice section.
///
///
/// Headers that will be added to request.
@@ -446,7 +449,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -576,7 +579,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -589,7 +592,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -609,13 +612,14 @@ internal BillingPermissionsOperations(BillingManagementClient client)
}
///
- /// Lists all billing permissions the caller has for a billing account.
+ /// Lists the billing permissions the caller has on a billing profile.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
/// Headers that will be added to request.
@@ -638,7 +642,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -762,7 +766,7 @@ internal BillingPermissionsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -775,7 +779,683 @@ internal BillingPermissionsOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the billing permissions the caller has for a customer.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByCustomerNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on a billing account.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on an invoice section.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByInvoiceSectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionsNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on a billing profile.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs
index 1367a626c59df..11e6740a51930 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs
@@ -22,38 +22,40 @@ namespace Microsoft.Azure.Management.Billing
public static partial class BillingPermissionsOperationsExtensions
{
///
- /// Lists all billing permissions the caller has for a customer.
+ /// Lists the billing permissions the caller has for a customer.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Customer name.
+ /// The ID that uniquely identifies a customer.
///
- public static BillingPermissionsListResult ListByCustomer(this IBillingPermissionsOperations operations, string billingAccountName, string customerName)
+ public static IPage ListByCustomer(this IBillingPermissionsOperations operations, string billingAccountName, string customerName)
{
return operations.ListByCustomerAsync(billingAccountName, customerName).GetAwaiter().GetResult();
}
///
- /// Lists all billing permissions the caller has for a customer.
+ /// Lists the billing permissions the caller has for a customer.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Customer name.
+ /// The ID that uniquely identifies a customer.
///
///
/// The cancellation token.
///
- public static async Task ListByCustomerAsync(this IBillingPermissionsOperations operations, string billingAccountName, string customerName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByCustomerAsync(this IBillingPermissionsOperations operations, string billingAccountName, string customerName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, null, cancellationToken).ConfigureAwait(false))
{
@@ -62,32 +64,34 @@ public static BillingPermissionsListResult ListByCustomer(this IBillingPermissio
}
///
- /// Lists all billing permissions for the caller under a billing account.
+ /// Lists the billing permissions the caller has on a billing account.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
- public static BillingPermissionsListResult ListByBillingAccount(this IBillingPermissionsOperations operations, string billingAccountName)
+ public static IPage ListByBillingAccount(this IBillingPermissionsOperations operations, string billingAccountName)
{
return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult();
}
///
- /// Lists all billing permissions for the caller under a billing account.
+ /// Lists the billing permissions the caller has on a billing account.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
/// The cancellation token.
///
- public static async Task ListByBillingAccountAsync(this IBillingPermissionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByBillingAccountAsync(this IBillingPermissionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false))
{
@@ -96,44 +100,46 @@ public static BillingPermissionsListResult ListByBillingAccount(this IBillingPer
}
///
- /// Lists all billing permissions for the caller under invoice section.
+ /// Lists the billing permissions the caller has on an invoice section.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// InvoiceSection Id.
+ /// The ID that uniquely identifies an invoice section.
///
- public static BillingPermissionsListResult ListByInvoiceSections(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName)
+ public static IPage ListByInvoiceSections(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName)
{
return operations.ListByInvoiceSectionsAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult();
}
///
- /// Lists all billing permissions for the caller under invoice section.
+ /// Lists the billing permissions the caller has on an invoice section.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// InvoiceSection Id.
+ /// The ID that uniquely identifies an invoice section.
///
///
/// The cancellation token.
///
- public static async Task ListByInvoiceSectionsAsync(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByInvoiceSectionsAsync(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByInvoiceSectionsWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false))
{
@@ -142,38 +148,40 @@ public static BillingPermissionsListResult ListByInvoiceSections(this IBillingPe
}
///
- /// Lists all billing permissions the caller has for a billing account.
+ /// Lists the billing permissions the caller has on a billing profile.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
- public static BillingPermissionsListResult ListByBillingProfile(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName)
+ public static IPage ListByBillingProfile(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName)
{
return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult();
}
///
- /// Lists all billing permissions the caller has for a billing account.
+ /// Lists the billing permissions the caller has on a billing profile.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
/// The cancellation token.
///
- public static async Task ListByBillingProfileAsync(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByBillingProfileAsync(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false))
{
@@ -181,5 +189,149 @@ public static BillingPermissionsListResult ListByBillingProfile(this IBillingPer
}
}
+ ///
+ /// Lists the billing permissions the caller has for a customer.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListByCustomerNext(this IBillingPermissionsOperations operations, string nextPageLink)
+ {
+ return operations.ListByCustomerNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the billing permissions the caller has for a customer.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByCustomerNextAsync(this IBillingPermissionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByCustomerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on a billing account.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListByBillingAccountNext(this IBillingPermissionsOperations operations, string nextPageLink)
+ {
+ return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on a billing account.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByBillingAccountNextAsync(this IBillingPermissionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on an invoice section.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListByInvoiceSectionsNext(this IBillingPermissionsOperations operations, string nextPageLink)
+ {
+ return operations.ListByInvoiceSectionsNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on an invoice section.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByInvoiceSectionsNextAsync(this IBillingPermissionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByInvoiceSectionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on a billing profile.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListByBillingProfileNext(this IBillingPermissionsOperations operations, string nextPageLink)
+ {
+ return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the billing permissions the caller has on a billing profile.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByBillingProfileNextAsync(this IBillingPermissionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByBillingProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
}
}
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs
index 351954a12e559..f0b4b805d750e 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs
@@ -51,13 +51,16 @@ internal BillingProfilesOperations(BillingManagementClient client)
public BillingManagementClient Client { get; private set; }
///
- /// Lists all billing profiles for a user which that user has access to.
+ /// Lists the billing profiles that a user has access to. The operation is
+ /// supported for billing accounts with agreement type Microsoft Customer
+ /// Agreement or Microsoft Partner Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// May be used to expand the invoiceSections.
+ /// May be used to expand the invoice sections.
///
///
/// Headers that will be added to request.
@@ -80,7 +83,7 @@ internal BillingProfilesOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -203,7 +206,7 @@ internal BillingProfilesOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -216,7 +219,7 @@ internal BillingProfilesOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -236,16 +239,19 @@ internal BillingProfilesOperations(BillingManagementClient client)
}
///
- /// Get the billing profile by id.
+ /// Gets a billing profile by its ID. The operation is supported for billing
+ /// accounts with agreement type Microsoft Customer Agreement or Microsoft
+ /// Partner Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// May be used to expand the invoiceSections.
+ /// May be used to expand the invoice sections.
///
///
/// Headers that will be added to request.
@@ -429,5 +435,422 @@ internal BillingProfilesOperations(BillingManagementClient client)
return _result;
}
+ ///
+ /// Creates or updates a billing profile. The operation is supported for
+ /// billing accounts with agreement type Microsoft Customer Agreement or
+ /// Microsoft Partner Agreement.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing profile.
+ ///
+ ///
+ /// The new or updated billing profile.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Creates or updates a billing profile. The operation is supported for
+ /// billing accounts with agreement type Microsoft Customer Agreement or
+ /// Microsoft Partner Agreement.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing profile.
+ ///
+ ///
+ /// The new or updated billing profile.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (billingAccountName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName");
+ }
+ if (billingProfileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("billingAccountName", billingAccountName);
+ tracingParameters.Add("billingProfileName", billingProfileName);
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}").ToString();
+ _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName));
+ _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 202)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ try
+ {
+ _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings));
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex);
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists the billing profiles that a user has access to. The operation is
+ /// supported for billing accounts with agreement type Microsoft Customer
+ /// Agreement or Microsoft Partner Agreement.
+ ///
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
}
}
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs
index 80199a8a87d82..c83e977d70be3 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs
@@ -22,38 +22,44 @@ namespace Microsoft.Azure.Management.Billing
public static partial class BillingProfilesOperationsExtensions
{
///
- /// Lists all billing profiles for a user which that user has access to.
+ /// Lists the billing profiles that a user has access to. The operation is
+ /// supported for billing accounts with agreement type Microsoft Customer
+ /// Agreement or Microsoft Partner Agreement.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// May be used to expand the invoiceSections.
+ /// May be used to expand the invoice sections.
///
- public static BillingProfileListResult ListByBillingAccount(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string))
+ public static IPage ListByBillingAccount(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string))
{
return operations.ListByBillingAccountAsync(billingAccountName, expand).GetAwaiter().GetResult();
}
///
- /// Lists all billing profiles for a user which that user has access to.
+ /// Lists the billing profiles that a user has access to. The operation is
+ /// supported for billing accounts with agreement type Microsoft Customer
+ /// Agreement or Microsoft Partner Agreement.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// May be used to expand the invoiceSections.
+ /// May be used to expand the invoice sections.
///
///
/// The cancellation token.
///
- public static async Task ListByBillingAccountAsync(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListByBillingAccountAsync(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false))
{
@@ -62,19 +68,22 @@ public static partial class BillingProfilesOperationsExtensions
}
///
- /// Get the billing profile by id.
+ /// Gets a billing profile by its ID. The operation is supported for billing
+ /// accounts with agreement type Microsoft Customer Agreement or Microsoft
+ /// Partner Agreement.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// May be used to expand the invoiceSections.
+ /// May be used to expand the invoice sections.
///
public static BillingProfile Get(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, string expand = default(string))
{
@@ -82,19 +91,22 @@ public static partial class BillingProfilesOperationsExtensions
}
///
- /// Get the billing profile by id.
+ /// Gets a billing profile by its ID. The operation is supported for billing
+ /// accounts with agreement type Microsoft Customer Agreement or Microsoft
+ /// Partner Agreement.
+ ///
///
///
/// The operations group for this extension method.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// May be used to expand the invoiceSections.
+ /// May be used to expand the invoice sections.
///
///
/// The cancellation token.
@@ -107,5 +119,145 @@ public static partial class BillingProfilesOperationsExtensions
}
}
+ ///
+ /// Creates or updates a billing profile. The operation is supported for
+ /// billing accounts with agreement type Microsoft Customer Agreement or
+ /// Microsoft Partner Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing profile.
+ ///
+ ///
+ /// The new or updated billing profile.
+ ///
+ public static BillingProfile CreateOrUpdate(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfile parameters)
+ {
+ return operations.CreateOrUpdateAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Creates or updates a billing profile. The operation is supported for
+ /// billing accounts with agreement type Microsoft Customer Agreement or
+ /// Microsoft Partner Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing profile.
+ ///
+ ///
+ /// The new or updated billing profile.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfile parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Creates or updates a billing profile. The operation is supported for
+ /// billing accounts with agreement type Microsoft Customer Agreement or
+ /// Microsoft Partner Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing profile.
+ ///
+ ///
+ /// The new or updated billing profile.
+ ///
+ public static BillingProfile BeginCreateOrUpdate(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfile parameters)
+ {
+ return operations.BeginCreateOrUpdateAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Creates or updates a billing profile. The operation is supported for
+ /// billing accounts with agreement type Microsoft Customer Agreement or
+ /// Microsoft Partner Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing account.
+ ///
+ ///
+ /// The ID that uniquely identifies a billing profile.
+ ///
+ ///
+ /// The new or updated billing profile.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginCreateOrUpdateAsync(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfile parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists the billing profiles that a user has access to. The operation is
+ /// supported for billing accounts with agreement type Microsoft Customer
+ /// Agreement or Microsoft Partner Agreement.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListByBillingAccountNext(this IBillingProfilesOperations operations, string nextPageLink)
+ {
+ return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists the billing profiles that a user has access to. The operation is
+ /// supported for billing accounts with agreement type Microsoft Customer
+ /// Agreement or Microsoft Partner Agreement.
+ ///
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByBillingAccountNextAsync(this IBillingProfilesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
}
}
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs
index 32e94e50b9d55..758c4211b72db 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs
@@ -51,7 +51,8 @@ internal BillingPropertyOperations(BillingManagementClient client)
public BillingManagementClient Client { get; private set; }
///
- /// Get billing property by subscription Id.
+ /// Get the billing properties for a subscription. This operation is not
+ /// supported for billing accounts with agreement type Enterprise Agreement.
///
///
///
@@ -224,5 +225,195 @@ internal BillingPropertyOperations(BillingManagementClient client)
return _result;
}
+ ///
+ /// Updates the billing property of a subscription. Currently, cost center can
+ /// be updated. The operation is supported only for billing accounts with
+ /// agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing property
+ /// operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(BillingProperty parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (parameters == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(parameters != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
}
}
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs
index 99b7476e92a25..06b69fe009fe4 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs
@@ -22,7 +22,8 @@ namespace Microsoft.Azure.Management.Billing
public static partial class BillingPropertyOperationsExtensions
{
///
- /// Get billing property by subscription Id.
+ /// Get the billing properties for a subscription. This operation is not
+ /// supported for billing accounts with agreement type Enterprise Agreement.
///
///
///
@@ -34,7 +35,8 @@ public static BillingProperty Get(this IBillingPropertyOperations operations)
}
///
- /// Get billing property by subscription Id.
+ /// Get the billing properties for a subscription. This operation is not
+ /// supported for billing accounts with agreement type Enterprise Agreement.
///
///
///
@@ -51,5 +53,45 @@ public static BillingProperty Get(this IBillingPropertyOperations operations)
}
}
+ ///
+ /// Updates the billing property of a subscription. Currently, cost center can
+ /// be updated. The operation is supported only for billing accounts with
+ /// agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing property
+ /// operation.
+ ///
+ public static BillingProperty Update(this IBillingPropertyOperations operations, BillingProperty parameters)
+ {
+ return operations.UpdateAsync(parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates the billing property of a subscription. Currently, cost center can
+ /// be updated. The operation is supported only for billing accounts with
+ /// agreement type Microsoft Customer Agreement.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Request parameters that are provided to the update billing property
+ /// operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IBillingPropertyOperations operations, BillingProperty parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
}
}
diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs
index 5375183fd3b56..96b79c9460a99 100644
--- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs
+++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs
@@ -51,13 +51,16 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
public BillingManagementClient Client { get; private set; }
///
- /// Get the role assignment for the caller
+ /// Gets a role assignment for the caller on a billing account. The operation
+ /// is supported for billing accounts with agreement type Microsoft Partner
+ /// Agreement or Microsoft Customer Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// role assignment id.
+ /// The ID that uniquely identifies a role assignment.
///
///
/// Headers that will be added to request.
@@ -237,13 +240,15 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// Delete the role assignment on this billing account
+ /// Deletes a role assignment for the caller on a billing account. The
+ /// operation is supported for billing accounts with agreement type Microsoft
+ /// Partner Agreement or Microsoft Customer Agreement.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// role assignment id.
+ /// The ID that uniquely identifies a role assignment.
///
///
/// Headers that will be added to request.
@@ -423,19 +428,22 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// Get the role assignment for the caller on the invoice Section
+ /// Gets a role assignment for the caller on an invoice section. The operation
+ /// is supported for billing accounts with agreement type Microsoft Customer
+ /// Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// InvoiceSection Id.
+ /// The ID that uniquely identifies an invoice section.
///
///
- /// role assignment id.
+ /// The ID that uniquely identifies a role assignment.
///
///
/// Headers that will be added to request.
@@ -627,19 +635,21 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// Delete the role assignment on the invoice Section
+ /// Deletes a role assignment for the caller on an invoice section. The
+ /// operation is supported for billing accounts with agreement type Microsoft
+ /// Customer Agreement.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// InvoiceSection Id.
+ /// The ID that uniquely identifies an invoice section.
///
///
- /// role assignment id.
+ /// The ID that uniquely identifies a role assignment.
///
///
/// Headers that will be added to request.
@@ -831,16 +841,19 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// Get the role assignment for the caller on the Billing Profile
+ /// Gets a role assignment for the caller on a billing profile. The operation
+ /// is supported for billing accounts with agreement type Microsoft Partner
+ /// Agreement or Microsoft Customer Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// role assignment id.
+ /// The ID that uniquely identifies a role assignment.
///
///
/// Headers that will be added to request.
@@ -1026,16 +1039,18 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// Delete the role assignment on this Billing Profile
+ /// Deletes a role assignment for the caller on a billing profile. The
+ /// operation is supported for billing accounts with agreement type Microsoft
+ /// Partner Agreement or Microsoft Customer Agreement.
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
- /// role assignment id.
+ /// The ID that uniquely identifies a role assignment.
///
///
/// Headers that will be added to request.
@@ -1221,10 +1236,13 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// Get the role assignments on the Billing Account
+ /// Lists the role assignments for the caller on a billing account. The
+ /// operation is supported for billing accounts with agreement type Microsoft
+ /// Partner Agreement or Microsoft Customer Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
/// Headers that will be added to request.
@@ -1247,7 +1265,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -1365,7 +1383,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1378,7 +1396,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1398,13 +1416,19 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// The operation to add a role assignment to a billing account.
+ /// Lists the role assignments for the caller on an invoice section. The
+ /// operation is supported for billing accounts with agreement type Microsoft
+ /// Customer Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
- ///
- /// Parameters supplied to add a role assignment.
+ ///
+ /// The ID that uniquely identifies a billing profile.
+ ///
+ ///
+ /// The ID that uniquely identifies an invoice section.
///
///
/// Headers that will be added to request.
@@ -1427,7 +1451,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> AddByBillingAccountWithHttpMessagesAsync(string billingAccountName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -1437,9 +1461,13 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName");
}
- if (parameters == null)
+ if (billingProfileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName");
+ }
+ if (invoiceSectionName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1449,14 +1477,17 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("billingAccountName", billingAccountName);
- tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("billingProfileName", billingProfileName);
+ tracingParameters.Add("invoiceSectionName", invoiceSectionName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "AddByBillingAccount", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSection", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments").ToString();
_url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName));
+ _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName));
+ _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName));
List _queryParameters = new List();
if (Client.ApiVersion != null)
{
@@ -1469,7 +1500,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -1500,12 +1531,6 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
// Serialize Request
string _requestContent = null;
- if(parameters != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1526,7 +1551,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1556,7 +1581,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1564,12 +1589,12 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
- if ((int)_statusCode == 201)
+ if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1589,16 +1614,16 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// Get the role assignments on the invoice Section
+ /// Lists the role assignments for the caller on a billing profile. The
+ /// operation is supported for billing accounts with agreement type Microsoft
+ /// Customer Agreement.
+ ///
///
///
- /// billing Account Id.
+ /// The ID that uniquely identifies a billing account.
///
///
- /// Billing Profile Id.
- ///
- ///
- /// InvoiceSection Id.
+ /// The ID that uniquely identifies a billing profile.
///
///
/// Headers that will be added to request.
@@ -1621,7 +1646,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -1635,10 +1660,6 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName");
}
- if (invoiceSectionName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName");
- }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1648,16 +1669,14 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("billingAccountName", billingAccountName);
tracingParameters.Add("billingProfileName", billingProfileName);
- tracingParameters.Add("invoiceSectionName", invoiceSectionName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSection", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments").ToString();
_url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName));
_url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName));
- _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName));
List _queryParameters = new List();
if (Client.ApiVersion != null)
{
@@ -1751,7 +1770,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1764,7 +1783,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1784,19 +1803,13 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// The operation to add a role assignment to a invoice Section.
+ /// Lists the role assignments for the caller on a billing account. The
+ /// operation is supported for billing accounts with agreement type Microsoft
+ /// Partner Agreement or Microsoft Customer Agreement.
+ ///
///
- ///
- /// billing Account Id.
- ///
- ///
- /// Billing Profile Id.
- ///
- ///
- /// InvoiceSection Id.
- ///
- ///
- /// Parameters supplied to add a role assignment.
+ ///
+ /// The NextLink from the previous successful call to List operation.
///
///
/// Headers that will be added to request.
@@ -1819,27 +1832,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> AddByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
- if (Client.ApiVersion == null)
+ if (nextPageLink == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
- if (billingAccountName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName");
- }
- if (billingProfileName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName");
- }
- if (invoiceSectionName == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName");
- }
- if (parameters == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1848,24 +1845,14 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
{
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("billingAccountName", billingAccountName);
- tracingParameters.Add("billingProfileName", billingProfileName);
- tracingParameters.Add("invoiceSectionName", invoiceSectionName);
- tracingParameters.Add("parameters", parameters);
+ tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "AddByInvoiceSection", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters);
}
// Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/createBillingRoleAssignment").ToString();
- _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName));
- _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName));
- _url = _url.Replace("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName));
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
List _queryParameters = new List();
- if (Client.ApiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
- }
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
@@ -1873,7 +1860,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -1904,12 +1891,6 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
// Serialize Request
string _requestContent = null;
- if(parameters != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings);
- _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
- _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
- }
// Set Credentials
if (Client.Credentials != null)
{
@@ -1930,7 +1911,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 201)
+ if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -1960,7 +1941,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1968,12 +1949,12 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
- if ((int)_statusCode == 201)
+ if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1993,13 +1974,13 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
}
///
- /// Get the role assignments on the Billing Profile
+ /// Lists the role assignments for the caller on an invoice section. The
+ /// operation is supported for billing accounts with agreement type Microsoft
+ /// Customer Agreement.
+ ///
///
- ///
- /// billing Account Id.
- ///
- ///
- /// Billing Profile Id.
+ ///
+ /// The NextLink from the previous successful call to List operation.
///
///
/// Headers that will be added to request.
@@ -2022,19 +2003,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task