Skip to content

Commit

Permalink
.NET SDK Resource Provider:'Billing'
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5475'
REST Spec PR Author 'msft-adrianma'
REST Spec PR Last commit
  • Loading branch information
adxsdknet committed Apr 1, 2019
1 parent 20e1b9f commit b694151
Show file tree
Hide file tree
Showing 6 changed files with 8 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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal InvoiceSectionsWithCreateSubscriptionPermissionOperations(BillingManage
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<AzureOperationResponse<InvoiceSectionListResult,InvoiceSectionsWithCreateSubscriptionPermissionListHeaders>> 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 InvoiceSectionsWithCreateSubscriptionPermissionOperations(BillingManage
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 InvoiceSectionsWithCreateSubscriptionPermissionOperations(BillingManage
throw ex;
}
// Create Result
var _result = new AzureOperationResponse<InvoiceSectionListResult,InvoiceSectionsWithCreateSubscriptionPermissionListHeaders>();
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 InvoiceSectionsWithCreateSubscriptionPermissionOperations(BillingManage
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
}
}
try
{
_result.Headers = _httpResponse.GetHeadersAsJson().ToObject<InvoiceSectionsWithCreateSubscriptionPermissionListHeaders>(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

This file was deleted.

This file was deleted.

0 comments on commit b694151

Please sign in to comment.