Skip to content

Commit

Permalink
AutoPr-Billing-wilcobmsft-REST Spec PrNumber 5486 (Azure#5602)
Browse files Browse the repository at this point in the history
* .NET SDK Resource Provider:'Billing'
REST Spec PR 'Azure/azure-rest-api-specs#5486'
REST Spec PR Author 'wilcobmsft'
REST Spec PR Last commit

* .NET SDK Resource Provider:'Billing'
REST Spec PR 'Azure/azure-rest-api-specs#5486'
REST Spec PR Author 'wilcobmsft'
REST Spec PR Last commit

* .NET SDK Resource Provider:'Billing'
REST Spec PR 'Azure/azure-rest-api-specs#5486'
REST Spec PR Author 'wilcobmsft'
REST Spec PR Last commit

* .NET SDK Resource Provider:'Billing'
REST Spec PR 'Azure/azure-rest-api-specs#5486'
REST Spec PR Author 'wilcobmsft'
REST Spec PR Last commit
  • Loading branch information
adxsdknet authored and mentat9 committed Jun 10, 2019
1 parent c86b116 commit 74b306a
Show file tree
Hide file tree
Showing 9 changed files with 479 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public partial interface IInvoiceSectionsByBillingAccountNameOperations
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<InvoiceSectionListResult,InvoiceSectionsByBillingAccountNameListHeaders>> ListWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<InvoiceSectionListResult>> ListWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,32 @@ public partial interface IInvoiceSectionsOperations
/// </exception>
Task<AzureOperationResponse<InvoiceSection,InvoiceSectionsCreateHeaders>> CreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Lists all invoice sections under a billing profile for a user which
/// he has access to.
/// </summary>
/// <param name='billingAccountName'>
/// billing Account Id.
/// </param>
/// <param name='billingProfileName'>
/// Billing Profile Id.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<InvoiceSectionListResult>> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get the InvoiceSection by id.
/// </summary>
/// <param name='billingAccountName'>
Expand Down Expand Up @@ -105,6 +131,28 @@ public partial interface IInvoiceSectionsOperations
/// </exception>
Task<AzureOperationResponse<InvoiceSection,InvoiceSectionsUpdateHeaders>> UpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Elevates the caller's access to match their billing profile access.
/// </summary>
/// <param name='billingAccountName'>
/// billing Account Id.
/// </param>
/// <param name='invoiceSectionName'>
/// InvoiceSection Id.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorResponseException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to create a InvoiceSection.
/// </summary>
/// <param name='billingAccountName'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ public partial interface IInvoiceSectionsWithCreateSubscriptionPermissionOperati
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<InvoiceSectionListResult,InvoiceSectionsWithCreateSubscriptionPermissionListHeaders>> ListWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
Task<AzureOperationResponse<InvoiceSectionListResult>> ListWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal InvoiceSectionsByBillingAccountNameOperations(BillingManagementClient c
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<InvoiceSectionListResult,InvoiceSectionsByBillingAccountNameListHeaders>> ListWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<AzureOperationResponse<InvoiceSectionListResult>> ListWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
Expand Down Expand Up @@ -173,7 +173,7 @@ internal InvoiceSectionsByBillingAccountNameOperations(BillingManagementClient c
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202)
if ((int)_statusCode != 200)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
Expand Down Expand Up @@ -203,7 +203,7 @@ internal InvoiceSectionsByBillingAccountNameOperations(BillingManagementClient c
throw ex;
}
// Create Result
var _result = new AzureOperationResponse<InvoiceSectionListResult,InvoiceSectionsByBillingAccountNameListHeaders>();
var _result = new AzureOperationResponse<InvoiceSectionListResult>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
Expand All @@ -228,19 +228,6 @@ internal InvoiceSectionsByBillingAccountNameOperations(BillingManagementClient c
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
try
{
_result.Headers = _httpResponse.GetHeadersAsJson().ToObject<InvoiceSectionsByBillingAccountNameListHeaders>(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);
Expand Down
Loading

0 comments on commit 74b306a

Please sign in to comment.