From 274ddd2c371ba1c5db598a8bd05eb4036111c2f9 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 18 Jun 2020 03:34:40 +0000 Subject: [PATCH] Generated from 8b2dfe586d92dc3268a888ec65a99c44e96b195e adding nextlink to responses for Lint failures. --- .../src/Generated/AddressOperations.cs | 8 +- .../Generated/AddressOperationsExtensions.cs | 8 +- .../src/Generated/AgreementsOperations.cs | 187 ++- .../AgreementsOperationsExtensions.cs | 64 +- .../Generated/AvailableBalancesOperations.cs | 15 +- .../AvailableBalancesOperationsExtensions.cs | 30 +- .../Generated/BillingAccountsOperations.cs | 418 +++++- .../BillingAccountsOperationsExtensions.cs | 182 ++- .../src/Generated/BillingManagementClient.cs | 32 +- .../Generated/BillingPermissionsOperations.cs | 728 ++++++++++- .../BillingPermissionsOperationsExtensions.cs | 216 +++- .../Generated/BillingProfilesOperations.cs | 443 ++++++- .../BillingProfilesOperationsExtensions.cs | 184 ++- .../Generated/BillingPropertyOperations.cs | 193 ++- .../BillingPropertyOperationsExtensions.cs | 46 +- .../BillingRoleAssignmentsOperations.cs | 337 ++--- ...lingRoleAssignmentsOperationsExtensions.cs | 326 ++--- .../BillingRoleDefinitionsOperations.cs | 591 ++++++++- ...lingRoleDefinitionsOperationsExtensions.cs | 252 +++- .../BillingSubscriptionsOperations.cs | 670 +++++++--- ...illingSubscriptionsOperationsExtensions.cs | 426 ++++--- .../src/Generated/CustomersOperations.cs | 84 +- .../CustomersOperationsExtensions.cs | 136 +- .../src/Generated/IAddressOperations.cs | 4 +- .../src/Generated/IAgreementsOperations.cs | 37 +- .../Generated/IAvailableBalancesOperations.cs | 13 +- .../Generated/IBillingAccountsOperations.cs | 111 +- .../src/Generated/IBillingManagementClient.cs | 25 +- .../IBillingPermissionsOperations.cs | 129 +- .../Generated/IBillingProfilesOperations.cs | 108 +- .../Generated/IBillingPropertyOperations.cs | 29 +- .../IBillingRoleAssignmentsOperations.cs | 153 ++- .../IBillingRoleDefinitionsOperations.cs | 141 ++- .../IBillingSubscriptionsOperations.cs | 210 +-- .../src/Generated/ICustomersOperations.cs | 64 +- ...erations.cs => IInstructionsOperations.cs} | 50 +- .../Generated/IInvoiceSectionsOperations.cs | 98 +- .../src/Generated/IInvoicesOperations.cs | 249 +++- .../src/Generated/IOperations.cs | 6 +- .../src/Generated/IPoliciesOperations.cs | 39 +- .../src/Generated/IPriceSheetOperations.cs | 133 -- .../src/Generated/IProductsOperations.cs | 221 ++-- .../src/Generated/ITransactionsOperations.cs | 206 +-- ...perations.cs => InstructionsOperations.cs} | 144 ++- .../InstructionsOperationsExtensions.cs | 207 +++ .../Generated/InvoiceSectionsOperations.cs | 302 ++++- .../InvoiceSectionsOperationsExtensions.cs | 174 ++- .../src/Generated/InvoicesOperations.cs | 1106 +++++++++++++++- .../Generated/InvoicesOperationsExtensions.cs | 440 ++++++- .../Generated/Models/AcceptTransferRequest.cs | 57 - .../src/Generated/Models/AcceptanceMode.cs | 23 + ...ligibleProductType.cs => AccountStatus.cs} | 14 +- .../{CustomerType.cs => AccountType.cs} | 4 +- .../src/Generated/Models/AddressDetails.cs | 80 +- .../src/Generated/Models/Agreement.cs | 51 +- .../Generated/Models/AgreementListResult.cs | 62 - .../src/Generated/Models/Amount.cs | 2 +- .../Models/{Status.cs => AutoRenew.cs} | 8 +- .../src/Generated/Models/AvailableBalance.cs | 7 +- .../src/Generated/Models/AzurePlan.cs | 2 +- .../src/Generated/Models/BillingAccount.cs | 71 +- .../Models/BillingAccountListResult.cs | 62 - .../Models/BillingAccountUpdateRequest.cs | 69 +- .../Models/BillingPermissionsListResult.cs | 57 - .../Models/BillingPermissionsProperties.cs | 10 +- .../src/Generated/Models/BillingProfile.cs | 114 +- .../Models/BillingProfileCreationRequest.cs | 51 +- .../Models/BillingProfileListResult.cs | 62 - ...Type.cs => BillingProfileSpendingLimit.cs} | 8 +- .../Generated/Models/BillingProfileStatus.cs | 23 + ...s.cs => BillingProfileStatusReasonCode.cs} | 11 +- ...> BillingProfilesCreateOrUpdateHeaders.cs} | 25 +- .../Models/BillingProfilesOnExpand.cs | 70 + .../src/Generated/Models/BillingProperty.cs | 128 +- .../Generated/Models/BillingRoleAssignment.cs | 84 +- .../Models/BillingRoleAssignmentListResult.cs | 55 - .../Models/BillingRoleAssignmentPayload.cs | 63 - .../Generated/Models/BillingRoleDefinition.cs | 2 +- .../Models/BillingRoleDefinitionListResult.cs | 55 - .../Generated/Models/BillingSubscription.cs | 97 +- .../Models/BillingSubscriptionsListResult.cs | 64 - ....cs => BillingSubscriptionsMoveHeaders.cs} | 23 +- .../src/Generated/Models/Category.cs | 23 + .../src/Generated/Models/Customer.cs | 34 +- .../src/Generated/Models/CustomerPolicy.cs | 12 +- .../src/Generated/Models/Department.cs | 15 +- .../Generated/Models/DepartmentListResult.cs | 62 - .../Models/DetailedTransferStatus.cs | 81 -- .../src/Generated/Models/Document.cs | 23 +- .../{UpdateAutoRenew.cs => DocumentSource.cs} | 8 +- .../src/Generated/Models/DocumentType.cs | 2 +- .../src/Generated/Models/DownloadUrl.cs | 6 +- .../src/Generated/Models/Enrollment.cs | 42 +- .../src/Generated/Models/EnrollmentAccount.cs | 32 +- .../Models/EnrollmentAccountContext.cs | 24 +- .../Models/EnrollmentAccountListResult.cs | 64 - .../Generated/Models/EnrollmentPolicies.cs | 31 +- .../src/Generated/Models/Error.cs | 59 - .../Models/InitiateTransferRequest.cs | 63 - .../src/Generated/Models/Instruction.cs | 97 ++ .../src/Generated/Models/Invoice.cs | 169 ++- .../src/Generated/Models/InvoiceListResult.cs | 62 - .../src/Generated/Models/InvoiceSection.cs | 29 +- .../Models/InvoiceSectionCreationRequest.cs | 6 +- .../Models/InvoiceSectionListResult.cs | 62 - .../InvoiceSectionWithCreateSubPermission.cs | 75 +- .../Models/InvoiceSectionsCreateHeaders.cs | 62 - ...> InvoiceSectionsCreateOrUpdateHeaders.cs} | 25 +- .../Models/InvoiceSectionsOnExpand.cs | 70 + .../src/Generated/Models/InvoiceStatus.cs | 3 +- .../src/Generated/Models/InvoiceType.cs | 23 + ...nloadBillingSubscriptionInvoiceHeaders.cs} | 16 +- ...s.cs => InvoicesDownloadInvoiceHeaders.cs} | 12 +- .../src/Generated/Models/LineOfCredit.cs | 85 -- .../src/Generated/Models/OperationDisplay.cs | 13 +- .../src/Generated/Models/Participants.cs | 17 +- .../src/Generated/Models/PaymentMethod.cs | 85 -- .../src/Generated/Models/PaymentProperties.cs | 10 +- .../src/Generated/Models/Policy.cs | 34 +- ...iceSheetDownloadByBillingProfileHeaders.cs | 74 -- .../Models/PriceSheetDownloadHeaders.cs | 72 -- .../src/Generated/Models/Product.cs | 136 +- .../src/Generated/Models/ProductDetails.cs | 62 - .../Generated/Models/ProductsListResult.cs | 63 - ...nsferHeaders.cs => ProductsMoveHeaders.cs} | 21 +- .../Models/RecipientTransferDetails.cs | 155 --- .../src/Generated/Models/Reseller.cs | 10 +- .../{ProductType.cs => SpendingLimit.cs} | 8 +- .../Models/SpendingLimitForBillingProfile.cs | 22 + .../src/Generated/Models/StatusReasonCode.cs | 23 + .../StatusReasonCodeForBillingProfile.cs | 23 + .../src/Generated/Models/Transaction.cs | 288 ++++- .../Generated/Models/TransactionListResult.cs | 62 - .../TransferBillingSubscriptionRequest.cs | 66 - ...ferBillingSubscriptionRequestProperties.cs | 21 +- .../TransferBillingSubscriptionResult.cs | 57 - .../src/Generated/Models/TransferDetails.cs | 170 --- .../TransferProductRequestProperties.cs | 11 +- .../src/Generated/Models/TransferStatus.cs | 27 - .../Models/UpdateAutoRenewOperation.cs | 54 - .../Models/UpdateAutoRenewRequest.cs | 53 - .../Models/ValidateAddressResponse.cs | 4 +- ...alidateProductTransferEligibilityResult.cs | 10 +- ...teSubscriptionTransferEligibilityResult.cs | 15 +- .../Models/ValidateTransferListResponse.cs | 56 - .../Models/ValidateTransferResponse.cs | 73 -- .../Models/ValidationResultProperties.cs | 67 - .../src/Generated/Operations.cs | 6 +- .../src/Generated/OperationsExtensions.cs | 12 +- .../PaymentMethodsOperationsExtensions.cs | 175 --- .../src/Generated/PoliciesOperations.cs | 32 +- .../Generated/PoliciesOperationsExtensions.cs | 64 +- .../src/Generated/PriceSheetOperations.cs | 508 -------- .../PriceSheetOperationsExtensions.cs | 197 --- .../src/Generated/ProductsOperations.cs | 829 +++++++++--- .../Generated/ProductsOperationsExtensions.cs | 430 ++++--- .../SdkInfo_BillingManagementClient.cs | 55 +- .../src/Generated/TransactionsOperations.cs | 1124 +---------------- .../TransactionsOperationsExtensions.cs | 366 +----- 159 files changed, 10769 insertions(+), 7757 deletions(-) rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/{IPaymentMethodsOperations.cs => IInstructionsOperations.cs} (62%) delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/{PaymentMethodsOperations.cs => InstructionsOperations.cs} (82%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InstructionsOperationsExtensions.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AcceptTransferRequest.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AcceptanceMode.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{EligibleProductType.cs => AccountStatus.cs} (51%) rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{CustomerType.cs => AccountType.cs} (88%) delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementListResult.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{Status.cs => AutoRenew.cs} (73%) delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileListResult.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{PaymentMethodType.cs => BillingProfileSpendingLimit.cs} (70%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileStatus.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{ProductTransferStatus.cs => BillingProfileStatusReasonCode.cs} (59%) rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{BillingSubscriptionsTransferHeaders.cs => BillingProfilesCreateOrUpdateHeaders.cs} (62%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesOnExpand.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinitionListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{LineOfCreditsUpdateHeaders.cs => BillingSubscriptionsMoveHeaders.cs} (61%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Category.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DepartmentListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DetailedTransferStatus.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{UpdateAutoRenew.cs => DocumentSource.cs} (72%) delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccountListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Error.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Instruction.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{BillingProfilesCreateHeaders.cs => InvoiceSectionsCreateOrUpdateHeaders.cs} (60%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsOnExpand.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceType.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{InvoiceSectionsUpdateHeaders.cs => InvoicesDownloadBillingSubscriptionInvoiceHeaders.cs} (75%) rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{BillingProfilesUpdateHeaders.cs => InvoicesDownloadInvoiceHeaders.cs} (80%) delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductDetails.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{ProductsTransferHeaders.cs => ProductsMoveHeaders.cs} (64%) delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{ProductType.cs => SpendingLimit.cs} (68%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SpendingLimitForBillingProfile.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/StatusReasonCode.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/StatusReasonCodeForBillingProfile.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionResult.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferStatus.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewRequest.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs 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>> ListByInvoiceSectionNextWithHttpMessagesAsync(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"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -2043,21 +2016,14 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionNext", 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}/billingRoleAssignments").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + 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); @@ -2146,7 +2112,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")) @@ -2159,7 +2125,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) { @@ -2179,16 +2145,13 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) } /// - /// The operation to add a role assignment to a billing profile. + /// 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. - /// - /// - /// Billing Profile 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. @@ -2211,23 +2174,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, 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) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -2236,22 +2187,14 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddByBillingProfile", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileNext", 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}/createBillingRoleAssignment").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + 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); @@ -2259,7 +2202,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) @@ -2290,12 +2233,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) { @@ -2316,7 +2253,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 @@ -2346,7 +2283,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")) @@ -2354,12 +2291,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) { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs index cb60a1654a818..48c8e80f62799 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs @@ -22,16 +22,19 @@ namespace Microsoft.Azure.Management.Billing public static partial class BillingRoleAssignmentsOperationsExtensions { /// - /// 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. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// public static BillingRoleAssignment GetByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName) { @@ -39,16 +42,19 @@ public static BillingRoleAssignment GetByBillingAccount(this IBillingRoleAssignm } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// /// /// The cancellation token. @@ -62,16 +68,18 @@ public static BillingRoleAssignment GetByBillingAccount(this IBillingRoleAssignm } /// - /// 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. /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// public static BillingRoleAssignment DeleteByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName) { @@ -79,16 +87,18 @@ public static BillingRoleAssignment DeleteByBillingAccount(this IBillingRoleAssi } /// - /// 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. /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// /// /// The cancellation token. @@ -102,22 +112,25 @@ public static BillingRoleAssignment DeleteByBillingAccount(this IBillingRoleAssi } /// - /// 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. + /// /// /// /// 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. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// public static BillingRoleAssignment GetByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName) { @@ -125,22 +138,25 @@ public static BillingRoleAssignment GetByInvoiceSection(this IBillingRoleAssignm } /// - /// 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. + /// /// /// /// 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. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// /// /// The cancellation token. @@ -154,22 +170,24 @@ public static BillingRoleAssignment GetByInvoiceSection(this IBillingRoleAssignm } /// - /// 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. /// /// /// 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. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// public static BillingRoleAssignment DeleteByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName) { @@ -177,22 +195,24 @@ public static BillingRoleAssignment DeleteByInvoiceSection(this IBillingRoleAssi } /// - /// 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. /// /// /// 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. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// /// /// The cancellation token. @@ -206,19 +226,22 @@ public static BillingRoleAssignment DeleteByInvoiceSection(this IBillingRoleAssi } /// - /// 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. + /// /// /// /// 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. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// public static BillingRoleAssignment GetByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) { @@ -226,19 +249,22 @@ public static BillingRoleAssignment GetByBillingProfile(this IBillingRoleAssignm } /// - /// 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. + /// /// /// /// 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. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// /// /// The cancellation token. @@ -252,19 +278,21 @@ public static BillingRoleAssignment GetByBillingProfile(this IBillingRoleAssignm } /// - /// 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. /// /// /// 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. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// public static BillingRoleAssignment DeleteByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) { @@ -272,19 +300,21 @@ public static BillingRoleAssignment DeleteByBillingProfile(this IBillingRoleAssi } /// - /// 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. /// /// /// 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. /// /// - /// role assignment id. + /// The ID that uniquely identifies a role assignment. /// /// /// The cancellation token. @@ -298,32 +328,38 @@ public static BillingRoleAssignment DeleteByBillingProfile(this IBillingRoleAssi } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// - public static BillingRoleAssignmentListResult ListByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName) + public static IPage ListByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName) { return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// - /// 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. + /// /// /// /// 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 IBillingRoleAssignmentsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { @@ -332,224 +368,218 @@ public static BillingRoleAssignmentListResult ListByBillingAccount(this IBilling } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// /// - /// 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. /// - public static BillingRoleAssignmentListResult AddByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName, BillingRoleAssignmentPayload parameters) + public static IPage ListByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.AddByBillingAccountAsync(billingAccountName, parameters).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// /// - /// 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. /// /// /// The cancellation token. /// - public static async Task AddByBillingAccountAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByBillingAccountWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// 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. + /// /// /// /// 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. - /// - public static BillingRoleAssignmentListResult ListByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) + public static IPage ListByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing profile. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// - /// - /// 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. /// - public static BillingRoleAssignmentListResult AddByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters) + public static IPage ListByBillingAccountNext(this IBillingRoleAssignmentsOperations operations, string nextPageLink) { - return operations.AddByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// - /// - /// 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. /// /// /// The cancellation token. /// - public static async Task AddByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountNextAsync(this IBillingRoleAssignmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. + /// + /// The NextLink from the previous successful call to List operation. /// - public static BillingRoleAssignmentListResult ListByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName) + public static IPage ListByInvoiceSectionNext(this IBillingRoleAssignmentsOperations operations, string nextPageLink) { - return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// 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. + /// /// /// /// The operations group for this extension method. /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async Task ListByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInvoiceSectionNextAsync(this IBillingRoleAssignmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The operation to add a role assignment to a billing profile. + /// Lists the role assignments for the caller on a billing profile. The + /// operation is supported for billing accounts with agreement type Microsoft + /// Customer Agreement. + /// /// /// /// The operations group for this extension method. /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Parameters supplied to add a role assignment. - /// - public static BillingRoleAssignmentListResult AddByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters) + public static IPage ListByBillingProfileNext(this IBillingRoleAssignmentsOperations operations, string nextPageLink) { - return operations.AddByBillingProfileAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult(); + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// The operation to add a role assignment to a billing profile. + /// Lists the role assignments for the caller on a billing profile. The + /// operation is supported for billing accounts with agreement type Microsoft + /// Customer Agreement. + /// /// /// /// The operations group for this extension method. /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Parameters supplied to add a role assignment. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async Task AddByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileNextAsync(this IBillingRoleAssignmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) + 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/BillingRoleDefinitionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs index db1c6fc46e7f4..bf753c9e6b5cc 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs @@ -51,13 +51,16 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Gets the role definition for a role + /// Gets the definition for a role 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 definition id. + /// The ID that uniquely identifies a role definition. /// /// /// Headers that will be added to request. @@ -237,19 +240,22 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) } /// - /// Gets the role definition for a role + /// Gets the definition for a role on an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// - /// role definition id. + /// The ID that uniquely identifies a role definition. /// /// /// Headers that will be added to request. @@ -441,16 +447,19 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) } /// - /// Gets the role definition for a role + /// Gets the definition for a role 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 definition id. + /// The ID that uniquely identifies a role definition. /// /// /// Headers that will be added to request. @@ -636,10 +645,13 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) } /// - /// Lists the role definition for a billing account + /// Lists the role definitions for 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. @@ -662,7 +674,7 @@ internal BillingRoleDefinitionsOperations(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) { @@ -780,7 +792,7 @@ internal BillingRoleDefinitionsOperations(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")) @@ -793,7 +805,7 @@ internal BillingRoleDefinitionsOperations(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) { @@ -813,16 +825,19 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) } /// - /// Lists the role definition for an invoice Section + /// Lists the role definitions for an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// Headers that will be added to request. @@ -845,7 +860,7 @@ internal BillingRoleDefinitionsOperations(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>> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -975,7 +990,7 @@ internal BillingRoleDefinitionsOperations(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")) @@ -988,7 +1003,7 @@ internal BillingRoleDefinitionsOperations(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) { @@ -1008,13 +1023,16 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) } /// - /// Lists the role definition for a Billing Profile + /// Lists the role definitions for 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. /// /// /// Headers that will be added to request. @@ -1037,7 +1055,7 @@ internal BillingRoleDefinitionsOperations(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) { @@ -1161,7 +1179,7 @@ internal BillingRoleDefinitionsOperations(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")) @@ -1174,7 +1192,520 @@ internal BillingRoleDefinitionsOperations(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 role definitions for a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer 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; + } + + /// + /// Lists the role definitions for an invoice section. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer 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>> ListByInvoiceSectionNextWithHttpMessagesAsync(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, "ListByInvoiceSectionNext", 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 role definitions for a billing profile. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer 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>> 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/BillingRoleDefinitionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs index 10e68be3ec676..4191352dd36f9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs @@ -22,16 +22,19 @@ namespace Microsoft.Azure.Management.Billing public static partial class BillingRoleDefinitionsOperationsExtensions { /// - /// Gets the role definition for a role + /// Gets the definition for a role on a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// role definition id. + /// The ID that uniquely identifies a role definition. /// public static BillingRoleDefinition GetByBillingAccount(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName) { @@ -39,16 +42,19 @@ public static BillingRoleDefinition GetByBillingAccount(this IBillingRoleDefinit } /// - /// Gets the role definition for a role + /// Gets the definition for a role on a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// role definition id. + /// The ID that uniquely identifies a role definition. /// /// /// The cancellation token. @@ -62,22 +68,25 @@ public static BillingRoleDefinition GetByBillingAccount(this IBillingRoleDefinit } /// - /// Gets the role definition for a role + /// Gets the definition for a role on an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// - /// role definition id. + /// The ID that uniquely identifies a role definition. /// public static BillingRoleDefinition GetByInvoiceSection(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName) { @@ -85,22 +94,25 @@ public static BillingRoleDefinition GetByInvoiceSection(this IBillingRoleDefinit } /// - /// Gets the role definition for a role + /// Gets the definition for a role on an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// - /// role definition id. + /// The ID that uniquely identifies a role definition. /// /// /// The cancellation token. @@ -114,19 +126,22 @@ public static BillingRoleDefinition GetByInvoiceSection(this IBillingRoleDefinit } /// - /// Gets the role definition for a role + /// Gets the definition for a role on a billing profile. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or 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. /// /// - /// role definition id. + /// The ID that uniquely identifies a role definition. /// public static BillingRoleDefinition GetByBillingProfile(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName) { @@ -134,19 +149,22 @@ public static BillingRoleDefinition GetByBillingProfile(this IBillingRoleDefinit } /// - /// Gets the role definition for a role + /// Gets the definition for a role on a billing profile. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or 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. /// /// - /// role definition id. + /// The ID that uniquely identifies a role definition. /// /// /// The cancellation token. @@ -160,32 +178,38 @@ public static BillingRoleDefinition GetByBillingProfile(this IBillingRoleDefinit } /// - /// Lists the role definition for a billing account + /// Lists the role definitions for a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// - public static BillingRoleDefinitionListResult ListByBillingAccount(this IBillingRoleDefinitionsOperations operations, string billingAccountName) + public static IPage ListByBillingAccount(this IBillingRoleDefinitionsOperations operations, string billingAccountName) { return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// - /// Lists the role definition for a billing account + /// Lists the role definitions for a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer Agreement. + /// /// /// /// 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 IBillingRoleDefinitionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { @@ -194,44 +218,50 @@ public static BillingRoleDefinitionListResult ListByBillingAccount(this IBilling } /// - /// Lists the role definition for an invoice Section + /// Lists the role definitions for an invoice section. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// - public static BillingRoleDefinitionListResult ListByInvoiceSection(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) + public static IPage ListByInvoiceSection(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// - /// Lists the role definition for an invoice Section + /// Lists the role definitions for an invoice section. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInvoiceSectionAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { @@ -240,38 +270,44 @@ public static BillingRoleDefinitionListResult ListByInvoiceSection(this IBilling } /// - /// Lists the role definition for a Billing Profile + /// Lists the role definitions for a billing profile. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or 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 BillingRoleDefinitionListResult ListByBillingProfile(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName) + public static IPage ListByBillingProfile(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName) { return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// - /// Lists the role definition for a Billing Profile + /// Lists the role definitions for a billing profile. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or 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 ListByBillingProfileAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { @@ -279,5 +315,125 @@ public static BillingRoleDefinitionListResult ListByBillingProfile(this IBilling } } + /// + /// Lists the role definitions for a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountNext(this IBillingRoleDefinitionsOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the role definitions for a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer 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 IBillingRoleDefinitionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the role definitions for an invoice section. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByInvoiceSectionNext(this IBillingRoleDefinitionsOperations operations, string nextPageLink) + { + return operations.ListByInvoiceSectionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the role definitions for an invoice section. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer 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> ListByInvoiceSectionNextAsync(this IBillingRoleDefinitionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInvoiceSectionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the role definitions for a billing profile. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingProfileNext(this IBillingRoleDefinitionsOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the role definitions for a billing profile. The operation is + /// supported for billing accounts with agreement type Microsoft Partner + /// Agreement or Microsoft Customer 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> ListByBillingProfileNextAsync(this IBillingRoleDefinitionsOperations 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/BillingSubscriptionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs index fa77fa944c0a0..54c96a32e0932 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs @@ -51,14 +51,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists billing subscription by customer id. - /// + /// Lists the subscriptions for a customer. The operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. + /// /// /// - /// 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. @@ -238,17 +239,13 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Get a single billing subscription by id. - /// + /// Lists the subscriptions for a billing account. The operation is supported + /// for billing accounts with agreement type Microsoft Customer Agreement or + /// Microsoft Partner Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Customer name. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// /// Headers that will be added to request. @@ -271,20 +268,12 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (customerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); - } - if (billingSubscriptionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -297,17 +286,13 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("customerName", customerName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByCustomer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions/{billingSubscriptionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -401,7 +386,7 @@ internal BillingSubscriptionsOperations(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")) @@ -414,7 +399,7 @@ internal BillingSubscriptionsOperations(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) { @@ -434,11 +419,16 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscriptions by billing account name. + /// Lists the subscriptions that are billed to a billing profile. 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. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// Headers that will be added to request. @@ -461,12 +451,16 @@ internal BillingSubscriptionsOperations(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>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -479,13 +473,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", 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}/billingSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions").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) { @@ -612,14 +608,19 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscriptions by billing profile name. + /// Lists the subscriptions that are billed to an invoice section. 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. + /// + /// + /// The ID that uniquely identifies an invoice section. /// /// /// Headers that will be added to request. @@ -642,7 +643,7 @@ internal BillingSubscriptionsOperations(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>> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -652,6 +653,10 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } + if (invoiceSectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -665,14 +670,16 @@ internal BillingSubscriptionsOperations(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, "ListByBillingProfile", 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}/billingProfiles/{billingProfileName}/billingSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions").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) { @@ -766,7 +773,7 @@ internal BillingSubscriptionsOperations(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")) @@ -779,7 +786,7 @@ internal BillingSubscriptionsOperations(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) { @@ -799,17 +806,13 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscription by invoice section name. + /// Gets a subscription by its ID. The operation is supported for billing + /// accounts with agreement type Microsoft Customer Agreement and Microsoft + /// Partner Agreement. /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// /// Headers that will be added to request. @@ -832,19 +835,15 @@ internal BillingSubscriptionsOperations(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> GetWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (billingProfileName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); - } - if (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (Client.ApiVersion == null) { @@ -858,17 +857,14 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); 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, "Get", 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}/billingSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}").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)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -962,7 +958,7 @@ internal BillingSubscriptionsOperations(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")) @@ -975,7 +971,7 @@ internal BillingSubscriptionsOperations(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) { @@ -995,20 +991,16 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Get a single billing subscription by name. - /// + /// Updates the properties of a billing subscription. Currently, cost center + /// can be updated. The operation is supported only for billing accounts with + /// agreement type Microsoft Customer Agreement. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. + /// The ID that uniquely identifies a billing account. /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// + /// Request parameters that are provided to the update billing subscription + /// operation. /// /// /// Headers that will be added to request. @@ -1031,28 +1023,24 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string billingAccountName, BillingSubscription parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (billingProfileName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); - } - if (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); - } - if (billingSubscriptionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + 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; @@ -1061,19 +1049,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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}/billingSubscriptions/{billingSubscriptionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}").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)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1086,7 +1070,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1117,6 +1101,12 @@ internal BillingSubscriptionsOperations(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) { @@ -1200,23 +1190,17 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. + /// Moves a subscription's charges to a new invoice section. The new invoice + /// section must belong to the same billing profile as the existing invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Request parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the move subscription operation. /// /// /// The headers that will be added to request. @@ -1224,30 +1208,25 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// The cancellation token. /// - public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> MoveWithHttpMessagesAsync(string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginMoveWithHttpMessagesAsync(billingAccountName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Validates the transfer of billing subscriptions across invoice sections. + /// Validates if a subscription's charges can be moved to a new invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the validate move eligibility + /// operation. /// /// /// Headers that will be added to request. @@ -1270,28 +1249,28 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ValidateMoveWithHttpMessagesAsync(string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (billingProfileName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); - } - if (invoiceSectionName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (billingSubscriptionName == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1300,21 +1279,20 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ValidateTransfer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ValidateMove", 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}/billingSubscriptions/{billingSubscriptionName}/validateTransferEligibility").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/validateMoveEligibility").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)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + _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); @@ -1442,23 +1420,17 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. + /// Moves a subscription's charges to a new invoice section. The new invoice + /// section must belong to the same billing profile as the existing invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Request parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the move subscription operation. /// /// /// Headers that will be added to request. @@ -1481,28 +1453,28 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginMoveWithHttpMessagesAsync(string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (billingProfileName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); - } - if (billingSubscriptionName == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1511,21 +1483,20 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginTransfer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginMove", 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}/billingSubscriptions/{billingSubscriptionName}/transfer").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/move").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)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + _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); @@ -1620,7 +1591,7 @@ internal BillingSubscriptionsOperations(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")) @@ -1633,7 +1604,7 @@ internal BillingSubscriptionsOperations(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) { @@ -1647,7 +1618,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { @@ -1666,8 +1637,9 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscription by customer id. - /// + /// Lists the subscriptions for a customer. The operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -1835,7 +1807,9 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscriptions by billing account name. + /// Lists the subscriptions for a billing account. The operation is supported + /// for billing accounts with agreement type Microsoft Customer Agreement or + /// Microsoft Partner Agreement. /// /// /// @@ -1907,6 +1881,348 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } + 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 subscriptions that are billed to a billing profile. 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>> 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) + { + _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 subscriptions that are billed to an invoice section. The + /// operation is supported only for billing accounts with agreement type + /// Microsoft Customer 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>> ListByInvoiceSectionNextWithHttpMessagesAsync(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, "ListByInvoiceSectionNext", 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) diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs index e4cc2f127fb06..c62b4473f4944 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs @@ -22,17 +22,18 @@ namespace Microsoft.Azure.Management.Billing public static partial class BillingSubscriptionsOperationsExtensions { /// - /// Lists billing subscription by customer id. - /// + /// Lists the subscriptions for a customer. The operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. + /// /// /// /// 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 IPage ListByCustomer(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName) { @@ -40,17 +41,18 @@ public static IPage ListByCustomer(this IBillingSubscriptio } /// - /// Lists billing subscription by customer id. - /// + /// Lists the subscriptions for a customer. The operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. + /// /// /// /// 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. @@ -64,414 +66,377 @@ public static IPage ListByCustomer(this IBillingSubscriptio } /// - /// Get a single billing subscription by id. - /// + /// Lists the subscriptions for a billing account. 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. - /// - /// - /// Customer name. + /// The ID that uniquely identifies a billing account. /// - /// - /// Billing Subscription Id. - /// - public static BillingSubscription GetByCustomer(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName, string billingSubscriptionName) + public static IPage ListByBillingAccount(this IBillingSubscriptionsOperations operations, string billingAccountName) { - return operations.GetByCustomerAsync(billingAccountName, customerName, billingSubscriptionName).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// - /// Get a single billing subscription by id. - /// + /// Lists the subscriptions for a billing account. 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. - /// - /// - /// Customer name. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// /// The cancellation token. /// - public static async Task GetByCustomerAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName, string billingSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByCustomerWithHttpMessagesAsync(billingAccountName, customerName, billingSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists billing subscriptions by billing account name. + /// Lists the subscriptions that are billed to 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. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// - public static IPage ListByBillingAccount(this IBillingSubscriptionsOperations operations, string billingAccountName) + /// + /// The ID that uniquely identifies a billing profile. + /// + public static IPage ListByBillingProfile(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// - /// Lists billing subscriptions by billing account name. + /// Lists the subscriptions that are billed to 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. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// The cancellation token. /// - public static async Task> ListByBillingAccountAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists billing subscriptions by billing profile name. + /// Lists the subscriptions that are billed to an invoice section. 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 BillingSubscriptionsListResult ListByBillingProfile(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName) + /// + /// The ID that uniquely identifies an invoice section. + /// + public static IPage ListByInvoiceSection(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// - /// Lists billing subscriptions by billing profile name. + /// Lists the subscriptions that are billed to an invoice section. 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 ID that uniquely identifies an invoice section. /// /// /// The cancellation token. /// - public static async Task ListByBillingProfileAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInvoiceSectionAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists billing subscription by invoice section name. + /// Gets a subscription by its ID. The operation is supported for billing + /// accounts with agreement type Microsoft Customer Agreement and Microsoft + /// Partner Agreement. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. + /// The ID that uniquely identifies a billing account. /// - /// - /// InvoiceSection Id. - /// - public static BillingSubscriptionsListResult ListByInvoiceSection(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) + public static BillingSubscription Get(this IBillingSubscriptionsOperations operations, string billingAccountName) { - return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName).GetAwaiter().GetResult(); } /// - /// Lists billing subscription by invoice section name. + /// Gets a subscription by its ID. The operation is supported for billing + /// accounts with agreement type Microsoft Customer Agreement and Microsoft + /// Partner Agreement. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a single billing subscription by name. - /// + /// Updates the properties of a billing 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. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// + /// Request parameters that are provided to the update billing subscription + /// operation. /// - public static BillingSubscription Get(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName) + public static BillingSubscription Update(this IBillingSubscriptionsOperations operations, string billingAccountName, BillingSubscription parameters) { - return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName).GetAwaiter().GetResult(); + return operations.UpdateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); } /// - /// Get a single billing subscription by name. - /// + /// Updates the properties of a billing 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. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// - /// - /// Billing Subscription Id. + /// + /// Request parameters that are provided to the update billing subscription + /// operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, BillingSubscription parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. + /// Moves a subscription's charges to a new invoice section. The new invoice + /// section must belong to the same billing profile as the existing invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Request parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the move subscription operation. /// - public static TransferBillingSubscriptionResult Transfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + public static BillingSubscription Move(this IBillingSubscriptionsOperations operations, string billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return operations.TransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + return operations.MoveAsync(billingAccountName, parameters).GetAwaiter().GetResult(); } /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. + /// Moves a subscription's charges to a new invoice section. The new invoice + /// section must belong to the same billing profile as the existing invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Request parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the move subscription operation. /// /// /// The cancellation token. /// - public static async Task TransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task MoveAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MoveWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Validates the transfer of billing subscriptions across invoice sections. + /// Validates if a subscription's charges can be moved to a new invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the validate move eligibility + /// operation. /// - public static ValidateSubscriptionTransferEligibilityResult ValidateTransfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + public static ValidateSubscriptionTransferEligibilityResult ValidateMove(this IBillingSubscriptionsOperations operations, string billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return operations.ValidateTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + return operations.ValidateMoveAsync(billingAccountName, parameters).GetAwaiter().GetResult(); } /// - /// Validates the transfer of billing subscriptions across invoice sections. + /// Validates if a subscription's charges can be moved to a new invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the validate move eligibility + /// operation. /// /// /// The cancellation token. /// - public static async Task ValidateTransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ValidateMoveAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ValidateTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ValidateMoveWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. + /// Moves a subscription's charges to a new invoice section. The new invoice + /// section must belong to the same billing profile as the existing invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Request parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the move subscription operation. /// - public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + public static BillingSubscription BeginMove(this IBillingSubscriptionsOperations operations, string billingAccountName, TransferBillingSubscriptionRequestProperties parameters) { - return operations.BeginTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + return operations.BeginMoveAsync(billingAccountName, parameters).GetAwaiter().GetResult(); } /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. + /// Moves a subscription's charges to a new invoice section. The new invoice + /// section must belong to the same billing profile as the existing invoice + /// section. This operation is supported for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Request parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the move subscription operation. /// /// /// The cancellation token. /// - public static async Task BeginTransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginMoveAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginMoveWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists billing subscription by customer id. - /// + /// Lists the subscriptions for a customer. The operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. + /// /// /// /// The operations group for this extension method. @@ -485,8 +450,9 @@ public static IPage ListByCustomerNext(this IBillingSubscri } /// - /// Lists billing subscription by customer id. - /// + /// Lists the subscriptions for a customer. The operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. + /// /// /// /// The operations group for this extension method. @@ -506,7 +472,9 @@ public static IPage ListByCustomerNext(this IBillingSubscri } /// - /// Lists billing subscriptions by billing account name. + /// Lists the subscriptions for a billing account. The operation is supported + /// for billing accounts with agreement type Microsoft Customer Agreement or + /// Microsoft Partner Agreement. /// /// /// @@ -521,7 +489,9 @@ public static IPage ListByBillingAccountNext(this IBillingS } /// - /// Lists billing subscriptions by billing account name. + /// Lists the subscriptions for a billing account. The operation is supported + /// for billing accounts with agreement type Microsoft Customer Agreement or + /// Microsoft Partner Agreement. /// /// /// @@ -541,5 +511,85 @@ public static IPage ListByBillingAccountNext(this IBillingS } } + /// + /// Lists the subscriptions that are billed to 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 NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingProfileNext(this IBillingSubscriptionsOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the subscriptions that are billed to 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 NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingProfileNextAsync(this IBillingSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the subscriptions that are billed to an invoice section. The + /// operation is supported only for billing accounts with agreement type + /// Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByInvoiceSectionNext(this IBillingSubscriptionsOperations operations, string nextPageLink) + { + return operations.ListByInvoiceSectionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the subscriptions that are billed to an invoice section. The + /// operation is supported only for billing accounts with agreement type + /// Microsoft Customer 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> ListByInvoiceSectionNextAsync(this IBillingSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInvoiceSectionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs index 828e3e65281b5..5469cab8ec663 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs @@ -51,24 +51,24 @@ internal CustomersOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists customers by billing profile which the current user can work with - /// on-behalf of a partner. + /// Lists the customers that are billed to a billing profile. The operation is + /// supported only for billing accounts with agreement type 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. + /// + /// + /// Used for searching customers by their name. Any customer with name + /// containing the search text will be included in the response /// /// /// May be used to filter the list of customers. /// - /// - /// Skiptoken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skiptoken parameter that specifies a - /// starting point to use for subsequent calls. - /// /// /// Headers that will be added to request. /// @@ -90,7 +90,7 @@ internal CustomersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string filter = default(string), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string search = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -113,8 +113,8 @@ internal CustomersOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("search", search); tracingParameters.Add("filter", filter); - tracingParameters.Add("skiptoken", skiptoken); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); } @@ -128,13 +128,13 @@ internal CustomersOperations(BillingManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (filter != null) + if (search != null) { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + _queryParameters.Add(string.Format("$search={0}", System.Uri.EscapeDataString(search))); } - if (skiptoken != null) + if (filter != null) { - _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); } if (_queryParameters.Count > 0) { @@ -257,21 +257,21 @@ internal CustomersOperations(BillingManagementClient client) } /// - /// Lists customers which the current user can work with on-behalf of a - /// partner. + /// Lists the customers that are billed to a billing account. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// Used for searching customers by their name. Any customer with name + /// containing the search text will be included in the response /// /// /// May be used to filter the list of customers. /// - /// - /// Skiptoken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skiptoken parameter that specifies a - /// starting point to use for subsequent calls. - /// /// /// Headers that will be added to request. /// @@ -293,7 +293,7 @@ internal CustomersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string search = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -311,8 +311,8 @@ internal CustomersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("search", search); tracingParameters.Add("filter", filter); - tracingParameters.Add("skiptoken", skiptoken); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } @@ -325,13 +325,13 @@ internal CustomersOperations(BillingManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (filter != null) + if (search != null) { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + _queryParameters.Add(string.Format("$search={0}", System.Uri.EscapeDataString(search))); } - if (skiptoken != null) + if (filter != null) { - _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); } if (_queryParameters.Count > 0) { @@ -454,16 +454,18 @@ internal CustomersOperations(BillingManagementClient client) } /// - /// Gets a customer by its id. + /// Gets a customer by its ID. The operation is supported only for billing + /// accounts with agreement type Microsoft Partner Agreement. + /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. + /// The ID that uniquely identifies a customer. /// /// - /// May be used to expand enabledAzurePlans, resellers. + /// May be used to expand enabledAzurePlans and resellers /// /// /// Headers that will be added to request. @@ -648,8 +650,10 @@ internal CustomersOperations(BillingManagementClient client) } /// - /// Lists customers by billing profile which the current user can work with - /// on-behalf of a partner. + /// Lists the customers that are billed to a billing profile. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -817,8 +821,10 @@ internal CustomersOperations(BillingManagementClient client) } /// - /// Lists customers which the current user can work with on-behalf of a - /// partner. + /// Lists the customers that are billed to a billing account. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs index e047020c08119..feace61fe2273 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs @@ -22,133 +22,135 @@ namespace Microsoft.Azure.Management.Billing public static partial class CustomersOperationsExtensions { /// - /// Lists customers by billing profile which the current user can work with - /// on-behalf of a partner. + /// Lists the customers that are billed to a billing profile. The operation is + /// supported only for billing accounts with agreement type 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. + /// + /// + /// Used for searching customers by their name. Any customer with name + /// containing the search text will be included in the response /// /// /// May be used to filter the list of customers. /// - /// - /// Skiptoken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skiptoken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage ListByBillingProfile(this ICustomersOperations operations, string billingAccountName, string billingProfileName, string filter = default(string), string skiptoken = default(string)) + public static IPage ListByBillingProfile(this ICustomersOperations operations, string billingAccountName, string billingProfileName, string search = default(string), string filter = default(string)) { - return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, filter, skiptoken).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, search, filter).GetAwaiter().GetResult(); } /// - /// Lists customers by billing profile which the current user can work with - /// on-behalf of a partner. + /// Lists the customers that are billed to a billing profile. The operation is + /// supported only for billing accounts with agreement type 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. + /// + /// + /// Used for searching customers by their name. Any customer with name + /// containing the search text will be included in the response /// /// /// May be used to filter the list of customers. /// - /// - /// Skiptoken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skiptoken parameter that specifies a - /// starting point to use for subsequent calls. - /// /// /// The cancellation token. /// - public static async Task> ListByBillingProfileAsync(this ICustomersOperations operations, string billingAccountName, string billingProfileName, string filter = default(string), string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this ICustomersOperations operations, string billingAccountName, string billingProfileName, string search = default(string), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, filter, skiptoken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, search, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists customers which the current user can work with on-behalf of a - /// partner. + /// Lists the customers that are billed to a billing account. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// Used for searching customers by their name. Any customer with name + /// containing the search text will be included in the response /// /// /// May be used to filter the list of customers. /// - /// - /// Skiptoken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skiptoken parameter that specifies a - /// starting point to use for subsequent calls. - /// - public static IPage ListByBillingAccount(this ICustomersOperations operations, string billingAccountName, string filter = default(string), string skiptoken = default(string)) + public static IPage ListByBillingAccount(this ICustomersOperations operations, string billingAccountName, string search = default(string), string filter = default(string)) { - return operations.ListByBillingAccountAsync(billingAccountName, filter, skiptoken).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, search, filter).GetAwaiter().GetResult(); } /// - /// Lists customers which the current user can work with on-behalf of a - /// partner. + /// Lists the customers that are billed to a billing account. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// Used for searching customers by their name. Any customer with name + /// containing the search text will be included in the response /// /// /// May be used to filter the list of customers. /// - /// - /// Skiptoken is only used if a previous operation returned a partial result. - /// If a previous response contains a nextLink element, the value of the - /// nextLink element will include a skiptoken parameter that specifies a - /// starting point to use for subsequent calls. - /// /// /// The cancellation token. /// - public static async Task> ListByBillingAccountAsync(this ICustomersOperations operations, string billingAccountName, string filter = default(string), string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this ICustomersOperations operations, string billingAccountName, string search = default(string), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, filter, skiptoken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, search, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets a customer by its id. + /// Gets a customer by its ID. The operation is supported only for billing + /// accounts with agreement type Microsoft Partner Agreement. + /// /// /// /// 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. /// /// - /// May be used to expand enabledAzurePlans, resellers. + /// May be used to expand enabledAzurePlans and resellers /// public static Customer Get(this ICustomersOperations operations, string billingAccountName, string customerName, string expand = default(string)) { @@ -156,19 +158,21 @@ public static partial class CustomersOperationsExtensions } /// - /// Gets a customer by its id. + /// Gets a customer by its ID. The operation is supported only for billing + /// accounts with agreement type Microsoft Partner Agreement. + /// /// /// /// 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. /// /// - /// May be used to expand enabledAzurePlans, resellers. + /// May be used to expand enabledAzurePlans and resellers /// /// /// The cancellation token. @@ -182,8 +186,10 @@ public static partial class CustomersOperationsExtensions } /// - /// Lists customers by billing profile which the current user can work with - /// on-behalf of a partner. + /// Lists the customers that are billed to a billing profile. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The operations group for this extension method. @@ -197,8 +203,10 @@ public static IPage ListByBillingProfileNext(this ICustomersOperations } /// - /// Lists customers by billing profile which the current user can work with - /// on-behalf of a partner. + /// Lists the customers that are billed to a billing profile. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The operations group for this extension method. @@ -218,8 +226,10 @@ public static IPage ListByBillingProfileNext(this ICustomersOperations } /// - /// Lists customers which the current user can work with on-behalf of a - /// partner. + /// Lists the customers that are billed to a billing account. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The operations group for this extension method. @@ -233,8 +243,10 @@ public static IPage ListByBillingAccountNext(this ICustomersOperations } /// - /// Lists customers which the current user can work with on-behalf of a - /// partner. + /// Lists the customers that are billed to a billing account. The operation is + /// supported only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The operations group for this extension method. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs index 0497e1cfd7e94..bdce96e8c9b85 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs @@ -24,7 +24,9 @@ namespace Microsoft.Azure.Management.Billing public partial interface IAddressOperations { /// - /// Validates the address. + /// Validates an address. Use the operation to validate an address + /// before using it as soldTo or a billTo address. + /// /// /// /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs index 8857e689506ba..cc4316dacee97 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs @@ -24,10 +24,11 @@ namespace Microsoft.Azure.Management.Billing public partial interface IAgreementsOperations { /// - /// 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. @@ -47,15 +48,16 @@ public partial interface IAgreementsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. @@ -76,5 +78,28 @@ public partial interface IAgreementsOperations /// Thrown when a required parameter is null /// Task> GetWithHttpMessagesAsync(string billingAccountName, string agreementName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the agreements for a billing account. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAvailableBalancesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAvailableBalancesOperations.cs index 4afc7b3578eb4..4bb7400fb5b34 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAvailableBalancesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAvailableBalancesOperations.cs @@ -24,14 +24,17 @@ namespace Microsoft.Azure.Management.Billing public partial interface IAvailableBalancesOperations { /// - /// 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. /// /// /// The headers that will be added to request. @@ -48,6 +51,6 @@ public partial interface IAvailableBalancesOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs index e3e91effa85d3..b20fbe01ba4ec 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs @@ -24,11 +24,12 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingAccountsOperations { /// - /// 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. /// /// /// The headers that will be added to request. @@ -45,16 +46,17 @@ public partial interface IBillingAccountsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -73,11 +75,41 @@ public partial interface IBillingAccountsOperations /// Task> GetWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string billingAccountName, BillingAccountUpdateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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. /// /// /// The headers that will be added to request. @@ -96,8 +128,61 @@ public partial interface IBillingAccountsOperations /// Task>> ListInvoiceSectionsByCreateSubscriptionPermissionWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. + /// + /// + /// The 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 + /// + Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, BillingAccountUpdateRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the billing accounts that a user has access to. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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/IBillingManagementClient.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs index dfccbe2401946..03374ac787665 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs @@ -42,13 +42,13 @@ public partial interface IBillingManagementClient : System.IDisposable ServiceClientCredentials Credentials { get; } /// - /// 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. /// string ApiVersion { get; } /// - /// Azure Subscription ID. + /// The ID that uniquely identifies an Azure subscription. /// string SubscriptionId { get; set; } @@ -76,11 +76,6 @@ public partial interface IBillingManagementClient : System.IDisposable /// IBillingAccountsOperations BillingAccounts { get; } - /// - /// Gets the IPaymentMethodsOperations. - /// - IPaymentMethodsOperations PaymentMethods { get; } - /// /// Gets the IAddressOperations. /// @@ -91,6 +86,11 @@ public partial interface IBillingManagementClient : System.IDisposable /// IAvailableBalancesOperations AvailableBalances { get; } + /// + /// Gets the IInstructionsOperations. + /// + IInstructionsOperations Instructions { get; } + /// /// Gets the IBillingProfilesOperations. /// @@ -121,20 +121,15 @@ public partial interface IBillingManagementClient : System.IDisposable /// IProductsOperations Products { get; } - /// - /// Gets the ITransactionsOperations. - /// - ITransactionsOperations Transactions { get; } - /// /// Gets the IInvoicesOperations. /// IInvoicesOperations Invoices { get; } /// - /// Gets the IPriceSheetOperations. + /// Gets the ITransactionsOperations. /// - IPriceSheetOperations PriceSheet { get; } + ITransactionsOperations Transactions { get; } /// /// Gets the IPoliciesOperations. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs index 13d471c026ea7..12dcf5666b33f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs @@ -24,13 +24,14 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingPermissionsOperations { /// - /// 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. /// /// /// The headers that will be added to request. @@ -47,13 +48,13 @@ public partial interface IBillingPermissionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -70,18 +71,19 @@ public partial interface IBillingPermissionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -98,15 +100,16 @@ public partial interface IBillingPermissionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -123,6 +126,98 @@ public partial interface IBillingPermissionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the billing permissions the caller has for a customer. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the billing permissions the caller has on a billing account. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the billing permissions the caller has on an invoice section. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByInvoiceSectionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the billing permissions the caller has on a billing profile. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs index 96902795fcd9c..ebb48861f5f2c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs @@ -24,14 +24,16 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingProfilesOperations { /// - /// 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. /// /// /// The headers that will be added to request. @@ -48,18 +50,21 @@ public partial interface IBillingProfilesOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -77,5 +82,90 @@ public partial interface IBillingProfilesOperations /// Thrown when a required parameter is null /// Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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. + /// + /// + /// The 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 + /// + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs index 71374d3abd1bb..918c3a7b4a13d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs @@ -24,7 +24,9 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingPropertyOperations { /// - /// 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. /// /// /// @@ -43,5 +45,30 @@ public partial interface IBillingPropertyOperations /// Thrown when a required parameter is null /// Task> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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. + /// + /// + /// The 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 + /// + Task> UpdateWithHttpMessagesAsync(BillingProperty parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs index dfd967c254184..694bccf300136 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs @@ -24,13 +24,16 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingRoleAssignmentsOperations { /// - /// 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. /// /// /// The headers that will be added to request. @@ -49,13 +52,15 @@ public partial interface IBillingRoleAssignmentsOperations /// Task> GetByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -74,19 +79,22 @@ public partial interface IBillingRoleAssignmentsOperations /// Task> DeleteByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -105,19 +113,21 @@ public partial interface IBillingRoleAssignmentsOperations /// Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -136,16 +146,19 @@ public partial interface IBillingRoleAssignmentsOperations /// Task> DeleteByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -164,16 +177,18 @@ public partial interface IBillingRoleAssignmentsOperations /// Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -192,10 +207,13 @@ public partial interface IBillingRoleAssignmentsOperations /// Task> DeleteByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -212,15 +230,21 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -237,18 +261,18 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByBillingAccountWithHttpMessagesAsync(string billingAccountName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -265,21 +289,15 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -296,15 +314,15 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// 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. /// /// /// The headers that will be added to request. @@ -321,18 +339,15 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInvoiceSectionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The operation to add a role assignment to a billing profile. + /// 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. - /// - /// - /// Billing Profile Id. - /// - /// - /// Parameters supplied to add a role assignment. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -349,6 +364,6 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs index 6de9603a2bcbb..5e57e22c27af6 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs @@ -24,13 +24,16 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingRoleDefinitionsOperations { /// - /// Gets the role definition for a role + /// Gets the definition for a role 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 definition id. + /// The ID that uniquely identifies a role definition. /// /// /// The headers that will be added to request. @@ -49,19 +52,22 @@ public partial interface IBillingRoleDefinitionsOperations /// Task> GetByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the role definition for a role + /// Gets the definition for a role on an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// - /// role definition id. + /// The ID that uniquely identifies a role definition. /// /// /// The headers that will be added to request. @@ -80,16 +86,19 @@ public partial interface IBillingRoleDefinitionsOperations /// Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the role definition for a role + /// Gets the definition for a role 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 definition id. + /// The ID that uniquely identifies a role definition. /// /// /// The headers that will be added to request. @@ -108,10 +117,13 @@ public partial interface IBillingRoleDefinitionsOperations /// Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the role definition for a billing account + /// Lists the role definitions for 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. /// /// /// The headers that will be added to request. @@ -128,18 +140,21 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the role definition for an invoice Section + /// Lists the role definitions for an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// The headers that will be added to request. @@ -156,15 +171,18 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the role definition for a Billing Profile + /// Lists the role definitions for 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. /// /// /// The headers that will be added to request. @@ -181,6 +199,81 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the role definitions for a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft + /// Partner Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the role definitions for an invoice section. The operation is + /// supported for billing accounts with agreement type Microsoft + /// Partner Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByInvoiceSectionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the role definitions for a billing profile. The operation is + /// supported for billing accounts with agreement type Microsoft + /// Partner Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs index 6f0f5e80e8aca..1252a8bf6f7cc 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs @@ -24,14 +24,16 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingSubscriptionsOperations { /// - /// Lists billing subscription by customer id. - /// + /// Lists the subscriptions for a customer. The operation is supported + /// only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. + /// The ID that uniquely identifies a customer. /// /// /// The headers that will be added to request. @@ -50,17 +52,13 @@ public partial interface IBillingSubscriptionsOperations /// Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a single billing subscription by id. - /// + /// Lists the subscriptions for a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft + /// Customer Agreement or Microsoft Partner Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Customer name. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// /// The headers that will be added to request. @@ -77,13 +75,18 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscriptions by billing account name. + /// Lists the subscriptions that are billed to a billing profile. 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. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// The headers that will be added to request. @@ -100,16 +103,21 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscriptions by billing profile name. + /// Lists the subscriptions that are billed to an invoice section. 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. + /// + /// + /// The ID that uniquely identifies an invoice section. /// /// /// The headers that will be added to request. @@ -126,19 +134,15 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscription by invoice section name. + /// Gets a subscription by its ID. The operation is supported for + /// billing accounts with agreement type Microsoft Customer Agreement + /// and Microsoft Partner Agreement. /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// /// The headers that will be added to request. @@ -155,22 +159,18 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a single billing subscription by name. - /// + /// Updates the properties of a billing subscription. Currently, cost + /// center 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. /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// + /// Request parameters that are provided to the update billing + /// subscription operation. /// /// /// The headers that will be added to request. @@ -187,25 +187,19 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string billingAccountName, BillingSubscription parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Transfers the subscription from one invoice section to another - /// within a billing account. + /// Moves a subscription's charges to a new invoice section. The new + /// invoice section must belong to the same billing profile as the + /// existing invoice section. This operation is supported for billing + /// accounts with agreement type Microsoft Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Request parameters supplied to the Transfer Billing Subscription + /// Request parameters that are provided to the move subscription /// operation. /// /// @@ -223,25 +217,19 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> MoveWithHttpMessagesAsync(string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Validates the transfer of billing subscriptions across invoice - /// sections. + /// Validates if a subscription's charges can be moved to a new invoice + /// section. This operation is supported for billing accounts with + /// agreement type Microsoft Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters that are provided to the validate move + /// eligibility operation. /// /// /// The headers that will be added to request. @@ -258,25 +246,19 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ValidateMoveWithHttpMessagesAsync(string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Transfers the subscription from one invoice section to another - /// within a billing account. + /// Moves a subscription's charges to a new invoice section. The new + /// invoice section must belong to the same billing profile as the + /// existing invoice section. This operation is supported for billing + /// accounts with agreement type Microsoft Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Request parameters supplied to the Transfer Billing Subscription + /// Request parameters that are provided to the move subscription /// operation. /// /// @@ -294,10 +276,12 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginMoveWithHttpMessagesAsync(string billingAccountName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscription by customer id. - /// + /// Lists the subscriptions for a customer. The operation is supported + /// only for billing accounts with agreement type Microsoft Partner + /// Agreement. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -319,7 +303,9 @@ public partial interface IBillingSubscriptionsOperations /// Task>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscriptions by billing account name. + /// Lists the subscriptions for a billing account. The operation is + /// supported for billing accounts with agreement type Microsoft + /// Customer Agreement or Microsoft Partner Agreement. /// /// /// @@ -341,5 +327,55 @@ public partial interface IBillingSubscriptionsOperations /// Thrown when a required parameter is null /// Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the subscriptions that are billed to a billing profile. 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. + /// + /// + /// The 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 + /// + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the subscriptions that are billed to an invoice section. The + /// operation is supported only for billing accounts with agreement + /// type Microsoft Customer Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByInvoiceSectionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs index 127391a153932..a35aebad63e11 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs @@ -24,24 +24,24 @@ namespace Microsoft.Azure.Management.Billing public partial interface ICustomersOperations { /// - /// Lists customers by billing profile which the current user can work - /// with on-behalf of a partner. + /// Lists the customers that are billed to a billing profile. The + /// operation is supported only for billing accounts with agreement + /// type 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. + /// + /// + /// Used for searching customers by their name. Any customer with name + /// containing the search text will be included in the response /// /// /// May be used to filter the list of customers. /// - /// - /// Skiptoken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skiptoken parameter - /// that specifies a starting point to use for subsequent calls. - /// /// /// The headers that will be added to request. /// @@ -57,23 +57,23 @@ public partial interface ICustomersOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string filter = default(string), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string search = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists customers which the current user can work with on-behalf of a - /// partner. + /// Lists the customers that are billed to a billing account. The + /// operation is supported only for billing accounts with agreement + /// type Microsoft Partner Agreement. + /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// Used for searching customers by their name. Any customer with name + /// containing the search text will be included in the response /// /// /// May be used to filter the list of customers. /// - /// - /// Skiptoken is only used if a previous operation returned a partial - /// result. If a previous response contains a nextLink element, the - /// value of the nextLink element will include a skiptoken parameter - /// that specifies a starting point to use for subsequent calls. - /// /// /// The headers that will be added to request. /// @@ -89,18 +89,20 @@ public partial interface ICustomersOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string search = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets a customer by its id. + /// Gets a customer by its ID. The operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. + /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. + /// The ID that uniquely identifies a customer. /// /// - /// May be used to expand enabledAzurePlans, resellers. + /// May be used to expand enabledAzurePlans and resellers /// /// /// The headers that will be added to request. @@ -119,8 +121,10 @@ public partial interface ICustomersOperations /// Task> GetWithHttpMessagesAsync(string billingAccountName, string customerName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists customers by billing profile which the current user can work - /// with on-behalf of a partner. + /// Lists the customers that are billed to a billing profile. The + /// operation is supported only for billing accounts with agreement + /// type Microsoft Partner Agreement. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -142,8 +146,10 @@ public partial interface ICustomersOperations /// Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists customers which the current user can work with on-behalf of a - /// partner. + /// Lists the customers that are billed to a billing account. The + /// operation is supported only for billing accounts with agreement + /// type Microsoft Partner Agreement. + /// /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInstructionsOperations.cs similarity index 62% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInstructionsOperations.cs index ed7a123da510d..6f1f8810d35ec 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInstructionsOperations.cs @@ -19,16 +19,19 @@ namespace Microsoft.Azure.Management.Billing using System.Threading.Tasks; /// - /// PaymentMethodsOperations operations. + /// InstructionsOperations operations. /// - public partial interface IPaymentMethodsOperations + public partial interface IInstructionsOperations { /// - /// Lists the Payment Methods by billing account Id. - /// + /// Lists the instructions by billing profile id. + /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// The headers that will be added to request. @@ -45,16 +48,20 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the Payment Methods by billing profile Id. + /// Get the instruction by name. These are custom billing instructions + /// and are only applicable for certain customers. /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Billing Profile Id. + /// The ID that uniquely identifies a billing profile. + /// + /// + /// Instruction Name. /// /// /// The headers that will be added to request. @@ -71,13 +78,22 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string instructionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the Payment Methods by billing account Id. - /// + /// Creates or updates an instruction. These are custom billing + /// instructions and are only applicable for certain customers. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// Instruction Name. + /// + /// + /// The new instruction. /// /// /// The headers that will be added to request. @@ -94,9 +110,9 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> PutWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string instructionName, Instruction parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the Payment Methods by billing profile Id. + /// Lists the instructions by billing profile id. /// /// /// @@ -117,6 +133,6 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs index 3a27d3b72e5ea..5d4c166485620 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs @@ -24,13 +24,16 @@ namespace Microsoft.Azure.Management.Billing public partial interface IInvoiceSectionsOperations { /// - /// Lists all invoice sections for a user which he has access to. + /// Lists the invoice sections that a user has access to. 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. /// /// /// The headers that will be added to request. @@ -47,18 +50,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get the InvoiceSection by id. + /// Gets an invoice section by its ID. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// The headers that will be added to request. @@ -77,16 +83,54 @@ public partial interface IInvoiceSectionsOperations /// Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Elevates the caller's access to match their billing profile access. + /// Creates or updates an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. + /// + /// + /// The new or updated invoice section. + /// + /// + /// The 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 + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an invoice section. The operation is supported + /// only for billing accounts with agreement type Microsoft Customer + /// Agreement. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// The ID that uniquely identifies an invoice section. + /// + /// + /// The new or updated invoice section. /// /// /// The headers that will be added to request. @@ -97,9 +141,37 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the invoice sections that a user has access to. The operation + /// is supported only for billing accounts with agreement type + /// Microsoft Customer Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 /// - Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs index 101b1e8699e54..f5e65474be404 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs @@ -24,16 +24,22 @@ namespace Microsoft.Azure.Management.Billing public partial interface IInvoicesOperations { /// - /// List of invoices for a billing account. + /// Lists the invoices for a billing account for a given start date and + /// end date. 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. /// /// - /// Invoice period start date. + /// The start date to fetch the invoices. The date should be specified + /// in MM-DD-YYYY format. /// /// - /// Invoice period end date. + /// The end date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// /// The headers that will be added to request. @@ -50,21 +56,27 @@ public partial interface IInvoicesOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of invoices for a billing profile. + /// Lists the invoices for a billing profile for a given start date and + /// end date. 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. /// /// - /// Invoice period start date. + /// The start date to fetch the invoices. The date should be specified + /// in MM-DD-YYYY format. /// /// - /// Invoice period end date. + /// The end date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// /// The headers that will be added to request. @@ -81,18 +93,43 @@ public partial interface IInvoicesOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get the invoice by name. + /// Gets an invoice by billing account name and ID. 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 an invoice. /// + /// + /// The 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 + /// + Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets an invoice by ID. The operation is supported for billing + /// accounts with agreement type Microsoft Partner Agreement or + /// Microsoft Customer Agreement. + /// + /// /// - /// Invoice Id. + /// The ID that uniquely identifies an invoice. /// /// /// The headers that will be added to request. @@ -109,17 +146,42 @@ public partial interface IInvoicesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByIdWithHttpMessagesAsync(string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists invoices by billing subscriptions name. + /// Gets a URL to download an invoice. 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. + /// + /// + /// The ID that uniquely identifies an invoice. /// - /// - /// Billing Subscription Id. + /// + /// Download token with document source and document ID. /// + /// + /// The 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 + /// + Task> DownloadInvoiceWithHttpMessagesAsync(string billingAccountName, string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the invoices for a subscription. + /// + /// /// /// Invoice period start date. /// @@ -141,19 +203,148 @@ public partial interface IInvoicesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingSubscriptionWithHttpMessagesAsync(string billingAccountName, string billingSubscriptionName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingSubscriptionWithHttpMessagesAsync(string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets an invoice by subscription ID and invoice ID. + /// + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// The 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 + /// + Task> GetBySubscriptionAndInvoiceIdWithHttpMessagesAsync(string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets the invoice by name. + /// Gets a URL to download an invoice. + /// + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + /// + /// The 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 + /// + Task> DownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a URL to download an invoice. 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. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. /// - /// - /// Billing Subscription Id. + /// + /// The 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 + /// + Task> BeginDownloadInvoiceWithHttpMessagesAsync(string billingAccountName, string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a URL to download an invoice. + /// + /// /// - /// Invoice Id. + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + /// + /// The 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 + /// + Task> BeginDownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the invoices for a billing account for a given start date and + /// end date. The operation is supported for billing accounts with + /// agreement type Microsoft Partner Agreement or Microsoft Customer + /// Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the invoices for a billing profile for a given start date and + /// end date. The operation is supported for billing accounts with + /// agreement type Microsoft Partner Agreement or Microsoft Customer + /// Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -170,9 +361,9 @@ public partial interface IInvoicesOperations /// /// Thrown when a required parameter is null /// - Task> GetByIdWithHttpMessagesAsync(string billingAccountName, string billingSubscriptionName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists invoices by billing subscriptions name. + /// Lists the invoices for a subscription. /// /// /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IOperations.cs index 7bbaf066eb9ad..ecace1e9febc9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IOperations.cs @@ -24,7 +24,8 @@ namespace Microsoft.Azure.Management.Billing public partial interface IOperations { /// - /// Lists all of the available billing REST API operations. + /// Lists the available billing REST API operations. + /// /// /// /// The headers that will be added to request. @@ -43,7 +44,8 @@ public partial interface IOperations /// Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all of the available billing REST API operations. + /// Lists the available billing REST API operations. + /// /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs index 63b1c823dc837..c1afd82beb18a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs @@ -24,15 +24,16 @@ namespace Microsoft.Azure.Management.Billing public partial interface IPoliciesOperations { /// - /// The policy for a given billing account name and billing profile - /// name. + /// Lists the policies for a billing profile. This 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. /// /// /// The headers that will be added to request. @@ -51,16 +52,19 @@ public partial interface IPoliciesOperations /// Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The operation to update a policy. + /// Updates the policies for a billing profile. This 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. /// /// - /// Parameters supplied to the update policy operation. + /// Request parameters that are provided to the update policies + /// operation. /// /// /// The headers that will be added to request. @@ -79,14 +83,16 @@ public partial interface IPoliciesOperations /// Task> UpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Policy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The policy for a given billing account name and customer name. + /// Lists the policies for a customer. This operation is supported only + /// for billing accounts with agreement type Microsoft Partner + /// Agreement. /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. + /// The ID that uniquely identifies a customer. /// /// /// The headers that will be added to request. @@ -105,16 +111,19 @@ public partial interface IPoliciesOperations /// Task> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The operation to update a Customer policy. + /// Updates the policies for a customer. This operation is supported + /// only for billing accounts with agreement type Microsoft Partner + /// Agreement. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. + /// The ID that uniquely identifies a customer. /// /// - /// Parameters supplied to the update customer policy operation. + /// Request parameters that are provided to the update policies + /// operation. /// /// /// The headers that will be added to request. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs deleted file mode 100644 index d86f105889807..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// PriceSheetOperations operations. - /// - public partial interface IPriceSheetOperations - { - /// - /// Download price sheet for an invoice. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Invoice Id. - /// - /// - /// The 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 - /// - Task> DownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Download price sheet for a billing profile. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// The 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 - /// - Task> DownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Download price sheet for an invoice. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Invoice Id. - /// - /// - /// The 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 - /// - Task> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Download price sheet for a billing profile. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// The 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 - /// - Task> BeginDownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs index b6be7ff53256e..d3fbf2d36b42f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs @@ -24,20 +24,16 @@ namespace Microsoft.Azure.Management.Billing public partial interface IProductsOperations { /// - /// Lists products by customer id. + /// Lists the products for a customer. These don't include products + /// billed based on usage.The operation is supported only for billing + /// accounts with agreement type Microsoft Partner Agreement. /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. - /// - /// - /// May be used to filter by product type. The filter supports 'eq', - /// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - /// 'ne', 'or', or 'not'. Tag filter is a key value pair string where - /// key and value is separated by a colon (:). + /// The ID that uniquely identifies a customer. /// /// /// The headers that will be added to request. @@ -54,19 +50,22 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a customer's product by name. + /// Lists the products for a billing account. These don't include + /// products billed based on usage. The operation is supported for + /// billing accounts with agreement type Microsoft Customer Agreement + /// or Microsoft Partner Agreement. /// /// /// - /// billing Account Id. - /// - /// - /// Customer name. + /// The ID that uniquely identifies a billing account. /// - /// - /// Invoice Id. + /// + /// May be used to filter by product type. The filter supports 'eq', + /// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support + /// 'ne', 'or', or 'not'. Tag filter is a key value pair string where + /// key and value are separated by a colon (:). /// /// /// The headers that will be added to request. @@ -83,19 +82,25 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists products by billing account name. + /// Lists the products for a billing profile. These don't include + /// products billed based on usage. 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. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// May be used to filter by product type. The filter supports 'eq', /// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support /// 'ne', 'or', or 'not'. Tag filter is a key value pair string where - /// key and value is separated by a colon (:). + /// key and value are separated by a colon (:). /// /// /// The headers that will be added to request. @@ -112,25 +117,27 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists products by invoice section name. + /// Lists the products for an invoice section. These don't include + /// products billed based on usage. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// May be used to filter by product type. The filter supports 'eq', /// 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support /// 'ne', 'or', or 'not'. Tag filter is a key value pair string where - /// key and value is separated by a colon (:). + /// key and value are separated by a colon (:). /// /// /// The headers that will be added to request. @@ -147,22 +154,17 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get a single product by name. + /// Gets a product by ID. The operation is supported only for billing + /// accounts with agreement type Microsoft Customer Agreement. /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// /// The headers that will be added to request. @@ -179,24 +181,21 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The operation to transfer a Product to another invoice section. + /// Updates the properties of a Product. Currently, auto renew can be + /// updated. The operation is supported only for billing accounts with + /// agreement type Microsoft Customer Agreement. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// - /// Parameters supplied to the Transfer Product operation. + /// Request parameters that are provided to the update product + /// operation. /// /// /// The headers that will be added to request. @@ -213,24 +212,23 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string billingAccountName, string productName, Product parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Validates the transfer of products across invoice sections. + /// Moves a product's charges to a new invoice section. The new invoice + /// section must belong to the same billing profile as the existing + /// invoice section. This operation is supported only for products that + /// are purchased with a recurring charge and for billing accounts with + /// agreement type Microsoft Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// - /// Parameters supplied to the Transfer Products operation. + /// Request parameters that are provided to the move product operation. /// /// /// The headers that will be added to request. @@ -247,25 +245,48 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> MoveWithHttpMessagesAsync(string billingAccountName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Cancel auto renew for product by product id and invoice section - /// name + /// Validates if a product's charges can be moved to a new invoice + /// section. This operation is supported only for products that are + /// purchased with a recurring charge and 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 product. /// - /// - /// InvoiceSection Id. + /// + /// Request parameters that are provided to the validate move + /// eligibility operation. /// - /// - /// Invoice Id. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. /// - /// - /// Update auto renew request parameters. + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ValidateMoveWithHttpMessagesAsync(string billingAccountName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the products for a customer. These don't include products + /// billed based on usage.The operation is supported only for billing + /// accounts with agreement type Microsoft Partner Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -282,9 +303,12 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists products by billing account name. + /// Lists the products for a billing account. These don't include + /// products billed based on usage. The operation is supported for + /// billing accounts with agreement type Microsoft Customer Agreement + /// or Microsoft Partner Agreement. /// /// /// @@ -306,5 +330,56 @@ public partial interface IProductsOperations /// Thrown when a required parameter is null /// Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the products for a billing profile. These don't include + /// products billed based on usage. 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. + /// + /// + /// The 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 + /// + Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the products for an invoice section. These don't include + /// products billed based on usage. The operation is supported only for + /// billing accounts with agreement type Microsoft Customer Agreement. + /// + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The 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 + /// + Task>> ListByInvoiceSectionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs index c45367cbf434b..4f8e8eff78117 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs @@ -24,203 +24,15 @@ namespace Microsoft.Azure.Management.Billing public partial interface ITransactionsOperations { /// - /// Lists the transactions by customer id for given start date and end - /// date. - /// - /// - /// - /// billing Account Id. - /// - /// - /// Customer name. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports - /// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - /// support 'ne', 'or', or 'not'. Tag filter is a key value pair string - /// where key and value is separated by a colon (:). - /// - /// - /// The 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 - /// - Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string periodStartDate, string periodEndDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the transactions by billing account name for given start and - /// end date. - /// - /// - /// - /// billing Account Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports - /// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - /// support 'ne', 'or', or 'not'. Tag filter is a key value pair string - /// where key and value is separated by a colon (:). - /// - /// - /// The 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 - /// - Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the transactions by billing profile name for given start date - /// and end date. - /// - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports - /// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - /// support 'ne', 'or', or 'not'. Tag filter is a key value pair string - /// where key and value is separated by a colon (:). - /// - /// - /// The 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 - /// - Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the transactions by invoice section name for given start date - /// and end date. + /// Lists the transactions for an invoice. Transactions include + /// purchases, refunds and Azure usage charges. /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Start date - /// - /// - /// End date + /// The ID that uniquely identifies a billing account. /// - /// - /// May be used to filter by transaction kind. The filter supports - /// 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently - /// support 'ne', 'or', or 'not'. Tag filter is a key value pair string - /// where key and value is separated by a colon (:). - /// - /// - /// The 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 - /// - Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string periodStartDate, string periodEndDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get the transaction. - /// - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Transaction name. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// The 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 - /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string transactionName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the transactions by customer id for given start date and end - /// date. - /// - /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The ID that uniquely identifies an invoice. /// /// /// The headers that will be added to request. @@ -237,10 +49,10 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInvoiceWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists the transactions by billing account name for given start and - /// end date. + /// Lists the transactions for an invoice. Transactions include + /// purchases, refunds and Azure usage charges. /// /// /// @@ -261,6 +73,6 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByInvoiceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InstructionsOperations.cs similarity index 82% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InstructionsOperations.cs index e624b752ef7a7..8d35a98a38848 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InstructionsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Billing using System.Threading.Tasks; /// - /// PaymentMethodsOperations operations. + /// InstructionsOperations operations. /// - internal partial class PaymentMethodsOperations : IServiceOperations, IPaymentMethodsOperations + internal partial class InstructionsOperations : IServiceOperations, IInstructionsOperations { /// - /// Initializes a new instance of the PaymentMethodsOperations class. + /// Initializes a new instance of the InstructionsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class PaymentMethodsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal PaymentMethodsOperations(BillingManagementClient client) + internal InstructionsOperations(BillingManagementClient client) { if (client == null) { @@ -51,11 +51,14 @@ internal PaymentMethodsOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists the Payment Methods by billing account Id. - /// + /// Lists the instructions by billing profile id. + /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// Headers that will be added to request. @@ -78,12 +81,16 @@ internal PaymentMethodsOperations(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>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -96,13 +103,15 @@ internal PaymentMethodsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", 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}/paymentMethods").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions").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) { @@ -196,7 +205,7 @@ internal PaymentMethodsOperations(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")) @@ -209,7 +218,7 @@ internal PaymentMethodsOperations(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) { @@ -229,14 +238,18 @@ internal PaymentMethodsOperations(BillingManagementClient client) } /// - /// Lists the Payment Methods by billing profile Id. + /// Get the instruction by name. These are custom billing instructions and are + /// only applicable for certain customers. /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Billing Profile Id. + /// The ID that uniquely identifies a billing profile. + /// + /// + /// Instruction Name. /// /// /// Headers that will be added to request. @@ -259,8 +272,12 @@ internal PaymentMethodsOperations(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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string instructionName, 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"); @@ -269,9 +286,9 @@ internal PaymentMethodsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } - if (Client.ApiVersion == null) + if (instructionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "instructionName"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -282,14 +299,16 @@ internal PaymentMethodsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("instructionName", instructionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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}/paymentMethods").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{instructionName}", System.Uri.EscapeDataString(instructionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -383,7 +402,7 @@ internal PaymentMethodsOperations(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")) @@ -396,7 +415,7 @@ internal PaymentMethodsOperations(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) { @@ -416,11 +435,20 @@ internal PaymentMethodsOperations(BillingManagementClient client) } /// - /// Lists the Payment Methods by billing account Id. - /// + /// Creates or updates an instruction. These are custom billing instructions + /// and are only applicable for certain customers. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// Instruction Name. + /// + /// + /// The new instruction. /// /// /// Headers that will be added to request. @@ -443,11 +471,31 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> PutWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string instructionName, Instruction parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + 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 (instructionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "instructionName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -456,14 +504,24 @@ internal PaymentMethodsOperations(BillingManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("instructionName", instructionName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{instructionName}", System.Uri.EscapeDataString(instructionName)); 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); @@ -471,7 +529,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -502,6 +560,12 @@ internal PaymentMethodsOperations(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) { @@ -552,7 +616,7 @@ internal PaymentMethodsOperations(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")) @@ -565,7 +629,7 @@ internal PaymentMethodsOperations(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) { @@ -585,7 +649,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) } /// - /// Lists the Payment Methods by billing profile Id. + /// Lists the instructions by billing profile id. /// /// /// @@ -612,7 +676,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingProfileNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -721,7 +785,7 @@ internal PaymentMethodsOperations(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")) @@ -734,7 +798,7 @@ internal PaymentMethodsOperations(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) { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InstructionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InstructionsOperationsExtensions.cs new file mode 100644 index 0000000000000..449f73587cc05 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InstructionsOperationsExtensions.cs @@ -0,0 +1,207 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for InstructionsOperations. + /// + public static partial class InstructionsOperationsExtensions + { + /// + /// Lists the instructions by billing profile id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + public static IPage ListByBillingProfile(this IInstructionsOperations operations, string billingAccountName, string billingProfileName) + { + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + } + + /// + /// Lists the instructions by billing profile id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingProfileAsync(this IInstructionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the instruction by name. These are custom billing instructions and are + /// only applicable for certain customers. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// Instruction Name. + /// + public static Instruction Get(this IInstructionsOperations operations, string billingAccountName, string billingProfileName, string instructionName) + { + return operations.GetAsync(billingAccountName, billingProfileName, instructionName).GetAwaiter().GetResult(); + } + + /// + /// Get the instruction by name. These are custom billing instructions and are + /// only applicable for certain customers. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// Instruction Name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IInstructionsOperations operations, string billingAccountName, string billingProfileName, string instructionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, instructionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an instruction. These are custom billing instructions + /// and are only applicable for certain customers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// Instruction Name. + /// + /// + /// The new instruction. + /// + public static Instruction Put(this IInstructionsOperations operations, string billingAccountName, string billingProfileName, string instructionName, Instruction parameters) + { + return operations.PutAsync(billingAccountName, billingProfileName, instructionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an instruction. These are custom billing instructions + /// and are only applicable for certain customers. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// Instruction Name. + /// + /// + /// The new instruction. + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IInstructionsOperations operations, string billingAccountName, string billingProfileName, string instructionName, Instruction parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(billingAccountName, billingProfileName, instructionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the instructions by billing profile id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingProfileNext(this IInstructionsOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the instructions by billing profile id. + /// + /// + /// + /// 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 IInstructionsOperations 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/InvoiceSectionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs index 7d5c20abb616e..b3bc4425506bb 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs @@ -51,13 +51,16 @@ internal InvoiceSectionsOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists all invoice sections for a user which he has access to. + /// Lists the invoice sections that a user has access to. 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. @@ -80,7 +83,7 @@ internal InvoiceSectionsOperations(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) { @@ -204,7 +207,7 @@ internal InvoiceSectionsOperations(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 +220,7 @@ internal InvoiceSectionsOperations(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,16 +240,18 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } /// - /// Get the InvoiceSection by id. + /// Gets an invoice section by its ID. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// Headers that will be added to request. @@ -432,16 +437,49 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } /// - /// Elevates the caller's access to match their billing profile access. + /// Creates or updates an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. + /// + /// + /// The new or updated invoice section. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates an invoice section. The operation is supported only for + /// billing accounts with agreement type Microsoft Customer Agreement. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// The ID that uniquely identifies an invoice section. + /// + /// + /// The new or updated invoice section. /// /// /// Headers that will be added to request. @@ -452,6 +490,9 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -461,8 +502,12 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection 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"); @@ -475,6 +520,10 @@ internal InvoiceSectionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -485,16 +534,211 @@ internal InvoiceSectionsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ElevateToBillingProfile", tracingParameters); + 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}/invoiceSections/{invoiceSectionName}/elevate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}").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) + { + _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 invoice sections that a user has access to. The operation is + /// supported only for billing accounts with agreement type Microsoft Customer + /// 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>> 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); @@ -502,7 +746,7 @@ internal InvoiceSectionsOperations(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) @@ -553,7 +797,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -583,13 +827,31 @@ internal InvoiceSectionsOperations(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")) { _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); diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs index 7af286ac9968f..c64d66b02f9a2 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs @@ -22,38 +22,44 @@ namespace Microsoft.Azure.Management.Billing public static partial class InvoiceSectionsOperationsExtensions { /// - /// Lists all invoice sections for a user which he has access to. + /// Lists the invoice sections that a user has access to. 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 InvoiceSectionListResult ListByBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName) + public static IPage ListByBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName) { return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// - /// Lists all invoice sections for a user which he has access to. + /// Lists the invoice sections that a user has access to. 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 ListByBillingProfileAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { @@ -62,19 +68,21 @@ public static InvoiceSectionListResult ListByBillingProfile(this IInvoiceSection } /// - /// Get the InvoiceSection by id. + /// Gets an invoice section by its ID. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// public static InvoiceSection Get(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { @@ -82,19 +90,21 @@ public static InvoiceSection Get(this IInvoiceSectionsOperations operations, str } /// - /// Get the InvoiceSection by id. + /// Gets an invoice section by its ID. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// The cancellation token. @@ -106,48 +116,154 @@ public static InvoiceSection Get(this IInvoiceSectionsOperations operations, str return _result.Body; } } - + /// - /// Elevates the caller's access to match their billing profile access. + /// Creates or updates an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. + /// + /// + /// The new or updated invoice section. /// - public static void ElevateToBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) + public static InvoiceSection CreateOrUpdate(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters) { - operations.ElevateToBillingProfileAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// - /// Elevates the caller's access to match their billing profile access. + /// Creates or updates an invoice section. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. + /// + /// + /// The new or updated invoice section. /// /// /// The cancellation token. /// - public static async Task ElevateToBillingProfileAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an invoice section. 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. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// The ID that uniquely identifies an invoice section. + /// + /// + /// The new or updated invoice section. + /// + public static InvoiceSection BeginCreateOrUpdate(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters) { - (await operations.ElevateToBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return operations.BeginCreateOrUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } + + /// + /// Creates or updates an invoice section. 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. + /// + /// + /// The ID that uniquely identifies a billing profile. + /// + /// + /// The ID that uniquely identifies an invoice section. + /// + /// + /// The new or updated invoice section. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the invoice sections that a user has access to. The operation is + /// supported only for billing accounts with agreement type Microsoft Customer + /// Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingProfileNext(this IInvoiceSectionsOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the invoice sections that a user has access to. The operation is + /// supported only for billing accounts with agreement type Microsoft Customer + /// 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> ListByBillingProfileNextAsync(this IInvoiceSectionsOperations 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/InvoicesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs index 4cac11ec28a39..23bb29215f1d9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs @@ -51,16 +51,21 @@ internal InvoicesOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// List of invoices for a billing account. + /// Lists the invoices for a billing account for a given start date and end + /// date. 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. /// /// - /// Invoice period start date. + /// The start date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// - /// Invoice period end date. + /// The end date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// /// Headers that will be added to request. @@ -83,7 +88,7 @@ internal InvoicesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -219,7 +224,7 @@ internal InvoicesOperations(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")) @@ -232,7 +237,7 @@ internal InvoicesOperations(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) { @@ -252,19 +257,24 @@ internal InvoicesOperations(BillingManagementClient client) } /// - /// List of invoices for a billing profile. + /// Lists the invoices for a billing profile for a given start date and end + /// date. 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. /// /// - /// Invoice period start date. + /// The start date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// - /// Invoice period end date. + /// The end date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// /// Headers that will be added to request. @@ -287,7 +297,7 @@ internal InvoicesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -429,7 +439,7 @@ internal InvoicesOperations(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")) @@ -442,7 +452,7 @@ internal InvoicesOperations(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) { @@ -462,16 +472,16 @@ internal InvoicesOperations(BillingManagementClient client) } /// - /// Get the invoice by name. + /// Gets an invoice by billing account name and ID. The operation is supported + /// for billing accounts with agreement type Microsoft Partner Agreement or + /// Microsoft Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies an invoice. /// /// /// Headers that will be added to request. @@ -494,7 +504,7 @@ internal InvoicesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -504,10 +514,6 @@ internal InvoicesOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (billingProfileName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); - } if (invoiceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceName"); @@ -520,16 +526,14 @@ internal InvoicesOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceName", invoiceName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", 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}/invoices/{invoiceName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{invoiceName}", System.Uri.EscapeDataString(invoiceName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -657,15 +661,216 @@ internal InvoicesOperations(BillingManagementClient client) } /// - /// Lists invoices by billing subscriptions name. + /// Gets an invoice by ID. The operation is supported for billing accounts with + /// agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// 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> GetByIdWithHttpMessagesAsync(string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (invoiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("invoiceName", invoiceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}").ToString(); + _url = _url.Replace("{invoiceName}", System.Uri.EscapeDataString(invoiceName)); + 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("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; + } + + /// + /// Gets a URL to download an invoice. 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. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. /// - /// - /// Billing Subscription Id. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. /// + public async Task> DownloadInvoiceWithHttpMessagesAsync(string billingAccountName, string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDownloadInvoiceWithHttpMessagesAsync(billingAccountName, invoiceName, downloadToken, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists the invoices for a subscription. + /// + /// /// /// Invoice period start date. /// @@ -693,15 +898,11 @@ internal InvoicesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingSubscriptionWithHttpMessagesAsync(string billingAccountName, string billingSubscriptionName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingSubscriptionWithHttpMessagesAsync(string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (billingAccountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); - } - if (billingSubscriptionName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (periodStartDate == null) { @@ -722,8 +923,6 @@ internal InvoicesOperations(BillingManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); tracingParameters.Add("periodStartDate", periodStartDate); tracingParameters.Add("periodEndDate", periodEndDate); tracingParameters.Add("cancellationToken", cancellationToken); @@ -731,9 +930,8 @@ internal InvoicesOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}/invoices").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (periodStartDate != null) { @@ -868,17 +1066,11 @@ internal InvoicesOperations(BillingManagementClient client) } /// - /// Gets the invoice by name. + /// Gets an invoice by subscription ID and invoice ID. /// /// - /// - /// billing Account Id. - /// - /// - /// Billing Subscription Id. - /// /// - /// Invoice Id. + /// The ID that uniquely identifies an invoice. /// /// /// Headers that will be added to request. @@ -901,15 +1093,11 @@ internal InvoicesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByIdWithHttpMessagesAsync(string billingAccountName, string billingSubscriptionName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetBySubscriptionAndInvoiceIdWithHttpMessagesAsync(string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (billingAccountName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); - } - if (billingSubscriptionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (invoiceName == null) { @@ -926,17 +1114,14 @@ internal InvoicesOperations(BillingManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); tracingParameters.Add("invoiceName", invoiceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetBySubscriptionAndInvoiceId", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{billingSubscriptionName}/invoices/{invoiceName}").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{invoiceName}", System.Uri.EscapeDataString(invoiceName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1064,7 +1249,794 @@ internal InvoicesOperations(BillingManagementClient client) } /// - /// Lists invoices by billing subscriptions name. + /// Gets a URL to download an invoice. + /// + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(invoiceName, downloadToken, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a URL to download an invoice. The operation is supported for billing + /// accounts with agreement type Microsoft Partner Agreement or Microsoft + /// Customer Agreement. + /// + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + /// + /// 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> BeginDownloadInvoiceWithHttpMessagesAsync(string billingAccountName, string invoiceName, string downloadToken, 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 (invoiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceName"); + } + if (downloadToken == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "downloadToken"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("invoiceName", invoiceName); + tracingParameters.Add("downloadToken", downloadToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDownloadInvoice", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{invoiceName}", System.Uri.EscapeDataString(invoiceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (downloadToken != null) + { + _queryParameters.Add(string.Format("downloadToken={0}", System.Uri.EscapeDataString(downloadToken))); + } + 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("POST"); + _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 && (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; + } + + /// + /// Gets a URL to download an invoice. + /// + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + /// + /// 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> BeginDownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(string invoiceName, string downloadToken, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (invoiceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceName"); + } + if (downloadToken == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "downloadToken"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("invoiceName", invoiceName); + tracingParameters.Add("downloadToken", downloadToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDownloadBillingSubscriptionInvoice", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{invoiceName}", System.Uri.EscapeDataString(invoiceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (downloadToken != null) + { + _queryParameters.Add(string.Format("downloadToken={0}", System.Uri.EscapeDataString(downloadToken))); + } + 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("POST"); + _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 && (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 invoices for a billing account for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or Microsoft Customer 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; + } + + /// + /// Lists the invoices for a billing profile for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or Microsoft Customer 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>> 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) + { + _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 invoices for a subscription. /// /// /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs index 3fc286486009b..51e787b272ca4 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs @@ -22,44 +22,54 @@ namespace Microsoft.Azure.Management.Billing public static partial class InvoicesOperationsExtensions { /// - /// List of invoices for a billing account. + /// Lists the invoices for a billing account for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice period start date. + /// The start date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// - /// Invoice period end date. + /// The end date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// - public static InvoiceListResult ListByBillingAccount(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate) + public static IPage ListByBillingAccount(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate) { return operations.ListByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate).GetAwaiter().GetResult(); } /// - /// List of invoices for a billing account. + /// Lists the invoices for a billing account for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice period start date. + /// The start date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// - /// Invoice period end date. + /// The end date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// /// The cancellation token. /// - public static async Task ListByBillingAccountAsync(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) { @@ -68,50 +78,60 @@ public static InvoiceListResult ListByBillingAccount(this IInvoicesOperations op } /// - /// List of invoices for a billing profile. + /// Lists the invoices for a billing profile for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or 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. /// /// - /// Invoice period start date. + /// The start date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// - /// Invoice period end date. + /// The end date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// - public static InvoiceListResult ListByBillingProfile(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate) + public static IPage ListByBillingProfile(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate) { return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate).GetAwaiter().GetResult(); } /// - /// List of invoices for a billing profile. + /// Lists the invoices for a billing profile for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or 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. /// /// - /// Invoice period start date. + /// The start date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// - /// Invoice period end date. + /// The end date to fetch the invoices. The date should be specified in + /// MM-DD-YYYY format. /// /// /// The cancellation token. /// - public static async Task ListByBillingProfileAsync(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) { @@ -120,63 +140,147 @@ public static InvoiceListResult ListByBillingProfile(this IInvoicesOperations op } /// - /// Get the invoice by name. + /// Gets an invoice by billing account name and ID. The operation is supported + /// for billing accounts with agreement type Microsoft Partner Agreement or + /// Microsoft Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies an invoice. /// - public static Invoice Get(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName) + public static Invoice Get(this IInvoicesOperations operations, string billingAccountName, string invoiceName) { - return operations.GetAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, invoiceName).GetAwaiter().GetResult(); } /// - /// Get the invoice by name. + /// Gets an invoice by billing account name and ID. The operation is supported + /// for billing accounts with agreement type Microsoft Partner Agreement or + /// 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 an invoice. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IInvoicesOperations operations, string billingAccountName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an invoice by ID. The operation is supported for billing accounts with + /// agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + public static Invoice GetById(this IInvoicesOperations operations, string invoiceName) + { + return operations.GetByIdAsync(invoiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets an invoice by ID. The operation is supported for billing accounts with + /// agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. /// /// - /// Invoice Id. + /// The ID that uniquely identifies an invoice. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByIdAsync(this IInvoicesOperations operations, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByIdWithHttpMessagesAsync(invoiceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists invoices by billing subscriptions name. + /// Gets a URL to download an invoice. The operation is supported for billing + /// accounts with agreement type Microsoft Partner Agreement or Microsoft + /// Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + public static DownloadUrl DownloadInvoice(this IInvoicesOperations operations, string billingAccountName, string invoiceName, string downloadToken) + { + return operations.DownloadInvoiceAsync(billingAccountName, invoiceName, downloadToken).GetAwaiter().GetResult(); + } + + /// + /// Gets a URL to download an invoice. The operation is supported for billing + /// accounts with agreement type Microsoft Partner Agreement or Microsoft + /// Customer Agreement. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. /// - /// - /// Billing Subscription Id. + /// + /// The cancellation token. + /// + public static async Task DownloadInvoiceAsync(this IInvoicesOperations operations, string billingAccountName, string invoiceName, string downloadToken, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DownloadInvoiceWithHttpMessagesAsync(billingAccountName, invoiceName, downloadToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the invoices for a subscription. + /// + /// + /// + /// The operations group for this extension method. /// /// /// Invoice period start date. @@ -184,24 +288,18 @@ public static Invoice Get(this IInvoicesOperations operations, string billingAcc /// /// Invoice period end date. /// - public static IPage ListByBillingSubscription(this IInvoicesOperations operations, string billingAccountName, string billingSubscriptionName, string periodStartDate, string periodEndDate) + public static IPage ListByBillingSubscription(this IInvoicesOperations operations, string periodStartDate, string periodEndDate) { - return operations.ListByBillingSubscriptionAsync(billingAccountName, billingSubscriptionName, periodStartDate, periodEndDate).GetAwaiter().GetResult(); + return operations.ListByBillingSubscriptionAsync(periodStartDate, periodEndDate).GetAwaiter().GetResult(); } /// - /// Lists invoices by billing subscriptions name. + /// Lists the invoices for a subscription. /// /// /// /// The operations group for this extension method. /// - /// - /// billing Account Id. - /// - /// - /// Billing Subscription Id. - /// /// /// Invoice period start date. /// @@ -211,64 +309,268 @@ public static IPage ListByBillingSubscription(this IInvoicesOperations /// /// The cancellation token. /// - public static async Task> ListByBillingSubscriptionAsync(this IInvoicesOperations operations, string billingAccountName, string billingSubscriptionName, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingSubscriptionAsync(this IInvoicesOperations operations, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingSubscriptionWithHttpMessagesAsync(billingAccountName, billingSubscriptionName, periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingSubscriptionWithHttpMessagesAsync(periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Gets the invoice by name. + /// Gets an invoice by subscription ID and invoice ID. /// /// /// /// The operations group for this extension method. /// - /// - /// billing Account Id. + /// + /// The ID that uniquely identifies an invoice. + /// + public static Invoice GetBySubscriptionAndInvoiceId(this IInvoicesOperations operations, string invoiceName) + { + return operations.GetBySubscriptionAndInvoiceIdAsync(invoiceName).GetAwaiter().GetResult(); + } + + /// + /// Gets an invoice by subscription ID and invoice ID. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// The cancellation token. + /// + public static async Task GetBySubscriptionAndInvoiceIdAsync(this IInvoicesOperations operations, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetBySubscriptionAndInvoiceIdWithHttpMessagesAsync(invoiceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a URL to download an invoice. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + public static DownloadUrl DownloadBillingSubscriptionInvoice(this IInvoicesOperations operations, string invoiceName, string downloadToken) + { + return operations.DownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken).GetAwaiter().GetResult(); + } + + /// + /// Gets a URL to download an invoice. + /// + /// + /// + /// The operations group for this extension method. /// - /// - /// Billing Subscription Id. + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + /// + /// The cancellation token. + /// + public static async Task DownloadBillingSubscriptionInvoiceAsync(this IInvoicesOperations operations, string invoiceName, string downloadToken, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(invoiceName, downloadToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a URL to download an invoice. The operation is supported for billing + /// accounts with agreement type Microsoft Partner Agreement or Microsoft + /// Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. /// - public static Invoice GetById(this IInvoicesOperations operations, string billingAccountName, string billingSubscriptionName, string invoiceName) + public static DownloadUrl BeginDownloadInvoice(this IInvoicesOperations operations, string billingAccountName, string invoiceName, string downloadToken) { - return operations.GetByIdAsync(billingAccountName, billingSubscriptionName, invoiceName).GetAwaiter().GetResult(); + return operations.BeginDownloadInvoiceAsync(billingAccountName, invoiceName, downloadToken).GetAwaiter().GetResult(); } /// - /// Gets the invoice by name. + /// Gets a URL to download an invoice. The operation is supported for billing + /// accounts with agreement type Microsoft Partner Agreement or Microsoft + /// Customer Agreement. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. + /// + /// + /// The ID that uniquely identifies an invoice. /// - /// - /// Billing Subscription Id. + /// + /// Download token with document source and document ID. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDownloadInvoiceAsync(this IInvoicesOperations operations, string billingAccountName, string invoiceName, string downloadToken, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDownloadInvoiceWithHttpMessagesAsync(billingAccountName, invoiceName, downloadToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a URL to download an invoice. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + public static DownloadUrl BeginDownloadBillingSubscriptionInvoice(this IInvoicesOperations operations, string invoiceName, string downloadToken) + { + return operations.BeginDownloadBillingSubscriptionInvoiceAsync(invoiceName, downloadToken).GetAwaiter().GetResult(); + } + + /// + /// Gets a URL to download an invoice. + /// + /// + /// + /// The operations group for this extension method. /// /// - /// Invoice Id. + /// The ID that uniquely identifies an invoice. + /// + /// + /// Download token with document source and document ID. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDownloadBillingSubscriptionInvoiceAsync(this IInvoicesOperations operations, string invoiceName, string downloadToken, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDownloadBillingSubscriptionInvoiceWithHttpMessagesAsync(invoiceName, downloadToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the invoices for a billing account for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountNext(this IInvoicesOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the invoices for a billing account for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or Microsoft Customer 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 IInvoicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the invoices for a billing profile for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingProfileNext(this IInvoicesOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the invoices for a billing profile for a given start date and end + /// date. The operation is supported for billing accounts with agreement type + /// Microsoft Partner Agreement or Microsoft Customer 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 GetByIdAsync(this IInvoicesOperations operations, string billingAccountName, string billingSubscriptionName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileNextAsync(this IInvoicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByIdWithHttpMessagesAsync(billingAccountName, billingSubscriptionName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists invoices by billing subscriptions name. + /// Lists the invoices for a subscription. /// /// /// @@ -283,7 +585,7 @@ public static IPage ListByBillingSubscriptionNext(this IInvoicesOperati } /// - /// Lists invoices by billing subscriptions name. + /// Lists the invoices for a subscription. /// /// /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AcceptTransferRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AcceptTransferRequest.cs deleted file mode 100644 index 551bc26630b99..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AcceptTransferRequest.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Request parameters to accept transfer. - /// - [Rest.Serialization.JsonTransformation] - public partial class AcceptTransferRequest - { - /// - /// Initializes a new instance of the AcceptTransferRequest class. - /// - public AcceptTransferRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AcceptTransferRequest class. - /// - /// Request parameters to accept - /// transfer. - public AcceptTransferRequest(IList productDetails = default(IList)) - { - ProductDetails = productDetails; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets request parameters to accept transfer. - /// - [JsonProperty(PropertyName = "properties.productDetails")] - public IList ProductDetails { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AcceptanceMode.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AcceptanceMode.cs new file mode 100644 index 0000000000000..a6257a0c5c3de --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AcceptanceMode.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for AcceptanceMode. + /// + public static class AcceptanceMode + { + public const string ClickToAccept = "ClickToAccept"; + public const string ESignEmbedded = "ESignEmbedded"; + public const string ESignOffline = "ESignOffline"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EligibleProductType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AccountStatus.cs similarity index 51% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EligibleProductType.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AccountStatus.cs index 7e0f48d197d69..51802b73f8b75 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EligibleProductType.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AccountStatus.cs @@ -12,12 +12,16 @@ namespace Microsoft.Azure.Management.Billing.Models { /// - /// Defines values for EligibleProductType. + /// Defines values for AccountStatus. /// - public static class EligibleProductType + public static class AccountStatus { - public const string DevTestAzureSubscription = "DevTestAzureSubscription"; - public const string StandardAzureSubscription = "StandardAzureSubscription"; - public const string AzureReservation = "AzureReservation"; + public const string Active = "Active"; + public const string Deleted = "Deleted"; + public const string Disabled = "Disabled"; + public const string Expired = "Expired"; + public const string Transferred = "Transferred"; + public const string Extended = "Extended"; + public const string Terminated = "Terminated"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AccountType.cs similarity index 88% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AccountType.cs index f3aa34eb08481..39da7284d44c9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AccountType.cs @@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.Billing.Models { /// - /// Defines values for CustomerType. + /// Defines values for AccountType. /// - public static class CustomerType + public static class AccountType { public const string Enterprise = "Enterprise"; public const string Individual = "Individual"; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs index 82031e2a89f46..be2312fb279be 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.Billing.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -29,18 +30,21 @@ public AddressDetails() /// /// Initializes a new instance of the AddressDetails class. /// - /// First Name. - /// Last Name. - /// Company Name. - /// Address Line1. - /// Address Line2. - /// Address Line3. - /// Address City. - /// Address Region. + /// Address line 1. /// Country code uses ISO2, 2-digit /// format. - /// Address Postal Code. - public AddressDetails(string firstName = default(string), string lastName = default(string), string companyName = default(string), string addressLine1 = default(string), string addressLine2 = default(string), string addressLine3 = default(string), string city = default(string), string region = default(string), string country = default(string), string postalCode = default(string)) + /// First name. + /// Last name. + /// Company name. + /// Address line 2. + /// Address line 3. + /// Address city. + /// Address district. + /// Address region. + /// Postal code. + /// Email address. + /// Phone number. + public AddressDetails(string addressLine1, string country, string firstName = default(string), string lastName = default(string), string companyName = default(string), string addressLine2 = default(string), string addressLine3 = default(string), string city = default(string), string district = default(string), string region = default(string), string postalCode = default(string), string email = default(string), string phoneNumber = default(string)) { FirstName = firstName; LastName = lastName; @@ -49,9 +53,12 @@ public AddressDetails() AddressLine2 = addressLine2; AddressLine3 = addressLine3; City = city; + District = district; Region = region; Country = country; PostalCode = postalCode; + Email = email; + PhoneNumber = phoneNumber; CustomInit(); } @@ -61,49 +68,55 @@ public AddressDetails() partial void CustomInit(); /// - /// Gets or sets first Name. + /// Gets or sets first name. /// [JsonProperty(PropertyName = "firstName")] public string FirstName { get; set; } /// - /// Gets or sets last Name. + /// Gets or sets last name. /// [JsonProperty(PropertyName = "lastName")] public string LastName { get; set; } /// - /// Gets or sets company Name. + /// Gets or sets company name. /// [JsonProperty(PropertyName = "companyName")] public string CompanyName { get; set; } /// - /// Gets or sets address Line1. + /// Gets or sets address line 1. /// [JsonProperty(PropertyName = "addressLine1")] public string AddressLine1 { get; set; } /// - /// Gets or sets address Line2. + /// Gets or sets address line 2. /// [JsonProperty(PropertyName = "addressLine2")] public string AddressLine2 { get; set; } /// - /// Gets or sets address Line3. + /// Gets or sets address line 3. /// [JsonProperty(PropertyName = "addressLine3")] public string AddressLine3 { get; set; } /// - /// Gets or sets address City. + /// Gets or sets address city. /// [JsonProperty(PropertyName = "city")] public string City { get; set; } /// - /// Gets or sets address Region. + /// Gets or sets address district. + /// + [JsonProperty(PropertyName = "district")] + public string District { get; set; } + + /// + /// Gets or sets address region. /// [JsonProperty(PropertyName = "region")] public string Region { get; set; } @@ -115,10 +128,39 @@ public AddressDetails() public string Country { get; set; } /// - /// Gets or sets address Postal Code. + /// Gets or sets postal code. /// [JsonProperty(PropertyName = "postalCode")] public string PostalCode { get; set; } + /// + /// Gets or sets email address. + /// + [JsonProperty(PropertyName = "email")] + public string Email { get; set; } + + /// + /// Gets or sets phone number. + /// + [JsonProperty(PropertyName = "phoneNumber")] + public string PhoneNumber { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AddressLine1 == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AddressLine1"); + } + if (Country == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Country"); + } + } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Agreement.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Agreement.cs index f34d3e86093b3..ef8b3b47aa74c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Agreement.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Agreement.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// An agreement resource. + /// An agreement. /// [Rest.Serialization.JsonTransformation] public partial class Agreement : Resource @@ -37,16 +37,27 @@ public Agreement() /// Resource Id. /// Resource name. /// Resource type. - /// The link to the agreement. - /// Effective date. - /// Expiration date. - /// Participants or signer of the + /// The URL to download the /// agreement. - /// The agreement status - public Agreement(string id = default(string), string name = default(string), string type = default(string), string agreementLink = default(string), System.DateTime? effectiveDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), IList participants = default(IList), string status = default(string)) + /// The category of the agreement signed by a + /// customer. Possible values include: 'MicrosoftCustomerAgreement', + /// 'AffiliatePurchaseTerms', 'Other' + /// The mode of acceptance for an + /// agreement. Possible values include: 'ClickToAccept', + /// 'ESignEmbedded', 'ESignOffline' + /// The date from which the agreement is + /// effective. + /// The date when the agreement + /// expires. + /// The list of participants that + /// participates in acceptance of an agreement. + /// The current status of the agreement. + public Agreement(string id = default(string), string name = default(string), string type = default(string), string agreementLink = default(string), string category = default(string), string acceptanceMode = default(string), System.DateTime? effectiveDate = default(System.DateTime?), System.DateTime? expirationDate = default(System.DateTime?), IList participants = default(IList), string status = default(string)) : base(id, name, type) { AgreementLink = agreementLink; + Category = category; + AcceptanceMode = acceptanceMode; EffectiveDate = effectiveDate; ExpirationDate = expirationDate; Participants = participants; @@ -60,31 +71,47 @@ public Agreement() partial void CustomInit(); /// - /// Gets the link to the agreement. + /// Gets the URL to download the agreement. /// [JsonProperty(PropertyName = "properties.agreementLink")] public string AgreementLink { get; private set; } /// - /// Gets effective date. + /// Gets the category of the agreement signed by a customer. Possible + /// values include: 'MicrosoftCustomerAgreement', + /// 'AffiliatePurchaseTerms', 'Other' + /// + [JsonProperty(PropertyName = "properties.category")] + public string Category { get; private set; } + + /// + /// Gets the mode of acceptance for an agreement. Possible values + /// include: 'ClickToAccept', 'ESignEmbedded', 'ESignOffline' + /// + [JsonProperty(PropertyName = "properties.acceptanceMode")] + public string AcceptanceMode { get; private set; } + + /// + /// Gets the date from which the agreement is effective. /// [JsonProperty(PropertyName = "properties.effectiveDate")] public System.DateTime? EffectiveDate { get; private set; } /// - /// Gets expiration date. + /// Gets the date when the agreement expires. /// [JsonProperty(PropertyName = "properties.expirationDate")] public System.DateTime? ExpirationDate { get; private set; } /// - /// Gets or sets participants or signer of the agreement. + /// Gets or sets the list of participants that participates in + /// acceptance of an agreement. /// [JsonProperty(PropertyName = "properties.participants")] public IList Participants { get; set; } /// - /// Gets the agreement status + /// Gets the current status of the agreement. /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementListResult.cs deleted file mode 100644 index a4ed77194a42b..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementListResult.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing agreements. - /// - public partial class AgreementListResult - { - /// - /// Initializes a new instance of the AgreementListResult class. - /// - public AgreementListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AgreementListResult class. - /// - /// The list of agreements. - /// The link (url) to the next page of - /// results. - public AgreementListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of agreements. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Amount.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Amount.cs index c82d4c302b306..9dde6d59e2804 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Amount.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Amount.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// The Amount. + /// The amount. /// public partial class Amount { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AutoRenew.cs similarity index 73% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AutoRenew.cs index c0910b8037339..34af34329611b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AutoRenew.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Billing.Models { /// - /// Defines values for Status. + /// Defines values for AutoRenew. /// - public static class Status + public static class AutoRenew { - public const string Approved = "Approved"; - public const string Rejected = "Rejected"; + public const string Off = "Off"; + public const string On = "On"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AvailableBalance.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AvailableBalance.cs index a581f7ff97796..b2955e2d9d1ae 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AvailableBalance.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AvailableBalance.cs @@ -16,7 +16,8 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Latest available balance on Monetary Credit PI. + /// The latest Azure credit balance. This is the balance available for pay + /// now. /// [Rest.Serialization.JsonTransformation] public partial class AvailableBalance : Resource @@ -35,7 +36,7 @@ public AvailableBalance() /// Resource Id. /// Resource name. /// Resource type. - /// Balance Amount. + /// Balance amount. public AvailableBalance(string id = default(string), string name = default(string), string type = default(string), Amount amount = default(Amount)) : base(id, name, type) { @@ -49,7 +50,7 @@ public AvailableBalance() partial void CustomInit(); /// - /// Gets balance Amount. + /// Gets balance amount. /// [JsonProperty(PropertyName = "properties.amount")] public Amount Amount { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs index 0c6c4ae3a058b..3e89d33d93e9d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Details about the azure plan. + /// Details of the Azure plan. /// public partial class AzurePlan { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccount.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccount.cs index 633f0f3bdbe27..d6f75c453bd23 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccount.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccount.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A billing account resource. + /// A billing account. /// [Rest.Serialization.JsonTransformation] public partial class BillingAccount : Resource @@ -38,15 +38,18 @@ public BillingAccount() /// Resource name. /// Resource type. /// The billing account name. - /// The address associated with billing - /// account. + /// The address of the individual or organization + /// that is responsible for the billing account. /// The type of agreement. Possible values /// include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', /// 'MicrosoftOnlineServicesProgram', /// 'MicrosoftPartnerAgreement' - /// The type of customer. Possible values + /// The type of customer. Possible values /// include: 'Enterprise', 'Individual', 'Partner' - /// The billing profiles associated to + /// The current status of the billing + /// account. Possible values include: 'Active', 'Deleted', 'Disabled', + /// 'Expired', 'Transferred', 'Extended', 'Terminated' + /// The billing profiles associated with /// the billing account. By default this is not populated, unless it's /// specified in $expand. /// The details about the associated @@ -56,19 +59,21 @@ public BillingAccount() /// enrollment. /// The accounts associated to the /// enrollment. - /// Organization id. - public BillingAccount(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), AddressDetails address = default(AddressDetails), string agreementType = default(string), string customerType = default(string), IList billingProfiles = default(IList), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), string organizationId = default(string)) + /// Indicates whether user has read access + /// to the billing account. + public BillingAccount(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), AddressDetails soldTo = default(AddressDetails), string agreementType = default(string), string accountType = default(string), string accountStatus = default(string), BillingProfilesOnExpand billingProfiles = default(BillingProfilesOnExpand), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), bool? hasReadAccess = default(bool?)) : base(id, name, type) { DisplayName = displayName; - Address = address; + SoldTo = soldTo; AgreementType = agreementType; - CustomerType = customerType; + AccountType = accountType; + AccountStatus = accountStatus; BillingProfiles = billingProfiles; EnrollmentDetails = enrollmentDetails; Departments = departments; EnrollmentAccounts = enrollmentAccounts; - OrganizationId = organizationId; + HasReadAccess = hasReadAccess; CustomInit(); } @@ -78,16 +83,17 @@ public BillingAccount() partial void CustomInit(); /// - /// Gets the billing account name. + /// Gets or sets the billing account name. /// [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } + public string DisplayName { get; set; } /// - /// Gets or sets the address associated with billing account. + /// Gets or sets the address of the individual or organization that is + /// responsible for the billing account. /// - [JsonProperty(PropertyName = "properties.address")] - public AddressDetails Address { get; set; } + [JsonProperty(PropertyName = "properties.soldTo")] + public AddressDetails SoldTo { get; set; } /// /// Gets the type of agreement. Possible values include: @@ -101,16 +107,24 @@ public BillingAccount() /// Gets the type of customer. Possible values include: 'Enterprise', /// 'Individual', 'Partner' /// - [JsonProperty(PropertyName = "properties.customerType")] - public string CustomerType { get; private set; } + [JsonProperty(PropertyName = "properties.accountType")] + public string AccountType { get; private set; } /// - /// Gets or sets the billing profiles associated to the billing + /// Gets the current status of the billing account. Possible values + /// include: 'Active', 'Deleted', 'Disabled', 'Expired', 'Transferred', + /// 'Extended', 'Terminated' + /// + [JsonProperty(PropertyName = "properties.accountStatus")] + public string AccountStatus { get; private set; } + + /// + /// Gets or sets the billing profiles associated with the billing /// account. By default this is not populated, unless it's specified in /// $expand. /// [JsonProperty(PropertyName = "properties.billingProfiles")] - public IList BillingProfiles { get; set; } + public BillingProfilesOnExpand BillingProfiles { get; set; } /// /// Gets the details about the associated legacy enrollment. By default @@ -132,10 +146,23 @@ public BillingAccount() public IList EnrollmentAccounts { get; set; } /// - /// Gets organization id. + /// Gets indicates whether user has read access to the billing account. /// - [JsonProperty(PropertyName = "properties.organizationId")] - public string OrganizationId { get; private set; } + [JsonProperty(PropertyName = "properties.hasReadAccess")] + public bool? HasReadAccess { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SoldTo != null) + { + SoldTo.Validate(); + } + } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountListResult.cs deleted file mode 100644 index 5cc14b8c31a10..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountListResult.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing billing accounts. - /// - public partial class BillingAccountListResult - { - /// - /// Initializes a new instance of the BillingAccountListResult class. - /// - public BillingAccountListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BillingAccountListResult class. - /// - /// The list of billing accounts. - /// The link (url) to the next page of - /// results. - public BillingAccountListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of billing accounts. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs index 473ad4d5ad98c..597cbbfc8e58e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs @@ -37,15 +37,18 @@ public BillingAccountUpdateRequest() /// class. /// /// The billing account name. - /// The address associated with billing - /// account. + /// The address of the individual or organization + /// that is responsible for the billing account. /// The type of agreement. Possible values /// include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', /// 'MicrosoftOnlineServicesProgram', /// 'MicrosoftPartnerAgreement' - /// The type of customer. Possible values + /// The type of customer. Possible values /// include: 'Enterprise', 'Individual', 'Partner' - /// The billing profiles associated to + /// The current status of the billing + /// account. Possible values include: 'Active', 'Deleted', 'Disabled', + /// 'Expired', 'Transferred', 'Extended', 'Terminated' + /// The billing profiles associated with /// the billing account. By default this is not populated, unless it's /// specified in $expand. /// The details about the associated @@ -55,18 +58,20 @@ public BillingAccountUpdateRequest() /// enrollment. /// The accounts associated to the /// enrollment. - /// Organization id. - public BillingAccountUpdateRequest(string displayName = default(string), AddressDetails address = default(AddressDetails), string agreementType = default(string), string customerType = default(string), IList billingProfiles = default(IList), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), string organizationId = default(string)) + /// Indicates whether user has read access + /// to the billing account. + public BillingAccountUpdateRequest(string displayName = default(string), AddressDetails soldTo = default(AddressDetails), string agreementType = default(string), string accountType = default(string), string accountStatus = default(string), BillingProfilesOnExpand billingProfiles = default(BillingProfilesOnExpand), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), bool? hasReadAccess = default(bool?)) { DisplayName = displayName; - Address = address; + SoldTo = soldTo; AgreementType = agreementType; - CustomerType = customerType; + AccountType = accountType; + AccountStatus = accountStatus; BillingProfiles = billingProfiles; EnrollmentDetails = enrollmentDetails; Departments = departments; EnrollmentAccounts = enrollmentAccounts; - OrganizationId = organizationId; + HasReadAccess = hasReadAccess; CustomInit(); } @@ -76,16 +81,17 @@ public BillingAccountUpdateRequest() partial void CustomInit(); /// - /// Gets the billing account name. + /// Gets or sets the billing account name. /// [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } + public string DisplayName { get; set; } /// - /// Gets or sets the address associated with billing account. + /// Gets or sets the address of the individual or organization that is + /// responsible for the billing account. /// - [JsonProperty(PropertyName = "properties.address")] - public AddressDetails Address { get; set; } + [JsonProperty(PropertyName = "properties.soldTo")] + public AddressDetails SoldTo { get; set; } /// /// Gets the type of agreement. Possible values include: @@ -99,16 +105,24 @@ public BillingAccountUpdateRequest() /// Gets the type of customer. Possible values include: 'Enterprise', /// 'Individual', 'Partner' /// - [JsonProperty(PropertyName = "properties.customerType")] - public string CustomerType { get; private set; } + [JsonProperty(PropertyName = "properties.accountType")] + public string AccountType { get; private set; } /// - /// Gets or sets the billing profiles associated to the billing + /// Gets the current status of the billing account. Possible values + /// include: 'Active', 'Deleted', 'Disabled', 'Expired', 'Transferred', + /// 'Extended', 'Terminated' + /// + [JsonProperty(PropertyName = "properties.accountStatus")] + public string AccountStatus { get; private set; } + + /// + /// Gets or sets the billing profiles associated with the billing /// account. By default this is not populated, unless it's specified in /// $expand. /// [JsonProperty(PropertyName = "properties.billingProfiles")] - public IList BillingProfiles { get; set; } + public BillingProfilesOnExpand BillingProfiles { get; set; } /// /// Gets the details about the associated legacy enrollment. By default @@ -130,10 +144,23 @@ public BillingAccountUpdateRequest() public IList EnrollmentAccounts { get; set; } /// - /// Gets organization id. + /// Gets indicates whether user has read access to the billing account. /// - [JsonProperty(PropertyName = "properties.organizationId")] - public string OrganizationId { get; private set; } + [JsonProperty(PropertyName = "properties.hasReadAccess")] + public bool? HasReadAccess { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SoldTo != null) + { + SoldTo.Validate(); + } + } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs deleted file mode 100644 index a1408e2c73730..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of list billingPermissions a caller has on a billing account. - /// - public partial class BillingPermissionsListResult - { - /// - /// Initializes a new instance of the BillingPermissionsListResult - /// class. - /// - public BillingPermissionsListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BillingPermissionsListResult - /// class. - /// - /// The list of billingPermissions a caller has on - /// a billing account. - public BillingPermissionsListResult(IList value = default(IList)) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of billingPermissions a caller has on a billing - /// account. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsProperties.cs index ecc35db60d467..4a5ad7ec7b9c9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsProperties.cs @@ -35,9 +35,9 @@ public BillingPermissionsProperties() /// class. /// /// The set of actions that the caller is allowed - /// to do - /// The set of actions the caller is not - /// allowed to do + /// to perform. + /// The set of actions that the caller is not + /// allowed to perform. public BillingPermissionsProperties(IList actions = default(IList), IList notActions = default(IList)) { Actions = actions; @@ -51,13 +51,13 @@ public BillingPermissionsProperties() partial void CustomInit(); /// - /// Gets the set of actions that the caller is allowed to do + /// Gets the set of actions that the caller is allowed to perform. /// [JsonProperty(PropertyName = "actions")] public IList Actions { get; private set; } /// - /// Gets the set of actions the caller is not allowed to do + /// Gets the set of actions that the caller is not allowed to perform. /// [JsonProperty(PropertyName = "notActions")] public IList NotActions { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs index dca0b5439273e..35a438a6a3d64 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfile.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A billing profile resource. + /// A billing profile. /// [Rest.Serialization.JsonTransformation] public partial class BillingProfile : Resource @@ -37,29 +37,48 @@ public BillingProfile() /// Resource Id. /// Resource name. /// Resource type. - /// The billing profile name. - /// Purchase order number. - /// Billing address. - /// If the billing profile is opted in - /// to receive invoices via email. - /// Invoice day. - /// The currency associated with the billing - /// profile. + /// The name of the billing profile. + /// The purchase order name that will appear on + /// the invoices generated for the billing profile. + /// Billing address. + /// Flag controlling whether the + /// invoices for the billing profile are sent through email. + /// The day of the month when the invoice for + /// the billing profile is generated. + /// The currency in which the charges for the + /// billing profile are billed. /// Information about the enabled azure /// plans. /// The invoice sections associated to - /// the billing profile. - public BillingProfile(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string poNumber = default(string), AddressDetails address = default(AddressDetails), bool? invoiceEmailOptIn = default(bool?), int? invoiceDay = default(int?), string currency = default(string), IList enabledAzurePlans = default(IList), IList invoiceSections = default(IList)) + /// the billing profile. By default this is not populated, unless it's + /// specified in $expand. + /// Indicates whether user has read access + /// to the billing profile. + /// The system generated unique identifier for a + /// billing profile. + /// The status of the billing profile. Possible + /// values include: 'Active', 'Disabled', 'Warned' + /// Reason for the specified billing + /// profile status. Possible values include: 'PastDue', + /// 'SpendingLimitReached', 'SpendingLimitExpired' + /// The billing profile spending limit. + /// Possible values include: 'Off', 'On' + public BillingProfile(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string poNumber = default(string), AddressDetails billTo = default(AddressDetails), bool? invoiceEmailOptIn = default(bool?), int? invoiceDay = default(int?), string currency = default(string), IList enabledAzurePlans = default(IList), InvoiceSectionsOnExpand invoiceSections = default(InvoiceSectionsOnExpand), bool? hasReadAccess = default(bool?), string systemId = default(string), string status = default(string), string statusReasonCode = default(string), string spendingLimit = default(string)) : base(id, name, type) { DisplayName = displayName; PoNumber = poNumber; - Address = address; + BillTo = billTo; InvoiceEmailOptIn = invoiceEmailOptIn; InvoiceDay = invoiceDay; Currency = currency; EnabledAzurePlans = enabledAzurePlans; InvoiceSections = invoiceSections; + HasReadAccess = hasReadAccess; + SystemId = systemId; + Status = status; + StatusReasonCode = statusReasonCode; + SpendingLimit = spendingLimit; CustomInit(); } @@ -69,13 +88,14 @@ public BillingProfile() partial void CustomInit(); /// - /// Gets or sets the billing profile name. + /// Gets or sets the name of the billing profile. /// [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } /// - /// Gets or sets purchase order number. + /// Gets or sets the purchase order name that will appear on the + /// invoices generated for the billing profile. /// [JsonProperty(PropertyName = "properties.poNumber")] public string PoNumber { get; set; } @@ -83,24 +103,26 @@ public BillingProfile() /// /// Gets or sets billing address. /// - [JsonProperty(PropertyName = "properties.address")] - public AddressDetails Address { get; set; } + [JsonProperty(PropertyName = "properties.billTo")] + public AddressDetails BillTo { get; set; } /// - /// Gets or sets if the billing profile is opted in to receive invoices - /// via email. + /// Gets or sets flag controlling whether the invoices for the billing + /// profile are sent through email. /// [JsonProperty(PropertyName = "properties.invoiceEmailOptIn")] public bool? InvoiceEmailOptIn { get; set; } /// - /// Gets invoice day. + /// Gets the day of the month when the invoice for the billing profile + /// is generated. /// [JsonProperty(PropertyName = "properties.invoiceDay")] public int? InvoiceDay { get; private set; } /// - /// Gets the currency associated with the billing profile. + /// Gets the currency in which the charges for the billing profile are + /// billed. /// [JsonProperty(PropertyName = "properties.currency")] public string Currency { get; private set; } @@ -113,10 +135,58 @@ public BillingProfile() /// /// Gets or sets the invoice sections associated to the billing - /// profile. + /// profile. By default this is not populated, unless it's specified in + /// $expand. /// [JsonProperty(PropertyName = "properties.invoiceSections")] - public IList InvoiceSections { get; set; } + public InvoiceSectionsOnExpand InvoiceSections { get; set; } + /// + /// Gets indicates whether user has read access to the billing profile. + /// + [JsonProperty(PropertyName = "properties.hasReadAccess")] + public bool? HasReadAccess { get; private set; } + + /// + /// Gets the system generated unique identifier for a billing profile. + /// + [JsonProperty(PropertyName = "properties.systemId")] + public string SystemId { get; private set; } + + /// + /// Gets the status of the billing profile. Possible values include: + /// 'Active', 'Disabled', 'Warned' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + /// + /// Gets reason for the specified billing profile status. Possible + /// values include: 'PastDue', 'SpendingLimitReached', + /// 'SpendingLimitExpired' + /// + [JsonProperty(PropertyName = "properties.statusReasonCode")] + public string StatusReasonCode { get; private set; } + + /// + /// Gets the billing profile spending limit. Possible values include: + /// 'Off', 'On' + /// + [JsonProperty(PropertyName = "properties.spendingLimit")] + public string SpendingLimit { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (BillTo != null) + { + BillTo.Validate(); + } + } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs index 3286aade23363..c3fb140c6d404 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs @@ -33,18 +33,20 @@ public BillingProfileCreationRequest() /// Initializes a new instance of the BillingProfileCreationRequest /// class. /// - /// The billing profile name. - /// Purchase order number. - /// Billing address. - /// If the billing profile is opted in - /// to receive invoices via email. - /// Enabled azure plans for this - /// billing profile. - public BillingProfileCreationRequest(string displayName = default(string), string poNumber = default(string), AddressDetails address = default(AddressDetails), bool? invoiceEmailOptIn = default(bool?), IList enabledAzurePlans = default(IList)) + /// The name of the billing profile. + /// The purchase order name that will appear on + /// the invoices generated for the billing profile. + /// The address of the individual or organization + /// that is responsible for the billing profile. + /// Flag controlling whether the + /// invoices for the billing profile are sent through email. + /// Enabled azure plans for the billing + /// profile. + public BillingProfileCreationRequest(string displayName = default(string), string poNumber = default(string), AddressDetails billTo = default(AddressDetails), bool? invoiceEmailOptIn = default(bool?), IList enabledAzurePlans = default(IList)) { DisplayName = displayName; PoNumber = poNumber; - Address = address; + BillTo = billTo; InvoiceEmailOptIn = invoiceEmailOptIn; EnabledAzurePlans = enabledAzurePlans; CustomInit(); @@ -56,35 +58,50 @@ public BillingProfileCreationRequest() partial void CustomInit(); /// - /// Gets or sets the billing profile name. + /// Gets or sets the name of the billing profile. /// [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// - /// Gets or sets purchase order number. + /// Gets or sets the purchase order name that will appear on the + /// invoices generated for the billing profile. /// [JsonProperty(PropertyName = "poNumber")] public string PoNumber { get; set; } /// - /// Gets or sets billing address. + /// Gets or sets the address of the individual or organization that is + /// responsible for the billing profile. /// - [JsonProperty(PropertyName = "address")] - public AddressDetails Address { get; set; } + [JsonProperty(PropertyName = "billTo")] + public AddressDetails BillTo { get; set; } /// - /// Gets or sets if the billing profile is opted in to receive invoices - /// via email. + /// Gets or sets flag controlling whether the invoices for the billing + /// profile are sent through email. /// [JsonProperty(PropertyName = "invoiceEmailOptIn")] public bool? InvoiceEmailOptIn { get; set; } /// - /// Gets or sets enabled azure plans for this billing profile. + /// Gets or sets enabled azure plans for the billing profile. /// [JsonProperty(PropertyName = "enabledAzurePlans")] public IList EnabledAzurePlans { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (BillTo != null) + { + BillTo.Validate(); + } + } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileListResult.cs deleted file mode 100644 index 95ade353a9e5d..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileListResult.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing billing profiles. - /// - public partial class BillingProfileListResult - { - /// - /// Initializes a new instance of the BillingProfileListResult class. - /// - public BillingProfileListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BillingProfileListResult class. - /// - /// The list of billing profiles. - /// The link (url) to the next page of - /// results. - public BillingProfileListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of billing profiles. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethodType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileSpendingLimit.cs similarity index 70% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethodType.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileSpendingLimit.cs index 65c631cddc272..e4902a4b87d7a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethodType.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileSpendingLimit.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Billing.Models { /// - /// Defines values for PaymentMethodType. + /// Defines values for BillingProfileSpendingLimit. /// - public static class PaymentMethodType + public static class BillingProfileSpendingLimit { - public const string Credits = "Credits"; - public const string ChequeWire = "ChequeWire"; + public const string Off = "Off"; + public const string On = "On"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileStatus.cs new file mode 100644 index 0000000000000..673be9a7afecb --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileStatus.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for BillingProfileStatus. + /// + public static class BillingProfileStatus + { + public const string Active = "Active"; + public const string Disabled = "Disabled"; + public const string Warned = "Warned"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileStatusReasonCode.cs similarity index 59% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferStatus.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileStatusReasonCode.cs index 68aa5ac353d51..40a646bebc076 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferStatus.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileStatusReasonCode.cs @@ -12,13 +12,12 @@ namespace Microsoft.Azure.Management.Billing.Models { /// - /// Defines values for ProductTransferStatus. + /// Defines values for BillingProfileStatusReasonCode. /// - public static class ProductTransferStatus + public static class BillingProfileStatusReasonCode { - public const string NotStarted = "NotStarted"; - public const string InProgress = "InProgress"; - public const string Completed = "Completed"; - public const string Failed = "Failed"; + public const string PastDue = "PastDue"; + public const string SpendingLimitReached = "SpendingLimitReached"; + public const string SpendingLimitExpired = "SpendingLimitExpired"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateOrUpdateHeaders.cs similarity index 62% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateOrUpdateHeaders.cs index 253d7ba5b08db..d9b7bfb5e74a0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateOrUpdateHeaders.cs @@ -14,27 +14,28 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Defines headers for Transfer operation. + /// Defines headers for CreateOrUpdate operation. /// - public partial class BillingSubscriptionsTransferHeaders + public partial class BillingProfilesCreateOrUpdateHeaders { /// /// Initializes a new instance of the - /// BillingSubscriptionsTransferHeaders class. + /// BillingProfilesCreateOrUpdateHeaders class. /// - public BillingSubscriptionsTransferHeaders() + public BillingProfilesCreateOrUpdateHeaders() { CustomInit(); } /// /// Initializes a new instance of the - /// BillingSubscriptionsTransferHeaders class. + /// BillingProfilesCreateOrUpdateHeaders class. /// - /// Location URI to poll for result. - /// Recommends the retryable time after - /// receiving this. - public BillingSubscriptionsTransferHeaders(string location = default(string), int? retryAfter = default(int?)) + /// Location URI to poll for result + /// Recommended time to wait before making + /// another request to check the status of the operation. The time is + /// specified in seconds. + public BillingProfilesCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; @@ -47,13 +48,15 @@ public BillingSubscriptionsTransferHeaders() partial void CustomInit(); /// - /// Gets or sets location URI to poll for result. + /// Gets or sets location URI to poll for result /// [JsonProperty(PropertyName = "Location")] public string Location { get; set; } /// - /// Gets or sets recommends the retryable time after receiving this. + /// Gets or sets recommended time to wait before making another request + /// to check the status of the operation. The time is specified in + /// seconds. /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesOnExpand.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesOnExpand.cs new file mode 100644 index 0000000000000..76c7d5e487156 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesOnExpand.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The billing profiles associated with the billing account. By default + /// this is not populated, unless it's specified in $expand. + /// + public partial class BillingProfilesOnExpand + { + /// + /// Initializes a new instance of the BillingProfilesOnExpand class. + /// + public BillingProfilesOnExpand() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BillingProfilesOnExpand class. + /// + /// Indicates whether there are more + /// billing profiles than the ones listed in this collection. The + /// collection lists a maximum of 50 billing profiles. To get all + /// billing profiles, use the list billing profiles API. + /// The billing profiles associated with the + /// billing account. + public BillingProfilesOnExpand(bool? hasMoreResults = default(bool?), IList value = default(IList)) + { + HasMoreResults = hasMoreResults; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets indicates whether there are more billing profiles than the + /// ones listed in this collection. The collection lists a maximum of + /// 50 billing profiles. To get all billing profiles, use the list + /// billing profiles API. + /// + [JsonProperty(PropertyName = "hasMoreResults")] + public bool? HasMoreResults { get; private set; } + + /// + /// Gets or sets the billing profiles associated with the billing + /// account. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs index 088d082429163..1c0f99b421821 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A billing property resource. + /// A billing property. /// [Rest.Serialization.JsonTransformation] public partial class BillingProperty : Resource @@ -35,32 +35,58 @@ public BillingProperty() /// Resource Id. /// Resource name. /// Resource type. - /// Billing tenant Id. - /// Billing account Id. - /// Billing account display - /// name. - /// Billing profile Id. - /// Billing profile display - /// name. - /// Cost center name. - /// Invoice Section Id. - /// Invoice Section display - /// name. - /// Product Id. - /// Product name. - /// SKU Id. - /// SKU description. - public BillingProperty(string id = default(string), string name = default(string), string type = default(string), string billingTenantId = default(string), string billingAccountId = default(string), string billingAccountDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string costCenter = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string productId = default(string), string productName = default(string), string skuId = default(string), string skuDescription = default(string)) + /// The email + /// address on which the account admin gets all Azure + /// notifications. + /// The Azure AD tenant ID of the billing + /// account for the subscription. + /// The ID of the billing account to + /// which the subscription is billed. + /// The name of the billing + /// account to which the subscription is billed. + /// The ID of the billing profile to + /// which the subscription is billed. + /// The name of the billing + /// profile to which the subscription is billed. + /// The status of the billing + /// profile. Possible values include: 'Active', 'Disabled', + /// 'Warned' + /// Reason for the + /// specified billing profile status. Possible values include: + /// 'PastDue', 'SpendingLimitReached', 'SpendingLimitExpired' + /// The billing profile + /// spending limit. Possible values include: 'Off', 'On' + /// The cost center applied to the + /// subscription. + /// The ID of the invoice section to + /// which the subscription is billed. + /// The name of the invoice + /// section to which the subscription is billed. + /// Indicates whether user is the account + /// admin. + /// The product ID of the Azure plan. + /// The product name of the Azure + /// plan. + /// The sku ID of the Azure plan for the + /// subscription. + /// The sku description of the Azure plan + /// for the subscription. + public BillingProperty(string id = default(string), string name = default(string), string type = default(string), string accountAdminNotificationEmailAddress = default(string), string billingTenantId = default(string), string billingAccountId = default(string), string billingAccountDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string billingProfileStatus = default(string), string billingProfileStatusReasonCode = default(string), string billingProfileSpendingLimit = default(string), string costCenter = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), bool? isAccountAdmin = default(bool?), string productId = default(string), string productName = default(string), string skuId = default(string), string skuDescription = default(string)) : base(id, name, type) { + AccountAdminNotificationEmailAddress = accountAdminNotificationEmailAddress; BillingTenantId = billingTenantId; BillingAccountId = billingAccountId; BillingAccountDisplayName = billingAccountDisplayName; BillingProfileId = billingProfileId; BillingProfileDisplayName = billingProfileDisplayName; + BillingProfileStatus = billingProfileStatus; + BillingProfileStatusReasonCode = billingProfileStatusReasonCode; + BillingProfileSpendingLimit = billingProfileSpendingLimit; CostCenter = costCenter; InvoiceSectionId = invoiceSectionId; InvoiceSectionDisplayName = invoiceSectionDisplayName; + IsAccountAdmin = isAccountAdmin; ProductId = productId; ProductName = productName; SkuId = skuId; @@ -74,73 +100,115 @@ public BillingProperty() partial void CustomInit(); /// - /// Gets billing tenant Id. + /// Gets the email address on which the account admin gets all Azure + /// notifications. + /// + [JsonProperty(PropertyName = "properties.accountAdminNotificationEmailAddress")] + public string AccountAdminNotificationEmailAddress { get; private set; } + + /// + /// Gets the Azure AD tenant ID of the billing account for the + /// subscription. /// [JsonProperty(PropertyName = "properties.billingTenantId")] public string BillingTenantId { get; private set; } /// - /// Gets billing account Id. + /// Gets the ID of the billing account to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.billingAccountId")] public string BillingAccountId { get; private set; } /// - /// Gets billing account display name. + /// Gets the name of the billing account to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.billingAccountDisplayName")] public string BillingAccountDisplayName { get; private set; } /// - /// Gets billing profile Id. + /// Gets the ID of the billing profile to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.billingProfileId")] public string BillingProfileId { get; private set; } /// - /// Gets billing profile display name. + /// Gets the name of the billing profile to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] public string BillingProfileDisplayName { get; private set; } /// - /// Gets cost center name. + /// Gets the status of the billing profile. Possible values include: + /// 'Active', 'Disabled', 'Warned' + /// + [JsonProperty(PropertyName = "properties.billingProfileStatus")] + public string BillingProfileStatus { get; private set; } + + /// + /// Gets reason for the specified billing profile status. Possible + /// values include: 'PastDue', 'SpendingLimitReached', + /// 'SpendingLimitExpired' + /// + [JsonProperty(PropertyName = "properties.billingProfileStatusReasonCode")] + public string BillingProfileStatusReasonCode { get; private set; } + + /// + /// Gets the billing profile spending limit. Possible values include: + /// 'Off', 'On' + /// + [JsonProperty(PropertyName = "properties.billingProfileSpendingLimit")] + public string BillingProfileSpendingLimit { get; private set; } + + /// + /// Gets or sets the cost center applied to the subscription. /// [JsonProperty(PropertyName = "properties.costCenter")] - public string CostCenter { get; private set; } + public string CostCenter { get; set; } /// - /// Gets invoice Section Id. + /// Gets the ID of the invoice section to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.invoiceSectionId")] public string InvoiceSectionId { get; private set; } /// - /// Gets invoice Section display name. + /// Gets the name of the invoice section to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] public string InvoiceSectionDisplayName { get; private set; } /// - /// Gets product Id. + /// Gets indicates whether user is the account admin. + /// + [JsonProperty(PropertyName = "properties.isAccountAdmin")] + public bool? IsAccountAdmin { get; private set; } + + /// + /// Gets the product ID of the Azure plan. /// [JsonProperty(PropertyName = "properties.productId")] public string ProductId { get; private set; } /// - /// Gets product name. + /// Gets the product name of the Azure plan. /// [JsonProperty(PropertyName = "properties.productName")] public string ProductName { get; private set; } /// - /// Gets SKU Id. + /// Gets the sku ID of the Azure plan for the subscription. /// [JsonProperty(PropertyName = "properties.skuId")] public string SkuId { get; private set; } /// - /// Gets SKU description. + /// Gets the sku description of the Azure plan for the subscription. /// [JsonProperty(PropertyName = "properties.skuDescription")] public string SkuDescription { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignment.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignment.cs index ba6ea2556e281..fa0945df65406 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignment.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignment.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// a role assignment + /// The role assignment /// [Rest.Serialization.JsonTransformation] public partial class BillingRoleAssignment : Resource @@ -35,28 +35,39 @@ public BillingRoleAssignment() /// Resource Id. /// Resource name. /// Resource type. - /// the date the role assignment is - /// created - /// the creator's tenant - /// Id - /// the creator's principal - /// Id - /// the name of the role - /// assignment - /// The user's principal id that the role - /// gets assigned to - /// The role definition id - /// The scope the role get assigned to - public BillingRoleAssignment(string id = default(string), string name = default(string), string type = default(string), string createdOn = default(string), string createdByPrincipalTenantId = default(string), string createdByPrincipalId = default(string), string billingRoleAssignmentName = default(string), string principalId = default(string), string roleDefinitionName = default(string), string scope = default(string)) + /// The date the role assignment was + /// created. + /// The tenant Id of the user + /// who created the role assignment. + /// The principal Id of the user who + /// created the role assignment. + /// The email address of the + /// user who created the role assignment. + /// The principal id of the user to whom the + /// role was assigned. + /// The principal tenant id of the user + /// to whom the role was assigned. + /// The ID of the role + /// definition. + /// The scope at which the role was + /// assigned. + /// The authentication + /// type. + /// The email address of the + /// user. + public BillingRoleAssignment(string id = default(string), string name = default(string), string type = default(string), string createdOn = default(string), string createdByPrincipalTenantId = default(string), string createdByPrincipalId = default(string), string createdByUserEmailAddress = default(string), string principalId = default(string), string principalTenantId = default(string), string roleDefinitionId = default(string), string scope = default(string), string userAuthenticationType = default(string), string userEmailAddress = default(string)) : base(id, name, type) { CreatedOn = createdOn; CreatedByPrincipalTenantId = createdByPrincipalTenantId; CreatedByPrincipalId = createdByPrincipalId; - BillingRoleAssignmentName = billingRoleAssignmentName; + CreatedByUserEmailAddress = createdByUserEmailAddress; PrincipalId = principalId; - RoleDefinitionName = roleDefinitionName; + PrincipalTenantId = principalTenantId; + RoleDefinitionId = roleDefinitionId; Scope = scope; + UserAuthenticationType = userAuthenticationType; + UserEmailAddress = userEmailAddress; CustomInit(); } @@ -66,46 +77,65 @@ public BillingRoleAssignment() partial void CustomInit(); /// - /// Gets the date the role assignment is created + /// Gets the date the role assignment was created. /// [JsonProperty(PropertyName = "properties.createdOn")] public string CreatedOn { get; private set; } /// - /// Gets the creator's tenant Id + /// Gets the tenant Id of the user who created the role assignment. /// [JsonProperty(PropertyName = "properties.createdByPrincipalTenantId")] public string CreatedByPrincipalTenantId { get; private set; } /// - /// Gets the creator's principal Id + /// Gets the principal Id of the user who created the role assignment. /// [JsonProperty(PropertyName = "properties.createdByPrincipalId")] public string CreatedByPrincipalId { get; private set; } /// - /// Gets the name of the role assignment + /// Gets the email address of the user who created the role assignment. /// - [JsonProperty(PropertyName = "properties.name")] - public string BillingRoleAssignmentName { get; private set; } + [JsonProperty(PropertyName = "properties.createdByUserEmailAddress")] + public string CreatedByUserEmailAddress { get; private set; } /// - /// Gets the user's principal id that the role gets assigned to + /// Gets the principal id of the user to whom the role was assigned. /// [JsonProperty(PropertyName = "properties.principalId")] public string PrincipalId { get; private set; } /// - /// Gets the role definition id + /// Gets the principal tenant id of the user to whom the role was + /// assigned. /// - [JsonProperty(PropertyName = "properties.roleDefinitionName")] - public string RoleDefinitionName { get; private set; } + [JsonProperty(PropertyName = "properties.principalTenantId")] + public string PrincipalTenantId { get; private set; } /// - /// Gets the scope the role get assigned to + /// Gets the ID of the role definition. + /// + [JsonProperty(PropertyName = "properties.roleDefinitionId")] + public string RoleDefinitionId { get; private set; } + + /// + /// Gets the scope at which the role was assigned. /// [JsonProperty(PropertyName = "properties.scope")] public string Scope { get; private set; } + /// + /// Gets the authentication type. + /// + [JsonProperty(PropertyName = "properties.userAuthenticationType")] + public string UserAuthenticationType { get; private set; } + + /// + /// Gets the email address of the user. + /// + [JsonProperty(PropertyName = "properties.userEmailAddress")] + public string UserEmailAddress { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentListResult.cs deleted file mode 100644 index ed3d64dc487c1..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentListResult.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of get list of role assignments - /// - public partial class BillingRoleAssignmentListResult - { - /// - /// Initializes a new instance of the BillingRoleAssignmentListResult - /// class. - /// - public BillingRoleAssignmentListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BillingRoleAssignmentListResult - /// class. - /// - /// The list role assignments - public BillingRoleAssignmentListResult(IList value = default(IList)) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list role assignments - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs deleted file mode 100644 index 74d64a4af330a..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The payload use to update role assignment on a scope - /// - public partial class BillingRoleAssignmentPayload - { - /// - /// Initializes a new instance of the BillingRoleAssignmentPayload - /// class. - /// - public BillingRoleAssignmentPayload() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BillingRoleAssignmentPayload - /// class. - /// - /// The user's principal id that the role - /// gets assigned to - /// The role definition - /// id - public BillingRoleAssignmentPayload(string principalId = default(string), string billingRoleDefinitionId = default(string)) - { - PrincipalId = principalId; - BillingRoleDefinitionId = billingRoleDefinitionId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the user's principal id that the role gets assigned to - /// - [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; set; } - - /// - /// Gets or sets the role definition id - /// - [JsonProperty(PropertyName = "billingRoleDefinitionId")] - public string BillingRoleDefinitionId { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinition.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinition.cs index f1264bd4af446..53748e93e72ad 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinition.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinition.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Result of get role definition for a role. + /// The properties of a role definition. /// [Rest.Serialization.JsonTransformation] public partial class BillingRoleDefinition : Resource diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinitionListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinitionListResult.cs deleted file mode 100644 index e2cc802f86d14..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleDefinitionListResult.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// list the role definitions. - /// - public partial class BillingRoleDefinitionListResult - { - /// - /// Initializes a new instance of the BillingRoleDefinitionListResult - /// class. - /// - public BillingRoleDefinitionListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BillingRoleDefinitionListResult - /// class. - /// - /// The list of role definitions. - public BillingRoleDefinitionListResult(IList value = default(IList)) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of role definitions. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs index 0d8e1dc1a2cc6..e6b5472658b7c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A billing Subscription resource. + /// A billing subscription. /// [Rest.Serialization.JsonTransformation] public partial class BillingSubscription : Resource @@ -35,29 +35,36 @@ public BillingSubscription() /// Resource Id. /// Resource name. /// Resource type. - /// display name. - /// Subscription Id. - /// Subscription billing - /// status. Possible values include: 'Active', 'Inactive', 'Abandoned', - /// 'Deleted', 'Warning' - /// Last month charges. - /// Month to date charges. - /// Billing Profile id to which this - /// product belongs. - /// Billing Profile display - /// name to which this product belongs. - /// Customer id to which this product - /// belongs. - /// Display name of customer to which - /// this product belongs. - /// Invoice section id to which this - /// product belongs. - /// Invoice section display - /// name to which this product belongs. + /// The name of the subscription. + /// The ID of the subscription. + /// The current billing status + /// of the subscription. Possible values include: 'Active', 'Inactive', + /// 'Abandoned', 'Deleted', 'Warning' + /// The last month charges. + /// The current month to date + /// charges. + /// The ID of the billing profile to + /// which the subscription is billed. + /// The name of the billing + /// profile to which the subscription is billed. + /// The cost center applied to the + /// subscription. + /// The ID of the customer for whom the + /// subscription was created. The field is applicable only for + /// Microsoft Partner Agreement billing account. + /// The name of the customer for whom + /// the subscription was created. The field is applicable only for + /// Microsoft Partner Agreement billing account. + /// The ID of the invoice section to + /// which the subscription is billed. + /// The name of the invoice + /// section to which the subscription is billed. /// Reseller for this subscription. - /// The sku id. - /// The sku description. - public BillingSubscription(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), System.Guid? subscriptionId = default(System.Guid?), string subscriptionBillingStatus = default(string), Amount lastMonthCharges = default(Amount), Amount monthToDateCharges = default(Amount), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string customerId = default(string), string customerDisplayName = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), Reseller reseller = default(Reseller), string skuId = default(string), string skuDescription = default(string)) + /// The sku ID of the Azure plan for the + /// subscription. + /// The sku description of the Azure plan + /// for the subscription. + public BillingSubscription(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), System.Guid? subscriptionId = default(System.Guid?), string subscriptionBillingStatus = default(string), Amount lastMonthCharges = default(Amount), Amount monthToDateCharges = default(Amount), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string costCenter = default(string), string customerId = default(string), string customerDisplayName = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), Reseller reseller = default(Reseller), string skuId = default(string), string skuDescription = default(string)) : base(id, name, type) { DisplayName = displayName; @@ -67,6 +74,7 @@ public BillingSubscription() MonthToDateCharges = monthToDateCharges; BillingProfileId = billingProfileId; BillingProfileDisplayName = billingProfileDisplayName; + CostCenter = costCenter; CustomerId = customerId; CustomerDisplayName = customerDisplayName; InvoiceSectionId = invoiceSectionId; @@ -83,68 +91,83 @@ public BillingSubscription() partial void CustomInit(); /// - /// Gets display name. + /// Gets the name of the subscription. /// [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; private set; } /// - /// Gets subscription Id. + /// Gets the ID of the subscription. /// [JsonProperty(PropertyName = "properties.subscriptionId")] public System.Guid? SubscriptionId { get; private set; } /// - /// Gets or sets subscription billing status. Possible values include: - /// 'Active', 'Inactive', 'Abandoned', 'Deleted', 'Warning' + /// Gets or sets the current billing status of the subscription. + /// Possible values include: 'Active', 'Inactive', 'Abandoned', + /// 'Deleted', 'Warning' /// [JsonProperty(PropertyName = "properties.subscriptionBillingStatus")] public string SubscriptionBillingStatus { get; set; } /// - /// Gets last month charges. + /// Gets the last month charges. /// [JsonProperty(PropertyName = "properties.lastMonthCharges")] public Amount LastMonthCharges { get; private set; } /// - /// Gets month to date charges. + /// Gets the current month to date charges. /// [JsonProperty(PropertyName = "properties.monthToDateCharges")] public Amount MonthToDateCharges { get; private set; } /// - /// Gets billing Profile id to which this product belongs. + /// Gets the ID of the billing profile to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.billingProfileId")] public string BillingProfileId { get; private set; } /// - /// Gets billing Profile display name to which this product belongs. + /// Gets the name of the billing profile to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] public string BillingProfileDisplayName { get; private set; } /// - /// Gets customer id to which this product belongs. + /// Gets or sets the cost center applied to the subscription. + /// + [JsonProperty(PropertyName = "properties.costCenter")] + public string CostCenter { get; set; } + + /// + /// Gets the ID of the customer for whom the subscription was created. + /// The field is applicable only for Microsoft Partner Agreement + /// billing account. /// [JsonProperty(PropertyName = "properties.customerId")] public string CustomerId { get; private set; } /// - /// Gets display name of customer to which this product belongs. + /// Gets the name of the customer for whom the subscription was + /// created. The field is applicable only for Microsoft Partner + /// Agreement billing account. /// [JsonProperty(PropertyName = "properties.customerDisplayName")] public string CustomerDisplayName { get; private set; } /// - /// Gets invoice section id to which this product belongs. + /// Gets the ID of the invoice section to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.invoiceSectionId")] public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section display name to which this product belongs. + /// Gets the name of the invoice section to which the subscription is + /// billed. /// [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] public string InvoiceSectionDisplayName { get; private set; } @@ -156,13 +179,13 @@ public BillingSubscription() public Reseller Reseller { get; private set; } /// - /// Gets or sets the sku id. + /// Gets or sets the sku ID of the Azure plan for the subscription. /// [JsonProperty(PropertyName = "properties.skuId")] public string SkuId { get; set; } /// - /// Gets the sku description. + /// Gets the sku description of the Azure plan for the subscription. /// [JsonProperty(PropertyName = "properties.skuDescription")] public string SkuDescription { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs deleted file mode 100644 index 65f02e801fef7..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing billing subscriptions. - /// - public partial class BillingSubscriptionsListResult - { - /// - /// Initializes a new instance of the BillingSubscriptionsListResult - /// class. - /// - public BillingSubscriptionsListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BillingSubscriptionsListResult - /// class. - /// - /// The list of billing subscriptions. - /// The link (url) to the next page of - /// results. - public BillingSubscriptionsListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of billing subscriptions. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsMoveHeaders.cs similarity index 61% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsMoveHeaders.cs index 11328f1778e59..39f89953b85dc 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsMoveHeaders.cs @@ -14,25 +14,28 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Defines headers for Update operation. + /// Defines headers for Move operation. /// - public partial class LineOfCreditsUpdateHeaders + public partial class BillingSubscriptionsMoveHeaders { /// - /// Initializes a new instance of the LineOfCreditsUpdateHeaders class. + /// Initializes a new instance of the BillingSubscriptionsMoveHeaders + /// class. /// - public LineOfCreditsUpdateHeaders() + public BillingSubscriptionsMoveHeaders() { CustomInit(); } /// - /// Initializes a new instance of the LineOfCreditsUpdateHeaders class. + /// Initializes a new instance of the BillingSubscriptionsMoveHeaders + /// class. /// /// Location URI to poll for result. - /// Recommends the retryable time after - /// receiving this. - public LineOfCreditsUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + /// Recommended time to wait before making + /// another request to check the status of the operation. The time is + /// specified in seconds. + public BillingSubscriptionsMoveHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; @@ -51,7 +54,9 @@ public LineOfCreditsUpdateHeaders() public string Location { get; set; } /// - /// Gets or sets recommends the retryable time after receiving this. + /// Gets or sets recommended time to wait before making another request + /// to check the status of the operation. The time is specified in + /// seconds. /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Category.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Category.cs new file mode 100644 index 0000000000000..210b36aeaec93 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Category.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for Category. + /// + public static class Category + { + public const string MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement"; + public const string AffiliatePurchaseTerms = "AffiliatePurchaseTerms"; + public const string Other = "Other"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs index 89c7ab63b4cfe..bf625a111fd01 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs @@ -37,14 +37,20 @@ public Customer() /// Resource Id. /// Resource name. /// Resource type. + /// The ID of the billing profile for + /// the invoice section. + /// The name of the billing + /// profile for the invoice section. /// The name of the customer. - /// Information about the - /// product. - /// The resellers which are allowed to provide - /// service to this customer. - public Customer(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IList enabledAzurePlans = default(IList), IList resellers = default(IList)) + /// Azure plans enabled for the + /// customer. + /// The list of resellers for which an Azure + /// plan is enabled for the customer. + public Customer(string id = default(string), string name = default(string), string type = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string displayName = default(string), IList enabledAzurePlans = default(IList), IList resellers = default(IList)) : base(id, name, type) { + BillingProfileId = billingProfileId; + BillingProfileDisplayName = billingProfileDisplayName; DisplayName = displayName; EnabledAzurePlans = enabledAzurePlans; Resellers = resellers; @@ -56,6 +62,18 @@ public Customer() /// partial void CustomInit(); + /// + /// Gets the ID of the billing profile for the invoice section. + /// + [JsonProperty(PropertyName = "properties.billingProfileId")] + public string BillingProfileId { get; private set; } + + /// + /// Gets the name of the billing profile for the invoice section. + /// + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } + /// /// Gets or sets the name of the customer. /// @@ -63,14 +81,14 @@ public Customer() public string DisplayName { get; set; } /// - /// Gets or sets information about the product. + /// Gets or sets azure plans enabled for the customer. /// [JsonProperty(PropertyName = "properties.enabledAzurePlans")] public IList EnabledAzurePlans { get; set; } /// - /// Gets or sets the resellers which are allowed to provide service to - /// this customer. + /// Gets or sets the list of resellers for which an Azure plan is + /// enabled for the customer. /// [JsonProperty(PropertyName = "properties.resellers")] public IList Resellers { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerPolicy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerPolicy.cs index 2102f397542af..312bd9f3d5c8c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerPolicy.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerPolicy.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// The Customer's Policy. + /// The customer's Policy. /// [Rest.Serialization.JsonTransformation] public partial class CustomerPolicy : Resource @@ -35,8 +35,9 @@ public CustomerPolicy() /// Resource Id. /// Resource name. /// Resource type. - /// Customer can view retail prices. Possible - /// values include: 'Allowed', 'NotAllowed' + /// The policy that controls whether the + /// users in customer's organization can view charges at pay-as-you-go + /// prices. Possible values include: 'Allowed', 'NotAllowed' public CustomerPolicy(string id = default(string), string name = default(string), string type = default(string), string viewCharges = default(string)) : base(id, name, type) { @@ -50,8 +51,9 @@ public CustomerPolicy() partial void CustomInit(); /// - /// Gets or sets customer can view retail prices. Possible values - /// include: 'Allowed', 'NotAllowed' + /// Gets or sets the policy that controls whether the users in + /// customer's organization can view charges at pay-as-you-go prices. + /// Possible values include: 'Allowed', 'NotAllowed' /// [JsonProperty(PropertyName = "properties.viewCharges")] public string ViewCharges { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Department.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Department.cs index 84bf3ae4e6ab4..6b63c084490ca 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Department.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Department.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A department resource. + /// A department. /// [Rest.Serialization.JsonTransformation] public partial class Department : Resource @@ -37,9 +37,10 @@ public Department() /// Resource Id. /// Resource name. /// Resource type. - /// The name for department. - /// The cost center name. - /// The status for department. + /// The name of the department. + /// The cost center associated with the + /// department. + /// The status of the department. /// Associated enrollment accounts. By /// default this is not populated, unless it's specified in /// $expand. @@ -59,19 +60,19 @@ public Department() partial void CustomInit(); /// - /// Gets or sets the name for department. + /// Gets or sets the name of the department. /// [JsonProperty(PropertyName = "properties.departmentName")] public string DepartmentName { get; set; } /// - /// Gets or sets the cost center name. + /// Gets or sets the cost center associated with the department. /// [JsonProperty(PropertyName = "properties.costCenter")] public string CostCenter { get; set; } /// - /// Gets or sets the status for department. + /// Gets or sets the status of the department. /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DepartmentListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DepartmentListResult.cs deleted file mode 100644 index c9395d6f73c09..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DepartmentListResult.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing departments. - /// - public partial class DepartmentListResult - { - /// - /// Initializes a new instance of the DepartmentListResult class. - /// - public DepartmentListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DepartmentListResult class. - /// - /// The list of departments. - /// The link (url) to the next page of - /// results. - public DepartmentListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of departments. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DetailedTransferStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DetailedTransferStatus.cs deleted file mode 100644 index 05c4b113ab35f..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DetailedTransferStatus.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Detailed transfer status. - /// - public partial class DetailedTransferStatus - { - /// - /// Initializes a new instance of the DetailedTransferStatus class. - /// - public DetailedTransferStatus() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DetailedTransferStatus class. - /// - /// Type of product being transferred. - /// Possible values include: 'AzureSubscription', - /// 'AzureReservation' - /// Id of product being transferred. - /// Transfer status. Possible values - /// include: 'NotStarted', 'InProgress', 'Completed', 'Failed' - /// Error details for transfer - /// execution. - public DetailedTransferStatus(string productType = default(string), string productId = default(string), string transferStatus = default(string), Error errorDetails = default(Error)) - { - ProductType = productType; - ProductId = productId; - TransferStatus = transferStatus; - ErrorDetails = errorDetails; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets type of product being transferred. Possible values include: - /// 'AzureSubscription', 'AzureReservation' - /// - [JsonProperty(PropertyName = "productType")] - public string ProductType { get; private set; } - - /// - /// Gets id of product being transferred. - /// - [JsonProperty(PropertyName = "productId")] - public string ProductId { get; private set; } - - /// - /// Gets transfer status. Possible values include: 'NotStarted', - /// 'InProgress', 'Completed', 'Failed' - /// - [JsonProperty(PropertyName = "transferStatus")] - public string TransferStatus { get; private set; } - - /// - /// Gets or sets error details for transfer execution. - /// - [JsonProperty(PropertyName = "errorDetails")] - public Error ErrorDetails { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs index 36f973b7dd431..974ab59c7b27c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// The properties of the invoice download. + /// The properties of a document. /// public partial class Document { @@ -29,13 +29,17 @@ public Document() /// /// Initializes a new instance of the Document class. /// - /// Document type. Possible values include: - /// 'Invoice', 'VoidNote', 'Receipt', 'CreditNote' + /// The type of the document. Possible values + /// include: 'Invoice', 'VoidNote', 'TaxReceipt', 'CreditNote' /// Document URL. - public Document(string kind = default(string), string url = default(string)) + /// The source of the document. ENF for Brazil and + /// DRS for rest of the world. Possible values include: 'DRS', + /// 'ENF' + public Document(string kind = default(string), string url = default(string), string source = default(string)) { Kind = kind; Url = url; + Source = source; CustomInit(); } @@ -45,8 +49,8 @@ public Document() partial void CustomInit(); /// - /// Gets document type. Possible values include: 'Invoice', 'VoidNote', - /// 'Receipt', 'CreditNote' + /// Gets the type of the document. Possible values include: 'Invoice', + /// 'VoidNote', 'TaxReceipt', 'CreditNote' /// [JsonProperty(PropertyName = "kind")] public string Kind { get; private set; } @@ -57,5 +61,12 @@ public Document() [JsonProperty(PropertyName = "url")] public string Url { get; private set; } + /// + /// Gets the source of the document. ENF for Brazil and DRS for rest of + /// the world. Possible values include: 'DRS', 'ENF' + /// + [JsonProperty(PropertyName = "source")] + public string Source { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenew.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentSource.cs similarity index 72% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenew.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentSource.cs index df0685604f89a..95c505550f6ee 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenew.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentSource.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Billing.Models { /// - /// Defines values for UpdateAutoRenew. + /// Defines values for DocumentSource. /// - public static class UpdateAutoRenew + public static class DocumentSource { - public const string True = "true"; - public const string False = "false"; + public const string DRS = "DRS"; + public const string ENF = "ENF"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.cs index 6a75ed6700685..1ea4d2a5e778d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.cs @@ -18,7 +18,7 @@ public static class DocumentType { public const string Invoice = "Invoice"; public const string VoidNote = "VoidNote"; - public const string Receipt = "Receipt"; + public const string TaxReceipt = "TaxReceipt"; public const string CreditNote = "CreditNote"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadUrl.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadUrl.cs index c6ff0b1a7ae4e..9fe7195f58433 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadUrl.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadUrl.cs @@ -30,8 +30,8 @@ public DownloadUrl() /// /// Initializes a new instance of the DownloadUrl class. /// - /// The time in UTC at which this download URL - /// will expire. + /// The time in UTC when the download URL will + /// expire. /// The URL to the PDF file. public DownloadUrl(System.DateTime? expiryTime = default(System.DateTime?), string url = default(string)) { @@ -46,7 +46,7 @@ public DownloadUrl() partial void CustomInit(); /// - /// Gets the time in UTC at which this download URL will expire. + /// Gets the time in UTC when the download URL will expire. /// [JsonProperty(PropertyName = "expiryTime")] public System.DateTime? ExpiryTime { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Enrollment.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Enrollment.cs index ebe3c42ea2e6e..2a45edbd0101d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Enrollment.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Enrollment.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Current entity level details + /// The properties of an enrollment. /// public partial class Enrollment { @@ -29,17 +29,19 @@ public Enrollment() /// /// Initializes a new instance of the Enrollment class. /// - /// Enrollment Start Date - /// Enrollment End Date - /// The currency associated with - /// enrollment - /// The channel for Enrollment - /// The attributes associated with legacy + /// The start date of the enrollment. + /// The end date of the enrollment. + /// The billing currency for the + /// enrollment. + /// The channel type of the enrollment. + /// The policies for Enterprise Agreement + /// enrollments. + /// The language for the enrollment. + /// The country code of the + /// enrollment. + /// The current status of the enrollment. + /// The billing cycle for the /// enrollment. - /// The language for Enrollment - /// The countryCode for Enrollment - /// Enrollment status - /// Enrollment billing cycle public Enrollment(System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), string currency = default(string), string channel = default(string), EnrollmentPolicies policies = default(EnrollmentPolicies), string language = default(string), string countryCode = default(string), string status = default(string), string billingCycle = default(string)) { StartDate = startDate; @@ -60,55 +62,55 @@ public Enrollment() partial void CustomInit(); /// - /// Gets or sets enrollment Start Date + /// Gets or sets the start date of the enrollment. /// [JsonProperty(PropertyName = "startDate")] public System.DateTime? StartDate { get; set; } /// - /// Gets or sets enrollment End Date + /// Gets or sets the end date of the enrollment. /// [JsonProperty(PropertyName = "endDate")] public System.DateTime? EndDate { get; set; } /// - /// Gets the currency associated with enrollment + /// Gets the billing currency for the enrollment. /// [JsonProperty(PropertyName = "currency")] public string Currency { get; private set; } /// - /// Gets the channel for Enrollment + /// Gets the channel type of the enrollment. /// [JsonProperty(PropertyName = "channel")] public string Channel { get; private set; } /// - /// Gets the attributes associated with legacy enrollment. + /// Gets the policies for Enterprise Agreement enrollments. /// [JsonProperty(PropertyName = "policies")] public EnrollmentPolicies Policies { get; private set; } /// - /// Gets the language for Enrollment + /// Gets the language for the enrollment. /// [JsonProperty(PropertyName = "language")] public string Language { get; private set; } /// - /// Gets the countryCode for Enrollment + /// Gets the country code of the enrollment. /// [JsonProperty(PropertyName = "countryCode")] public string CountryCode { get; private set; } /// - /// Gets enrollment status + /// Gets the current status of the enrollment. /// [JsonProperty(PropertyName = "status")] public string Status { get; private set; } /// - /// Gets enrollment billing cycle + /// Gets the billing cycle for the enrollment. /// [JsonProperty(PropertyName = "billingCycle")] public string BillingCycle { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccount.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccount.cs index e732dd3876a9c..140c2fb209c52 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccount.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccount.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// An account resource. + /// An enrollment account. /// [Rest.Serialization.JsonTransformation] public partial class EnrollmentAccount : Resource @@ -35,12 +35,17 @@ public EnrollmentAccount() /// Resource Id. /// Resource name. /// Resource type. - /// The account name. - /// The cost center name. - /// The account owner - /// The status for account. - /// Account Start Date - /// Account End Date + /// The name of the enrollment + /// account. + /// The cost center associated with the + /// enrollment account. + /// The owner of the enrollment + /// account. + /// The status of the enrollment account. + /// The start date of the enrollment + /// account. + /// The end date of the enrollment + /// account. /// Associated department. By default this is /// not populated, unless it's specified in $expand. public EnrollmentAccount(string id = default(string), string name = default(string), string type = default(string), string accountName = default(string), string costCenter = default(string), string accountOwner = default(string), string status = default(string), System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), Department department = default(Department)) @@ -62,37 +67,38 @@ public EnrollmentAccount() partial void CustomInit(); /// - /// Gets or sets the account name. + /// Gets or sets the name of the enrollment account. /// [JsonProperty(PropertyName = "properties.accountName")] public string AccountName { get; set; } /// - /// Gets or sets the cost center name. + /// Gets or sets the cost center associated with the enrollment + /// account. /// [JsonProperty(PropertyName = "properties.costCenter")] public string CostCenter { get; set; } /// - /// Gets or sets the account owner + /// Gets or sets the owner of the enrollment account. /// [JsonProperty(PropertyName = "properties.accountOwner")] public string AccountOwner { get; set; } /// - /// Gets or sets the status for account. + /// Gets or sets the status of the enrollment account. /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; set; } /// - /// Gets or sets account Start Date + /// Gets or sets the start date of the enrollment account. /// [JsonProperty(PropertyName = "properties.startDate")] public System.DateTime? StartDate { get; set; } /// - /// Gets or sets account End Date + /// Gets or sets the end date of the enrollment account. /// [JsonProperty(PropertyName = "properties.endDate")] public System.DateTime? EndDate { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccountContext.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccountContext.cs index fc76a58333bc8..650e0b3eb3b0f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccountContext.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccountContext.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// The rating context. + /// The enrollment account context /// public partial class EnrollmentAccountContext { @@ -29,11 +29,14 @@ public EnrollmentAccountContext() /// /// Initializes a new instance of the EnrollmentAccountContext class. /// - /// The cost center name. - /// Account Start Date - /// Account End Date - /// The enrollment account - /// id. + /// The cost center associated with the + /// enrollment account. + /// The start date of the enrollment + /// account. + /// The end date of the enrollment + /// account. + /// The ID of the enrollment + /// account. public EnrollmentAccountContext(string costCenter = default(string), System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), string enrollmentAccountName = default(string)) { CostCenter = costCenter; @@ -49,25 +52,26 @@ public EnrollmentAccountContext() partial void CustomInit(); /// - /// Gets or sets the cost center name. + /// Gets or sets the cost center associated with the enrollment + /// account. /// [JsonProperty(PropertyName = "costCenter")] public string CostCenter { get; set; } /// - /// Gets or sets account Start Date + /// Gets or sets the start date of the enrollment account. /// [JsonProperty(PropertyName = "startDate")] public System.DateTime? StartDate { get; set; } /// - /// Gets or sets account End Date + /// Gets or sets the end date of the enrollment account. /// [JsonProperty(PropertyName = "endDate")] public System.DateTime? EndDate { get; set; } /// - /// Gets or sets the enrollment account id. + /// Gets or sets the ID of the enrollment account. /// [JsonProperty(PropertyName = "enrollmentAccountName")] public string EnrollmentAccountName { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccountListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccountListResult.cs deleted file mode 100644 index 6f15df453de94..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentAccountListResult.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing enrollment accounts. - /// - public partial class EnrollmentAccountListResult - { - /// - /// Initializes a new instance of the EnrollmentAccountListResult - /// class. - /// - public EnrollmentAccountListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EnrollmentAccountListResult - /// class. - /// - /// The list of enrollment accounts. - /// The link (url) to the next page of - /// results. - public EnrollmentAccountListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of enrollment accounts. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentPolicies.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentPolicies.cs index 622d4a2df7e1e..a01dd23728c38 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentPolicies.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnrollmentPolicies.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// The attributes associated with legacy enrollment + /// The policies for Enterprise Agreement enrollments. /// public partial class EnrollmentPolicies { @@ -29,14 +29,15 @@ public EnrollmentPolicies() /// /// Initializes a new instance of the EnrollmentPolicies class. /// - /// The accountOwnerViewCharges - /// flag for Enrollment - /// The - /// departmentAdminViewCharges flag for Enrollment - /// The marketplaces flag for - /// Enrollment - /// The reserved instances flag - /// for Enrollment + /// The policy that controls + /// whether Account Owners can view charges. + /// The policy that controls + /// whether Department Administrators can view charges. + /// The policy that controls whether + /// Azure marketplace purchases are allowed in the enrollment. + /// The policy that controls + /// whether Azure reservation purchases are allowed in the + /// enrollment. public EnrollmentPolicies(bool? accountOwnerViewCharges = default(bool?), bool? departmentAdminViewCharges = default(bool?), bool? marketplacesEnabled = default(bool?), bool? reservedInstancesEnabled = default(bool?)) { AccountOwnerViewCharges = accountOwnerViewCharges; @@ -52,25 +53,29 @@ public EnrollmentPolicies() partial void CustomInit(); /// - /// Gets the accountOwnerViewCharges flag for Enrollment + /// Gets the policy that controls whether Account Owners can view + /// charges. /// [JsonProperty(PropertyName = "accountOwnerViewCharges")] public bool? AccountOwnerViewCharges { get; private set; } /// - /// Gets the departmentAdminViewCharges flag for Enrollment + /// Gets the policy that controls whether Department Administrators can + /// view charges. /// [JsonProperty(PropertyName = "departmentAdminViewCharges")] public bool? DepartmentAdminViewCharges { get; private set; } /// - /// Gets the marketplaces flag for Enrollment + /// Gets the policy that controls whether Azure marketplace purchases + /// are allowed in the enrollment. /// [JsonProperty(PropertyName = "marketplacesEnabled")] public bool? MarketplacesEnabled { get; private set; } /// - /// Gets the reserved instances flag for Enrollment + /// Gets the policy that controls whether Azure reservation purchases + /// are allowed in the enrollment. /// [JsonProperty(PropertyName = "reservedInstancesEnabled")] public bool? ReservedInstancesEnabled { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Error.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Error.cs deleted file mode 100644 index f06f1ac89a18e..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Error.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error details for transfer execution. - /// - public partial class Error - { - /// - /// Initializes a new instance of the Error class. - /// - public Error() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Error class. - /// - /// Error code. - /// Error message. - public Error(string errorCode = default(string), string errorMessage = default(string)) - { - ErrorCode = errorCode; - ErrorMessage = errorMessage; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets error code. - /// - [JsonProperty(PropertyName = "errorCode")] - public string ErrorCode { get; private set; } - - /// - /// Gets error message. - /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs deleted file mode 100644 index 00b981362f05b..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Request parameters to initiate transfer. - /// - [Rest.Serialization.JsonTransformation] - public partial class InitiateTransferRequest - { - /// - /// Initializes a new instance of the InitiateTransferRequest class. - /// - public InitiateTransferRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InitiateTransferRequest class. - /// - /// Email Id of recipient for - /// transfer. - /// Optional reseller Id for transfer. - public InitiateTransferRequest(string recipientEmailId = default(string), string resellerId = default(string)) - { - RecipientEmailId = recipientEmailId; - ResellerId = resellerId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets email Id of recipient for transfer. - /// - [JsonProperty(PropertyName = "properties.recipientEmailId")] - public string RecipientEmailId { get; set; } - - /// - /// Gets or sets optional reseller Id for transfer. - /// - [JsonProperty(PropertyName = "properties.resellerId")] - public string ResellerId { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Instruction.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Instruction.cs new file mode 100644 index 0000000000000..5fd2787f50e4e --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Instruction.cs @@ -0,0 +1,97 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An instruction. + /// + [Rest.Serialization.JsonTransformation] + public partial class Instruction : Resource + { + /// + /// Initializes a new instance of the Instruction class. + /// + public Instruction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Instruction class. + /// + /// The amount budgeted for this billing + /// instruction. + /// The date this billing instruction goes into + /// effect. + /// The date this billing instruction is no + /// longer in effect. + /// Resource Id. + /// Resource name. + /// Resource type. + /// The date this billing instruction was + /// created. + public Instruction(double amount, System.DateTime startDate, System.DateTime endDate, string id = default(string), string name = default(string), string type = default(string), System.DateTime? creationDate = default(System.DateTime?)) + : base(id, name, type) + { + Amount = amount; + StartDate = startDate; + EndDate = endDate; + CreationDate = creationDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the amount budgeted for this billing instruction. + /// + [JsonProperty(PropertyName = "properties.amount")] + public double Amount { get; set; } + + /// + /// Gets or sets the date this billing instruction goes into effect. + /// + [JsonProperty(PropertyName = "properties.startDate")] + public System.DateTime StartDate { get; set; } + + /// + /// Gets or sets the date this billing instruction is no longer in + /// effect. + /// + [JsonProperty(PropertyName = "properties.endDate")] + public System.DateTime EndDate { get; set; } + + /// + /// Gets or sets the date this billing instruction was created. + /// + [JsonProperty(PropertyName = "properties.creationDate")] + public System.DateTime? CreationDate { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs index 6bb05a36f3c3e..6d360f88ac10c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// An invoice resource. + /// An invoice. /// [Rest.Serialization.JsonTransformation] public partial class Invoice : Resource @@ -37,43 +37,78 @@ public Invoice() /// Resource Id. /// Resource name. /// Resource type. - /// The due date for invoice. - /// The date when invoice was - /// created. - /// Invoice status. Possible values include: - /// 'PastDue', 'Due', 'Paid', 'Void' - /// Amount due. - /// Amount billed. + /// The due date for the invoice. + /// The date when the invoice was + /// generated. + /// The current status of the invoice. Possible + /// values include: 'Due', 'OverDue', 'Paid' + /// The amount due as of now. + /// The amount of Azure prepayment + /// applied to the charges. This field is applicable to billing + /// accounts with agreement type Microsoft Customer Agreement. + /// The total charges for the invoice + /// billing period. + /// The total refund for returns and + /// cancellations during the invoice billing period. This field is + /// applicable to billing accounts with agreement type Microsoft + /// Customer Agreement. + /// The amount of free Azure + /// credits applied to the charges. This field is applicable to billing + /// accounts with agreement type Microsoft Customer Agreement. + /// The pre-tax amount due. This field is + /// applicable to billing accounts with agreement type Microsoft + /// Customer Agreement. + /// The amount of tax charged for the billing + /// period. This field is applicable to billing accounts with agreement + /// type Microsoft Customer Agreement. + /// The amount due when the invoice was + /// generated. This field is applicable to billing accounts with + /// agreement type Microsoft Customer Agreement. /// The start date of the billing - /// period. + /// period for which the invoice is generated. /// The end date of the billing - /// period. - /// Invoice type. - /// The billing profile id this invoice - /// belongs to. - /// The billing profile display - /// name this invoice belongs to. - /// The purchase identifier for the - /// invoice. + /// period for which the invoice is generated. + /// Invoice type. Possible values include: + /// 'AzureService', 'AzureMarketplace', 'AzureSupport' + /// Specifies if the invoice is + /// generated as part of monthly invoicing cycle or not. This field is + /// applicable to billing accounts with agreement type Microsoft + /// Customer Agreement. + /// The ID of the billing profile for + /// which the invoice is generated. + /// The name of the billing + /// profile for which the invoice is generated. + /// An optional purchase order number + /// for the invoice. /// List of documents available to download - /// including invoice and tax documents. + /// such as invoice and tax receipt. /// List of payments. - public Invoice(string id = default(string), string name = default(string), string type = default(string), System.DateTime? dueDate = default(System.DateTime?), System.DateTime? invoiceDate = default(System.DateTime?), string status = default(string), Amount amountDue = default(Amount), Amount billedAmount = default(Amount), System.DateTime? invoicePeriodStartDate = default(System.DateTime?), System.DateTime? invoicePeriodEndDate = default(System.DateTime?), object invoiceType = default(object), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string purchaseOrderNumber = default(string), IList documents = default(IList), IList payments = default(IList)) + /// The ID of the subscription for which + /// the invoice is generated. + public Invoice(string id = default(string), string name = default(string), string type = default(string), System.DateTime? dueDate = default(System.DateTime?), System.DateTime? invoiceDate = default(System.DateTime?), string status = default(string), Amount amountDue = default(Amount), Amount azurePrepaymentApplied = default(Amount), Amount billedAmount = default(Amount), Amount creditAmount = default(Amount), Amount freeAzureCreditApplied = default(Amount), Amount subTotal = default(Amount), Amount taxAmount = default(Amount), Amount totalAmount = default(Amount), System.DateTime? invoicePeriodStartDate = default(System.DateTime?), System.DateTime? invoicePeriodEndDate = default(System.DateTime?), string invoiceType = default(string), bool? isMonthlyInvoice = default(bool?), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string purchaseOrderNumber = default(string), IList documents = default(IList), IList payments = default(IList), string subscriptionId = default(string)) : base(id, name, type) { DueDate = dueDate; InvoiceDate = invoiceDate; Status = status; AmountDue = amountDue; + AzurePrepaymentApplied = azurePrepaymentApplied; BilledAmount = billedAmount; + CreditAmount = creditAmount; + FreeAzureCreditApplied = freeAzureCreditApplied; + SubTotal = subTotal; + TaxAmount = taxAmount; + TotalAmount = totalAmount; InvoicePeriodStartDate = invoicePeriodStartDate; InvoicePeriodEndDate = invoicePeriodEndDate; InvoiceType = invoiceType; + IsMonthlyInvoice = isMonthlyInvoice; BillingProfileId = billingProfileId; BillingProfileDisplayName = billingProfileDisplayName; PurchaseOrderNumber = purchaseOrderNumber; Documents = documents; Payments = payments; + SubscriptionId = subscriptionId; CustomInit(); } @@ -83,75 +118,135 @@ public Invoice() partial void CustomInit(); /// - /// Gets the due date for invoice. + /// Gets the due date for the invoice. /// [JsonProperty(PropertyName = "properties.dueDate")] public System.DateTime? DueDate { get; private set; } /// - /// Gets the date when invoice was created. + /// Gets the date when the invoice was generated. /// [JsonProperty(PropertyName = "properties.invoiceDate")] public System.DateTime? InvoiceDate { get; private set; } /// - /// Gets invoice status. Possible values include: 'PastDue', 'Due', - /// 'Paid', 'Void' + /// Gets the current status of the invoice. Possible values include: + /// 'Due', 'OverDue', 'Paid' /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; private set; } /// - /// Gets amount due. + /// Gets the amount due as of now. /// [JsonProperty(PropertyName = "properties.amountDue")] public Amount AmountDue { get; private set; } /// - /// Gets amount billed. + /// Gets the amount of Azure prepayment applied to the charges. This + /// field is applicable to billing accounts with agreement type + /// Microsoft Customer Agreement. + /// + [JsonProperty(PropertyName = "properties.azurePrepaymentApplied")] + public Amount AzurePrepaymentApplied { get; private set; } + + /// + /// Gets the total charges for the invoice billing period. /// [JsonProperty(PropertyName = "properties.billedAmount")] public Amount BilledAmount { get; private set; } /// - /// Gets the start date of the billing period. + /// Gets the total refund for returns and cancellations during the + /// invoice billing period. This field is applicable to billing + /// accounts with agreement type Microsoft Customer Agreement. + /// + [JsonProperty(PropertyName = "properties.creditAmount")] + public Amount CreditAmount { get; private set; } + + /// + /// Gets the amount of free Azure credits applied to the charges. This + /// field is applicable to billing accounts with agreement type + /// Microsoft Customer Agreement. + /// + [JsonProperty(PropertyName = "properties.freeAzureCreditApplied")] + public Amount FreeAzureCreditApplied { get; private set; } + + /// + /// Gets the pre-tax amount due. This field is applicable to billing + /// accounts with agreement type Microsoft Customer Agreement. + /// + [JsonProperty(PropertyName = "properties.subTotal")] + public Amount SubTotal { get; private set; } + + /// + /// Gets the amount of tax charged for the billing period. This field + /// is applicable to billing accounts with agreement type Microsoft + /// Customer Agreement. + /// + [JsonProperty(PropertyName = "properties.taxAmount")] + public Amount TaxAmount { get; private set; } + + /// + /// Gets the amount due when the invoice was generated. This field is + /// applicable to billing accounts with agreement type Microsoft + /// Customer Agreement. + /// + [JsonProperty(PropertyName = "properties.totalAmount")] + public Amount TotalAmount { get; private set; } + + /// + /// Gets the start date of the billing period for which the invoice is + /// generated. /// [JsonProperty(PropertyName = "properties.invoicePeriodStartDate")] public System.DateTime? InvoicePeriodStartDate { get; private set; } /// - /// Gets the end date of the billing period. + /// Gets the end date of the billing period for which the invoice is + /// generated. /// [JsonProperty(PropertyName = "properties.invoicePeriodEndDate")] public System.DateTime? InvoicePeriodEndDate { get; private set; } /// - /// Gets invoice type. + /// Gets invoice type. Possible values include: 'AzureService', + /// 'AzureMarketplace', 'AzureSupport' /// [JsonProperty(PropertyName = "properties.invoiceType")] - public object InvoiceType { get; private set; } + public string InvoiceType { get; private set; } /// - /// Gets the billing profile id this invoice belongs to. + /// Gets specifies if the invoice is generated as part of monthly + /// invoicing cycle or not. This field is applicable to billing + /// accounts with agreement type Microsoft Customer Agreement. + /// + [JsonProperty(PropertyName = "properties.isMonthlyInvoice")] + public bool? IsMonthlyInvoice { get; private set; } + + /// + /// Gets the ID of the billing profile for which the invoice is + /// generated. /// [JsonProperty(PropertyName = "properties.billingProfileId")] public string BillingProfileId { get; private set; } /// - /// Gets the billing profile display name this invoice belongs to. + /// Gets the name of the billing profile for which the invoice is + /// generated. /// [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] public string BillingProfileDisplayName { get; private set; } /// - /// Gets the purchase identifier for the invoice. + /// Gets an optional purchase order number for the invoice. /// [JsonProperty(PropertyName = "properties.purchaseOrderNumber")] public string PurchaseOrderNumber { get; private set; } /// - /// Gets list of documents available to download including invoice and - /// tax documents. + /// Gets list of documents available to download such as invoice and + /// tax receipt. /// [JsonProperty(PropertyName = "properties.documents")] public IList Documents { get; private set; } @@ -162,5 +257,11 @@ public Invoice() [JsonProperty(PropertyName = "properties.payments")] public IList Payments { get; private set; } + /// + /// Gets the ID of the subscription for which the invoice is generated. + /// + [JsonProperty(PropertyName = "properties.subscriptionId")] + public string SubscriptionId { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs deleted file mode 100644 index 29686c43e46f0..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing invoices. - /// - public partial class InvoiceListResult - { - /// - /// Initializes a new instance of the InvoiceListResult class. - /// - public InvoiceListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InvoiceListResult class. - /// - /// The list of invoices. - /// The link (url) to the next page of - /// results. - public InvoiceListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of invoices. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSection.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSection.cs index 7d0e4e64e6d7c..1a7aaac35a841 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSection.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSection.cs @@ -13,10 +13,12 @@ namespace Microsoft.Azure.Management.Billing.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// An InvoiceSection resource. + /// An invoice section. /// [Rest.Serialization.JsonTransformation] public partial class InvoiceSection : Resource @@ -35,11 +37,17 @@ public InvoiceSection() /// Resource Id. /// Resource name. /// Resource type. - /// The name of the InvoiceSection. - public InvoiceSection(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string)) + /// The name of the invoice section. + /// Dictionary of metadata associated with the + /// invoice section. + /// The system generated unique identifier for + /// an invoice section. + public InvoiceSection(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IDictionary labels = default(IDictionary), string systemId = default(string)) : base(id, name, type) { DisplayName = displayName; + Labels = labels; + SystemId = systemId; CustomInit(); } @@ -49,10 +57,23 @@ public InvoiceSection() partial void CustomInit(); /// - /// Gets or sets the name of the InvoiceSection. + /// Gets or sets the name of the invoice section. /// [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } + /// + /// Gets or sets dictionary of metadata associated with the invoice + /// section. + /// + [JsonProperty(PropertyName = "properties.labels")] + public IDictionary Labels { get; set; } + + /// + /// Gets the system generated unique identifier for an invoice section. + /// + [JsonProperty(PropertyName = "properties.systemId")] + public string SystemId { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs index 63666bada0da4..aabc5101d2f23 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// The properties of an InvoiceSection. + /// The properties of the invoice section. /// public partial class InvoiceSectionCreationRequest { @@ -31,7 +31,7 @@ public InvoiceSectionCreationRequest() /// Initializes a new instance of the InvoiceSectionCreationRequest /// class. /// - /// The name of the InvoiceSection. + /// The name of the invoice section. public InvoiceSectionCreationRequest(string displayName = default(string)) { DisplayName = displayName; @@ -44,7 +44,7 @@ public InvoiceSectionCreationRequest() partial void CustomInit(); /// - /// Gets or sets the name of the InvoiceSection. + /// Gets or sets the name of the invoice section. /// [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionListResult.cs deleted file mode 100644 index f99662b1fb2a0..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionListResult.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing invoice sections. - /// - public partial class InvoiceSectionListResult - { - /// - /// Initializes a new instance of the InvoiceSectionListResult class. - /// - public InvoiceSectionListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InvoiceSectionListResult class. - /// - /// The list of invoice sections. - /// The link (url) to the next page of - /// results. - public InvoiceSectionListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of invoice sections. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionWithCreateSubPermission.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionWithCreateSubPermission.cs index bb5db3d7a2711..3d02822f8b687 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionWithCreateSubPermission.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionWithCreateSubPermission.cs @@ -33,20 +33,39 @@ public InvoiceSectionWithCreateSubPermission() /// Initializes a new instance of the /// InvoiceSectionWithCreateSubPermission class. /// - /// Invoice Section Id. - /// Invoice Section display - /// name. - /// Billing profile Id. - /// Billing profile display - /// name. + /// The ID of the invoice + /// section. + /// The name of the invoice + /// section. + /// The system generated unique + /// identifier for an invoice section. + /// The ID of the billing profile for + /// the invoice section. + /// The name of the billing + /// profile for the invoice section. + /// The status of the billing + /// profile. Possible values include: 'Active', 'Disabled', + /// 'Warned' + /// Reason for the + /// specified billing profile status. Possible values include: + /// 'PastDue', 'SpendingLimitReached', 'SpendingLimitExpired' + /// The billing profile + /// spending limit. Possible values include: 'Off', 'On' + /// The system generated unique + /// identifier for a billing profile. /// Enabled azure plans for the /// associated billing profile. - public InvoiceSectionWithCreateSubPermission(string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), IList enabledAzurePlans = default(IList)) + public InvoiceSectionWithCreateSubPermission(string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string invoiceSectionSystemId = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string billingProfileStatus = default(string), string billingProfileStatusReasonCode = default(string), string billingProfileSpendingLimit = default(string), string billingProfileSystemId = default(string), IList enabledAzurePlans = default(IList)) { InvoiceSectionId = invoiceSectionId; InvoiceSectionDisplayName = invoiceSectionDisplayName; + InvoiceSectionSystemId = invoiceSectionSystemId; BillingProfileId = billingProfileId; BillingProfileDisplayName = billingProfileDisplayName; + BillingProfileStatus = billingProfileStatus; + BillingProfileStatusReasonCode = billingProfileStatusReasonCode; + BillingProfileSpendingLimit = billingProfileSpendingLimit; + BillingProfileSystemId = billingProfileSystemId; EnabledAzurePlans = enabledAzurePlans; CustomInit(); } @@ -57,29 +76,63 @@ public InvoiceSectionWithCreateSubPermission() partial void CustomInit(); /// - /// Gets invoice Section Id. + /// Gets the ID of the invoice section. /// [JsonProperty(PropertyName = "invoiceSectionId")] public string InvoiceSectionId { get; private set; } /// - /// Gets invoice Section display name. + /// Gets the name of the invoice section. /// [JsonProperty(PropertyName = "invoiceSectionDisplayName")] public string InvoiceSectionDisplayName { get; private set; } /// - /// Gets billing profile Id. + /// Gets the system generated unique identifier for an invoice section. + /// + [JsonProperty(PropertyName = "invoiceSectionSystemId")] + public string InvoiceSectionSystemId { get; private set; } + + /// + /// Gets the ID of the billing profile for the invoice section. /// [JsonProperty(PropertyName = "billingProfileId")] public string BillingProfileId { get; private set; } /// - /// Gets billing profile display name. + /// Gets the name of the billing profile for the invoice section. /// [JsonProperty(PropertyName = "billingProfileDisplayName")] public string BillingProfileDisplayName { get; private set; } + /// + /// Gets the status of the billing profile. Possible values include: + /// 'Active', 'Disabled', 'Warned' + /// + [JsonProperty(PropertyName = "billingProfileStatus")] + public string BillingProfileStatus { get; private set; } + + /// + /// Gets reason for the specified billing profile status. Possible + /// values include: 'PastDue', 'SpendingLimitReached', + /// 'SpendingLimitExpired' + /// + [JsonProperty(PropertyName = "billingProfileStatusReasonCode")] + public string BillingProfileStatusReasonCode { get; private set; } + + /// + /// Gets the billing profile spending limit. Possible values include: + /// 'Off', 'On' + /// + [JsonProperty(PropertyName = "billingProfileSpendingLimit")] + public string BillingProfileSpendingLimit { get; private set; } + + /// + /// Gets the system generated unique identifier for a billing profile. + /// + [JsonProperty(PropertyName = "billingProfileSystemId")] + public string BillingProfileSystemId { get; private set; } + /// /// Gets or sets enabled azure plans for the associated billing /// profile. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs deleted file mode 100644 index 347073d3b7c44..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines headers for Create operation. - /// - public partial class InvoiceSectionsCreateHeaders - { - /// - /// Initializes a new instance of the InvoiceSectionsCreateHeaders - /// class. - /// - public InvoiceSectionsCreateHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InvoiceSectionsCreateHeaders - /// class. - /// - /// Location URI to poll for result - /// Recommends the retryable time after - /// receiving this. - public InvoiceSectionsCreateHeaders(string location = default(string), int? retryAfter = default(int?)) - { - Location = location; - RetryAfter = retryAfter; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets location URI to poll for result - /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - - /// - /// Gets or sets recommends the retryable time after receiving this. - /// - [JsonProperty(PropertyName = "Retry-After")] - public int? RetryAfter { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateOrUpdateHeaders.cs similarity index 60% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateHeaders.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateOrUpdateHeaders.cs index c5888737ec7d7..28621c7ef62f3 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateOrUpdateHeaders.cs @@ -14,27 +14,28 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Defines headers for Create operation. + /// Defines headers for CreateOrUpdate operation. /// - public partial class BillingProfilesCreateHeaders + public partial class InvoiceSectionsCreateOrUpdateHeaders { /// - /// Initializes a new instance of the BillingProfilesCreateHeaders - /// class. + /// Initializes a new instance of the + /// InvoiceSectionsCreateOrUpdateHeaders class. /// - public BillingProfilesCreateHeaders() + public InvoiceSectionsCreateOrUpdateHeaders() { CustomInit(); } /// - /// Initializes a new instance of the BillingProfilesCreateHeaders - /// class. + /// Initializes a new instance of the + /// InvoiceSectionsCreateOrUpdateHeaders class. /// /// Location URI to poll for result - /// Recommends the retryable time after - /// receiving this. - public BillingProfilesCreateHeaders(string location = default(string), int? retryAfter = default(int?)) + /// Recommended time to wait before making + /// another request to check the status of the operation. The time is + /// specified in seconds. + public InvoiceSectionsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; @@ -53,7 +54,9 @@ public BillingProfilesCreateHeaders() public string Location { get; set; } /// - /// Gets or sets recommends the retryable time after receiving this. + /// Gets or sets recommended time to wait before making another request + /// to check the status of the operation. The time is specified in + /// seconds. /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsOnExpand.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsOnExpand.cs new file mode 100644 index 0000000000000..a30a4a9003e0b --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsOnExpand.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The invoice sections associated to the billing profile. By default this + /// is not populated, unless it's specified in $expand. + /// + public partial class InvoiceSectionsOnExpand + { + /// + /// Initializes a new instance of the InvoiceSectionsOnExpand class. + /// + public InvoiceSectionsOnExpand() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InvoiceSectionsOnExpand class. + /// + /// Indicates whether there are more + /// invoice sections than the ones listed in this collection. The + /// collection lists a maximum of 50 invoice sections. To get all + /// invoice sections, use the list invoice sections API. + /// The invoice sections associated to the billing + /// profile. + public InvoiceSectionsOnExpand(bool? hasMoreResults = default(bool?), IList value = default(IList)) + { + HasMoreResults = hasMoreResults; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets indicates whether there are more invoice sections than the + /// ones listed in this collection. The collection lists a maximum of + /// 50 invoice sections. To get all invoice sections, use the list + /// invoice sections API. + /// + [JsonProperty(PropertyName = "hasMoreResults")] + public bool? HasMoreResults { get; private set; } + + /// + /// Gets or sets the invoice sections associated to the billing + /// profile. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs index 3ed93022c0554..4a4bcaa725a27 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs @@ -16,9 +16,8 @@ namespace Microsoft.Azure.Management.Billing.Models /// public static class InvoiceStatus { - public const string PastDue = "PastDue"; public const string Due = "Due"; + public const string OverDue = "OverDue"; public const string Paid = "Paid"; - public const string Void = "Void"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceType.cs new file mode 100644 index 0000000000000..e6fa4d753a6c8 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for InvoiceType. + /// + public static class InvoiceType + { + public const string AzureService = "AzureService"; + public const string AzureMarketplace = "AzureMarketplace"; + public const string AzureSupport = "AzureSupport"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsUpdateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadBillingSubscriptionInvoiceHeaders.cs similarity index 75% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsUpdateHeaders.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadBillingSubscriptionInvoiceHeaders.cs index acf6515b6a3d0..ae2853e38f549 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsUpdateHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadBillingSubscriptionInvoiceHeaders.cs @@ -14,29 +14,29 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Defines headers for Update operation. + /// Defines headers for DownloadBillingSubscriptionInvoice operation. /// - public partial class InvoiceSectionsUpdateHeaders + public partial class InvoicesDownloadBillingSubscriptionInvoiceHeaders { /// - /// Initializes a new instance of the InvoiceSectionsUpdateHeaders - /// class. + /// Initializes a new instance of the + /// InvoicesDownloadBillingSubscriptionInvoiceHeaders class. /// - public InvoiceSectionsUpdateHeaders() + public InvoicesDownloadBillingSubscriptionInvoiceHeaders() { CustomInit(); } /// - /// Initializes a new instance of the InvoiceSectionsUpdateHeaders - /// class. + /// Initializes a new instance of the + /// InvoicesDownloadBillingSubscriptionInvoiceHeaders class. /// /// GET this URL to retrieve the status of the /// asynchronous operation. /// The amount of delay to use while the /// status of the operation is checked. The value is expressed in /// seconds. - public InvoiceSectionsUpdateHeaders(string location = default(string), string retryAfter = default(string)) + public InvoicesDownloadBillingSubscriptionInvoiceHeaders(string location = default(string), string retryAfter = default(string)) { Location = location; RetryAfter = retryAfter; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesUpdateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadInvoiceHeaders.cs similarity index 80% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesUpdateHeaders.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadInvoiceHeaders.cs index dd7e540152243..3f8c4a1ebf388 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesUpdateHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoicesDownloadInvoiceHeaders.cs @@ -14,21 +14,21 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Defines headers for Update operation. + /// Defines headers for DownloadInvoice operation. /// - public partial class BillingProfilesUpdateHeaders + public partial class InvoicesDownloadInvoiceHeaders { /// - /// Initializes a new instance of the BillingProfilesUpdateHeaders + /// Initializes a new instance of the InvoicesDownloadInvoiceHeaders /// class. /// - public BillingProfilesUpdateHeaders() + public InvoicesDownloadInvoiceHeaders() { CustomInit(); } /// - /// Initializes a new instance of the BillingProfilesUpdateHeaders + /// Initializes a new instance of the InvoicesDownloadInvoiceHeaders /// class. /// /// GET this URL to retrieve the status of the @@ -36,7 +36,7 @@ public BillingProfilesUpdateHeaders() /// The amount of delay to use while the /// status of the operation is checked. The value is expressed in /// seconds. - public BillingProfilesUpdateHeaders(string location = default(string), string retryAfter = default(string)) + public InvoicesDownloadInvoiceHeaders(string location = default(string), string retryAfter = default(string)) { Location = location; RetryAfter = retryAfter; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs deleted file mode 100644 index 69722dbd54338..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Line of credit resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class LineOfCredit : Resource - { - /// - /// Initializes a new instance of the LineOfCredit class. - /// - public LineOfCredit() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LineOfCredit class. - /// - /// Resource Id. - /// Resource name. - /// Resource type. - /// The current credit limit. - /// The reason for the line of credit status when - /// not approved. - /// Remaining balance. - /// The line of credit status. Possible values - /// include: 'Approved', 'Rejected' - public LineOfCredit(string id = default(string), string name = default(string), string type = default(string), Amount creditLimit = default(Amount), string reason = default(string), Amount remainingBalance = default(Amount), string status = default(string)) - : base(id, name, type) - { - CreditLimit = creditLimit; - Reason = reason; - RemainingBalance = remainingBalance; - Status = status; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the current credit limit. - /// - [JsonProperty(PropertyName = "properties.creditLimit")] - public Amount CreditLimit { get; set; } - - /// - /// Gets the reason for the line of credit status when not approved. - /// - [JsonProperty(PropertyName = "properties.reason")] - public string Reason { get; private set; } - - /// - /// Gets remaining balance. - /// - [JsonProperty(PropertyName = "properties.remainingBalance")] - public Amount RemainingBalance { get; private set; } - - /// - /// Gets or sets the line of credit status. Possible values include: - /// 'Approved', 'Rejected' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationDisplay.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationDisplay.cs index 41b4803e19cad..1fb0a8ab0c51c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationDisplay.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationDisplay.cs @@ -30,10 +30,10 @@ public OperationDisplay() /// Initializes a new instance of the OperationDisplay class. /// /// Service provider: Microsoft.Billing. - /// Resource on which the operation is - /// performed: Invoice, etc. - /// Operation type: Read, write, delete, - /// etc. + /// Resource on which the operation is performed + /// such as invoice and billing subscription. + /// Operation type such as read, write and + /// delete. public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string)) { Provider = provider; @@ -54,13 +54,14 @@ public OperationDisplay() public string Provider { get; private set; } /// - /// Gets resource on which the operation is performed: Invoice, etc. + /// Gets resource on which the operation is performed such as invoice + /// and billing subscription. /// [JsonProperty(PropertyName = "resource")] public string Resource { get; private set; } /// - /// Gets operation type: Read, write, delete, etc. + /// Gets operation type such as read, write and delete. /// [JsonProperty(PropertyName = "operation")] public string Operation { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Participants.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Participants.cs index a5461b7cd5c0c..760f89ceb15ec 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Participants.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Participants.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Details about the participant or signer. + /// The details about a participant. /// public partial class Participants { @@ -29,10 +29,11 @@ public Participants() /// /// Initializes a new instance of the Participants class. /// - /// The signing status - /// The date when status got changed. - /// The email address of the participant or - /// signer. + /// The acceptance status of the + /// participant. + /// The date when the status got + /// changed. + /// The email address of the participant. public Participants(string status = default(string), System.DateTime? statusDate = default(System.DateTime?), string email = default(string)) { Status = status; @@ -47,19 +48,19 @@ public Participants() partial void CustomInit(); /// - /// Gets the signing status + /// Gets the acceptance status of the participant. /// [JsonProperty(PropertyName = "status")] public string Status { get; private set; } /// - /// Gets the date when status got changed. + /// Gets the date when the status got changed. /// [JsonProperty(PropertyName = "statusDate")] public System.DateTime? StatusDate { get; private set; } /// - /// Gets the email address of the participant or signer. + /// Gets the email address of the participant. /// [JsonProperty(PropertyName = "email")] public string Email { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs deleted file mode 100644 index 02fb87d8c3d00..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A payment method resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class PaymentMethod : Resource - { - /// - /// Initializes a new instance of the PaymentMethod class. - /// - public PaymentMethod() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PaymentMethod class. - /// - /// Resource Id. - /// Resource name. - /// Resource type. - /// Payment method type. Possible - /// values include: 'Credits', 'ChequeWire' - /// Details about the payment method. - /// Expiration month and year. - /// The currency associated with the payment - /// method. - public PaymentMethod(string id = default(string), string name = default(string), string type = default(string), string paymentMethodType = default(string), string details = default(string), string expiration = default(string), string currency = default(string)) - : base(id, name, type) - { - PaymentMethodType = paymentMethodType; - Details = details; - Expiration = expiration; - Currency = currency; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets payment method type. Possible values include: - /// 'Credits', 'ChequeWire' - /// - [JsonProperty(PropertyName = "properties.paymentMethodType")] - public string PaymentMethodType { get; set; } - - /// - /// Gets details about the payment method. - /// - [JsonProperty(PropertyName = "properties.details")] - public string Details { get; private set; } - - /// - /// Gets expiration month and year. - /// - [JsonProperty(PropertyName = "properties.expiration")] - public string Expiration { get; private set; } - - /// - /// Gets the currency associated with the payment method. - /// - [JsonProperty(PropertyName = "properties.currency")] - public string Currency { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentProperties.cs index a11d333f68025..ce8212f8a6afa 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentProperties.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// The properties of the payment. + /// The properties of a payment. /// public partial class PaymentProperties { @@ -31,8 +31,8 @@ public PaymentProperties() /// /// The type of payment. /// The paid amount. - /// The date of the payment. - /// The payment method family. + /// The date when the payment was made. + /// The family of payment method. /// Possible values include: 'Credits', 'CheckWire', 'CreditCard', /// 'None' /// The type of payment method. @@ -64,13 +64,13 @@ public PaymentProperties() public Amount Amount { get; private set; } /// - /// Gets the date of the payment. + /// Gets the date when the payment was made. /// [JsonProperty(PropertyName = "date")] public System.DateTime? Date { get; private set; } /// - /// Gets or sets the payment method family. Possible values include: + /// Gets or sets the family of payment method. Possible values include: /// 'Credits', 'CheckWire', 'CreditCard', 'None' /// [JsonProperty(PropertyName = "paymentMethodFamily")] diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Policy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Policy.cs index e402244f9f92d..09eb26d7da033 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Policy.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Policy.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// The Policy. + /// A policy. /// [Rest.Serialization.JsonTransformation] public partial class Policy : Resource @@ -35,14 +35,16 @@ public Policy() /// Resource Id. /// Resource name. /// Resource type. - /// The marketplace purchases are - /// free, allowed or not allowed. Possible values include: - /// 'AllAllowed', 'OnlyFreeAllowed', 'NotAllowed' - /// The reservation purchases - /// allowed or not. Possible values include: 'Allowed', + /// The policy that controls whether + /// Azure marketplace purchases are allowed for a billing profile. + /// Possible values include: 'AllAllowed', 'OnlyFreeAllowed', /// 'NotAllowed' - /// Who can view charges. Possible values - /// include: 'Allowed', 'NotAllowed' + /// The policy that controls whether + /// Azure reservation purchases are allowed for a billing profile. + /// Possible values include: 'Allowed', 'NotAllowed' + /// The policy that controls whether users + /// with Azure RBAC access to a subscription can view its charges. + /// Possible values include: 'Allowed', 'NotAllowed' public Policy(string id = default(string), string name = default(string), string type = default(string), string marketplacePurchases = default(string), string reservationPurchases = default(string), string viewCharges = default(string)) : base(id, name, type) { @@ -58,23 +60,25 @@ public Policy() partial void CustomInit(); /// - /// Gets or sets the marketplace purchases are free, allowed or not - /// allowed. Possible values include: 'AllAllowed', 'OnlyFreeAllowed', - /// 'NotAllowed' + /// Gets or sets the policy that controls whether Azure marketplace + /// purchases are allowed for a billing profile. Possible values + /// include: 'AllAllowed', 'OnlyFreeAllowed', 'NotAllowed' /// [JsonProperty(PropertyName = "properties.marketplacePurchases")] public string MarketplacePurchases { get; set; } /// - /// Gets or sets the reservation purchases allowed or not. Possible - /// values include: 'Allowed', 'NotAllowed' + /// Gets or sets the policy that controls whether Azure reservation + /// purchases are allowed for a billing profile. Possible values + /// include: 'Allowed', 'NotAllowed' /// [JsonProperty(PropertyName = "properties.reservationPurchases")] public string ReservationPurchases { get; set; } /// - /// Gets or sets who can view charges. Possible values include: - /// 'Allowed', 'NotAllowed' + /// Gets or sets the policy that controls whether users with Azure RBAC + /// access to a subscription can view its charges. Possible values + /// include: 'Allowed', 'NotAllowed' /// [JsonProperty(PropertyName = "properties.viewCharges")] public string ViewCharges { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.cs deleted file mode 100644 index 47a7dd2a5b11c..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines headers for DownloadByBillingProfile operation. - /// - public partial class PriceSheetDownloadByBillingProfileHeaders - { - /// - /// Initializes a new instance of the - /// PriceSheetDownloadByBillingProfileHeaders class. - /// - public PriceSheetDownloadByBillingProfileHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// PriceSheetDownloadByBillingProfileHeaders class. - /// - /// GET this URL to retrieve the status of the - /// asynchronous operation. - /// The amount of delay to use while the - /// status of the operation is checked. The value is expressed in - /// seconds. - /// The operation entity Id GUID. - public PriceSheetDownloadByBillingProfileHeaders(string location = default(string), string retryAfter = default(string), string oDataEntityId = default(string)) - { - Location = location; - RetryAfter = retryAfter; - ODataEntityId = oDataEntityId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets GET this URL to retrieve the status of the - /// asynchronous operation. - /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - - /// - /// Gets or sets the amount of delay to use while the status of the - /// operation is checked. The value is expressed in seconds. - /// - [JsonProperty(PropertyName = "Retry-After")] - public string RetryAfter { get; set; } - - /// - /// Gets or sets the operation entity Id GUID. - /// - [JsonProperty(PropertyName = "OData-EntityId")] - public string ODataEntityId { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs deleted file mode 100644 index 29f758def14c2..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines headers for Download operation. - /// - public partial class PriceSheetDownloadHeaders - { - /// - /// Initializes a new instance of the PriceSheetDownloadHeaders class. - /// - public PriceSheetDownloadHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PriceSheetDownloadHeaders class. - /// - /// GET this URL to retrieve the status of the - /// asynchronous operation. - /// The amount of delay to use while the - /// status of the operation is checked. The value is expressed in - /// seconds. - /// The operation entity Id GUID. - public PriceSheetDownloadHeaders(string location = default(string), string retryAfter = default(string), string oDataEntityId = default(string)) - { - Location = location; - RetryAfter = retryAfter; - ODataEntityId = oDataEntityId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets GET this URL to retrieve the status of the - /// asynchronous operation. - /// - [JsonProperty(PropertyName = "Location")] - public string Location { get; set; } - - /// - /// Gets or sets the amount of delay to use while the status of the - /// operation is checked. The value is expressed in seconds. - /// - [JsonProperty(PropertyName = "Retry-After")] - public string RetryAfter { get; set; } - - /// - /// Gets or sets the operation entity Id GUID. - /// - [JsonProperty(PropertyName = "OData-EntityId")] - public string ODataEntityId { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs index 8303f5c9e9a69..b32228ce453dd 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A product resource. + /// A product. /// [Rest.Serialization.JsonTransformation] public partial class Product : Resource @@ -35,39 +35,52 @@ public Product() /// Resource Id. /// Resource name. /// Resource type. + /// Indicates whether auto renewal is turned on + /// or off for a product. Possible values include: 'Off', 'On' /// The display name of the product. - /// The date of purchase. - /// The product type id. - /// The type of product. - /// Product status. Possible values include: - /// 'Active', 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', - /// 'Cancelled', 'AutoRenew' - /// end date. - /// Billing frequency. Possible values - /// include: 'OneTime', 'Monthly', 'UsageBased' - /// Last month charges. + /// The date when the product was + /// purchased. + /// The ID of the type of product. + /// The description of the type of + /// product. + /// The current status of the product. Possible + /// values include: 'Active', 'Inactive', 'PastDue', 'Expiring', + /// 'Expired', 'Disabled', 'Cancelled', 'AutoRenew' + /// The date when the product will be renewed or + /// canceled. + /// The frequency at which the product + /// will be billed. Possible values include: 'OneTime', 'Monthly', + /// 'UsageBased' + /// The last month charges. /// The date of the last charge. - /// The purchased product quantity. - /// Sku Id. - /// Sku description. - /// Availability Id. - /// Parent Product Id. - /// Invoice section id to which this - /// product belongs. - /// Invoice section display - /// name to which this product belongs. - /// Billing Profile id to which this - /// product belongs. - /// Billing Profile display - /// name to which this product belongs. - /// Customer id to which this product - /// belongs. - /// Display name of customer to which - /// this product belongs. + /// The quantity purchased for the + /// product. + /// The sku ID of the product. + /// The sku description of the + /// product. + /// The id of the tenant in which the product is + /// used. + /// The availability of the + /// product. + /// The ID of the invoice section to + /// which the product is billed. + /// The name of the invoice + /// section to which the product is billed. + /// The ID of the billing profile to + /// which the product is billed. + /// The name of the billing + /// profile to which the product is billed. + /// The ID of the customer for whom the + /// product was purchased. The field is applicable only for Microsoft + /// Partner Agreement billing account. + /// The name of the customer for whom + /// the product was purchased. The field is applicable only for + /// Microsoft Partner Agreement billing account. /// Reseller for this product. - public Product(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), System.DateTime? purchaseDate = default(System.DateTime?), string productTypeId = default(string), string productType = default(string), string status = default(string), System.DateTime? endDate = default(System.DateTime?), string billingFrequency = default(string), Amount lastCharge = default(Amount), System.DateTime? lastChargeDate = default(System.DateTime?), double? quantity = default(double?), string skuId = default(string), string skuDescription = default(string), string availabilityId = default(string), string parentProductId = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string customerId = default(string), string customerDisplayName = default(string), Reseller reseller = default(Reseller)) + public Product(string id = default(string), string name = default(string), string type = default(string), string autoRenew = default(string), string displayName = default(string), System.DateTime? purchaseDate = default(System.DateTime?), string productTypeId = default(string), string productType = default(string), string status = default(string), System.DateTime? endDate = default(System.DateTime?), string billingFrequency = default(string), Amount lastCharge = default(Amount), System.DateTime? lastChargeDate = default(System.DateTime?), double? quantity = default(double?), string skuId = default(string), string skuDescription = default(string), string tenantId = default(string), string availabilityId = default(string), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string customerId = default(string), string customerDisplayName = default(string), Reseller reseller = default(Reseller)) : base(id, name, type) { + AutoRenew = autoRenew; DisplayName = displayName; PurchaseDate = purchaseDate; ProductTypeId = productTypeId; @@ -80,8 +93,8 @@ public Product() Quantity = quantity; SkuId = skuId; SkuDescription = skuDescription; + TenantId = tenantId; AvailabilityId = availabilityId; - ParentProductId = parentProductId; InvoiceSectionId = invoiceSectionId; InvoiceSectionDisplayName = invoiceSectionDisplayName; BillingProfileId = billingProfileId; @@ -97,6 +110,13 @@ public Product() /// partial void CustomInit(); + /// + /// Gets or sets indicates whether auto renewal is turned on or off for + /// a product. Possible values include: 'Off', 'On' + /// + [JsonProperty(PropertyName = "properties.autoRenew")] + public string AutoRenew { get; set; } + /// /// Gets the display name of the product. /// @@ -104,46 +124,46 @@ public Product() public string DisplayName { get; private set; } /// - /// Gets the date of purchase. + /// Gets the date when the product was purchased. /// [JsonProperty(PropertyName = "properties.purchaseDate")] public System.DateTime? PurchaseDate { get; private set; } /// - /// Gets the product type id. + /// Gets the ID of the type of product. /// [JsonProperty(PropertyName = "properties.productTypeId")] public string ProductTypeId { get; private set; } /// - /// Gets the type of product. + /// Gets the description of the type of product. /// [JsonProperty(PropertyName = "properties.productType")] public string ProductType { get; private set; } /// - /// Gets or sets product status. Possible values include: 'Active', - /// 'Inactive', 'PastDue', 'Expiring', 'Expired', 'Disabled', - /// 'Cancelled', 'AutoRenew' + /// Gets or sets the current status of the product. Possible values + /// include: 'Active', 'Inactive', 'PastDue', 'Expiring', 'Expired', + /// 'Disabled', 'Cancelled', 'AutoRenew' /// [JsonProperty(PropertyName = "properties.status")] public string Status { get; set; } /// - /// Gets end date. + /// Gets the date when the product will be renewed or canceled. /// [JsonProperty(PropertyName = "properties.endDate")] public System.DateTime? EndDate { get; private set; } /// - /// Gets or sets billing frequency. Possible values include: 'OneTime', - /// 'Monthly', 'UsageBased' + /// Gets or sets the frequency at which the product will be billed. + /// Possible values include: 'OneTime', 'Monthly', 'UsageBased' /// [JsonProperty(PropertyName = "properties.billingFrequency")] public string BillingFrequency { get; set; } /// - /// Gets last month charges. + /// Gets the last month charges. /// [JsonProperty(PropertyName = "properties.lastCharge")] public Amount LastCharge { get; private set; } @@ -155,67 +175,73 @@ public Product() public System.DateTime? LastChargeDate { get; private set; } /// - /// Gets the purchased product quantity. + /// Gets the quantity purchased for the product. /// [JsonProperty(PropertyName = "properties.quantity")] public double? Quantity { get; private set; } /// - /// Gets sku Id. + /// Gets the sku ID of the product. /// [JsonProperty(PropertyName = "properties.skuId")] public string SkuId { get; private set; } /// - /// Gets sku description. + /// Gets the sku description of the product. /// [JsonProperty(PropertyName = "properties.skuDescription")] public string SkuDescription { get; private set; } /// - /// Gets availability Id. + /// Gets the id of the tenant in which the product is used. /// - [JsonProperty(PropertyName = "properties.availabilityId")] - public string AvailabilityId { get; private set; } + [JsonProperty(PropertyName = "properties.tenantId")] + public string TenantId { get; private set; } /// - /// Gets parent Product Id. + /// Gets the availability of the product. /// - [JsonProperty(PropertyName = "properties.parentProductId")] - public string ParentProductId { get; private set; } + [JsonProperty(PropertyName = "properties.availabilityId")] + public string AvailabilityId { get; private set; } /// - /// Gets invoice section id to which this product belongs. + /// Gets the ID of the invoice section to which the product is billed. /// [JsonProperty(PropertyName = "properties.invoiceSectionId")] public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section display name to which this product belongs. + /// Gets the name of the invoice section to which the product is + /// billed. /// [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] public string InvoiceSectionDisplayName { get; private set; } /// - /// Gets billing Profile id to which this product belongs. + /// Gets the ID of the billing profile to which the product is billed. /// [JsonProperty(PropertyName = "properties.billingProfileId")] public string BillingProfileId { get; private set; } /// - /// Gets billing Profile display name to which this product belongs. + /// Gets the name of the billing profile to which the product is + /// billed. /// [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] public string BillingProfileDisplayName { get; private set; } /// - /// Gets customer id to which this product belongs. + /// Gets the ID of the customer for whom the product was purchased. The + /// field is applicable only for Microsoft Partner Agreement billing + /// account. /// [JsonProperty(PropertyName = "properties.customerId")] public string CustomerId { get; private set; } /// - /// Gets display name of customer to which this product belongs. + /// Gets the name of the customer for whom the product was purchased. + /// The field is applicable only for Microsoft Partner Agreement + /// billing account. /// [JsonProperty(PropertyName = "properties.customerDisplayName")] public string CustomerDisplayName { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductDetails.cs deleted file mode 100644 index 2ee4ec23bc1a3..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductDetails.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Details of the product to be transferred. - /// - public partial class ProductDetails - { - /// - /// Initializes a new instance of the ProductDetails class. - /// - public ProductDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProductDetails class. - /// - /// Type of the product to be transferred. - /// Possible values include: 'AzureSubscription', - /// 'AzureReservation' - /// Id of product to be transferred. - public ProductDetails(string productType = default(string), string productId = default(string)) - { - ProductType = productType; - ProductId = productId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of the product to be transferred. Possible values - /// include: 'AzureSubscription', 'AzureReservation' - /// - [JsonProperty(PropertyName = "productType")] - public string ProductType { get; set; } - - /// - /// Gets or sets id of product to be transferred. - /// - [JsonProperty(PropertyName = "productId")] - public string ProductId { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs deleted file mode 100644 index 90a6ed7c54f02..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing products. It contains a list of available products - /// summaries in reverse chronological order by purchase date. - /// - public partial class ProductsListResult - { - /// - /// Initializes a new instance of the ProductsListResult class. - /// - public ProductsListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProductsListResult class. - /// - /// The list of products. - /// The link (url) to the next page of - /// results. - public ProductsListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of products. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsMoveHeaders.cs similarity index 64% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsMoveHeaders.cs index 2440f6d2f2f09..ace8ee2e077c3 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsMoveHeaders.cs @@ -14,25 +14,26 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Defines headers for Transfer operation. + /// Defines headers for Move operation. /// - public partial class ProductsTransferHeaders + public partial class ProductsMoveHeaders { /// - /// Initializes a new instance of the ProductsTransferHeaders class. + /// Initializes a new instance of the ProductsMoveHeaders class. /// - public ProductsTransferHeaders() + public ProductsMoveHeaders() { CustomInit(); } /// - /// Initializes a new instance of the ProductsTransferHeaders class. + /// Initializes a new instance of the ProductsMoveHeaders class. /// /// Location URI to poll for result - /// Recommends the retryable time after - /// receiving this. - public ProductsTransferHeaders(string location = default(string), int? retryAfter = default(int?)) + /// Recommended time to wait before making + /// another request to check the status of the operation. The time is + /// specified in seconds. + public ProductsMoveHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; @@ -51,7 +52,9 @@ public ProductsTransferHeaders() public string Location { get; set; } /// - /// Gets or sets recommends the retryable time after receiving this. + /// Gets or sets recommended time to wait before making another request + /// to check the status of the operation. The time is specified in + /// seconds. /// [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs deleted file mode 100644 index c4dddcb9ca961..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs +++ /dev/null @@ -1,155 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Details of the transfer. - /// - [Rest.Serialization.JsonTransformation] - public partial class RecipientTransferDetails - { - /// - /// Initializes a new instance of the RecipientTransferDetails class. - /// - public RecipientTransferDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RecipientTransferDetails class. - /// - /// Transfer creation time. - /// Transfer expiration time. - /// Type of subscriptions that can be - /// transferred. - /// Overall transfer status. Possible - /// values include: 'Pending', 'InProgress', 'Completed', - /// 'CompletedWithErrors', 'Failed', 'Canceled', 'Declined' - /// Email Id of recipient of - /// transfer. - /// Email Id of initiator of - /// transfer. - /// Reseller Id for transfer. - /// Reseller name for transfer. - /// Customer type of the - /// initiator. - /// Email Id who user canceled the - /// transfer. - /// Transfer last modification - /// time. - /// Detailed transfer - /// status. - public RecipientTransferDetails(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), IList allowedProductType = default(IList), string transferStatus = default(string), string recipientEmailId = default(string), string initiatorEmailId = default(string), string resellerId = default(string), string resellerName = default(string), string initiatorCustomerType = default(string), string canceledBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IList detailedTransferStatus = default(IList)) - { - CreationTime = creationTime; - ExpirationTime = expirationTime; - AllowedProductType = allowedProductType; - TransferStatus = transferStatus; - RecipientEmailId = recipientEmailId; - InitiatorEmailId = initiatorEmailId; - ResellerId = resellerId; - ResellerName = resellerName; - InitiatorCustomerType = initiatorCustomerType; - CanceledBy = canceledBy; - LastModifiedTime = lastModifiedTime; - DetailedTransferStatus = detailedTransferStatus; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets transfer creation time. - /// - [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } - - /// - /// Gets transfer expiration time. - /// - [JsonProperty(PropertyName = "properties.expirationTime")] - public System.DateTime? ExpirationTime { get; private set; } - - /// - /// Gets type of subscriptions that can be transferred. - /// - [JsonProperty(PropertyName = "properties.allowedProductType")] - public IList AllowedProductType { get; private set; } - - /// - /// Gets overall transfer status. Possible values include: 'Pending', - /// 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', - /// 'Canceled', 'Declined' - /// - [JsonProperty(PropertyName = "properties.transferStatus")] - public string TransferStatus { get; private set; } - - /// - /// Gets email Id of recipient of transfer. - /// - [JsonProperty(PropertyName = "properties.recipientEmailId")] - public string RecipientEmailId { get; private set; } - - /// - /// Gets email Id of initiator of transfer. - /// - [JsonProperty(PropertyName = "properties.initiatorEmailId")] - public string InitiatorEmailId { get; private set; } - - /// - /// Gets reseller Id for transfer. - /// - [JsonProperty(PropertyName = "properties.resellerId")] - public string ResellerId { get; private set; } - - /// - /// Gets reseller name for transfer. - /// - [JsonProperty(PropertyName = "properties.resellerName")] - public string ResellerName { get; private set; } - - /// - /// Gets customer type of the initiator. - /// - [JsonProperty(PropertyName = "properties.initiatorCustomerType")] - public string InitiatorCustomerType { get; private set; } - - /// - /// Gets email Id who user canceled the transfer. - /// - [JsonProperty(PropertyName = "properties.canceledBy")] - public string CanceledBy { get; private set; } - - /// - /// Gets transfer last modification time. - /// - [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } - - /// - /// Gets detailed transfer status. - /// - [JsonProperty(PropertyName = "properties.detailedTransferStatus")] - public IList DetailedTransferStatus { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs index 5efc6c6fcde2d..c29c43f43865c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Details about a reseller. + /// Details of the reseller. /// public partial class Reseller { @@ -29,8 +29,8 @@ public Reseller() /// /// Initializes a new instance of the Reseller class. /// - /// The reseller id. - /// A description of the reseller. + /// The MPN ID of the reseller. + /// The name of the reseller. public Reseller(string resellerId = default(string), string description = default(string)) { ResellerId = resellerId; @@ -44,13 +44,13 @@ public Reseller() partial void CustomInit(); /// - /// Gets the reseller id. + /// Gets the MPN ID of the reseller. /// [JsonProperty(PropertyName = "resellerId")] public string ResellerId { get; private set; } /// - /// Gets a description of the reseller. + /// Gets the name of the reseller. /// [JsonProperty(PropertyName = "description")] public string Description { get; private set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SpendingLimit.cs similarity index 68% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductType.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SpendingLimit.cs index 2b308a955dbfc..9c110280d1f3c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductType.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SpendingLimit.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Billing.Models { /// - /// Defines values for ProductType. + /// Defines values for SpendingLimit. /// - public static class ProductType + public static class SpendingLimit { - public const string AzureSubscription = "AzureSubscription"; - public const string AzureReservation = "AzureReservation"; + public const string Off = "Off"; + public const string On = "On"; } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SpendingLimitForBillingProfile.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SpendingLimitForBillingProfile.cs new file mode 100644 index 0000000000000..24ac4ee58ff5c --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SpendingLimitForBillingProfile.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for SpendingLimitForBillingProfile. + /// + public static class SpendingLimitForBillingProfile + { + public const string Off = "Off"; + public const string On = "On"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/StatusReasonCode.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/StatusReasonCode.cs new file mode 100644 index 0000000000000..b91f5b60e789f --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/StatusReasonCode.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for StatusReasonCode. + /// + public static class StatusReasonCode + { + public const string PastDue = "PastDue"; + public const string SpendingLimitReached = "SpendingLimitReached"; + public const string SpendingLimitExpired = "SpendingLimitExpired"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/StatusReasonCodeForBillingProfile.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/StatusReasonCodeForBillingProfile.cs new file mode 100644 index 0000000000000..dcecf204daac7 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/StatusReasonCodeForBillingProfile.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Billing.Models +{ + + /// + /// Defines values for StatusReasonCodeForBillingProfile. + /// + public static class StatusReasonCodeForBillingProfile + { + public const string PastDue = "PastDue"; + public const string SpendingLimitReached = "SpendingLimitReached"; + public const string SpendingLimitExpired = "SpendingLimitExpired"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs index 41adddc53beee..f89628991bb97 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A reservation transaction resource. + /// A transaction. /// [Rest.Serialization.JsonTransformation] public partial class Transaction : Resource @@ -35,42 +35,91 @@ public Transaction() /// Resource Id. /// Resource name. /// Resource type. - /// The kind of transaction. Choices are all and + /// The kind of transaction. Options are all or /// reservation. Possible values include: 'all', 'reservation' - /// The date of reservation transaction. - /// Invoice number or 'pending' if not - /// invoiced. - /// The reservation order id. - /// The reservation order name. - /// The product family. - /// The product type id. - /// The type of product. - /// Product description. - /// Transaction types. Possible values - /// include: 'Purchase', 'Usage Charge' - /// Last charge associated with the - /// purchase. - /// Purchase quantity. - /// Invoice section id to which this - /// product belongs. - /// Invoice section display - /// name to which this product belongs. - /// Billing Profile id to which this - /// product belongs. - /// Billing Profile display - /// name to which this product belongs. - /// Customer id to which this product - /// belongs. - /// Display name of customer to which - /// this product belongs. - /// The subscription id. - /// The subscription name. - public Transaction(string id = default(string), string name = default(string), string type = default(string), string kind = default(string), System.DateTime? date = default(System.DateTime?), string invoice = default(string), string orderId = default(string), string orderName = default(string), string productFamily = default(string), string productTypeId = default(string), string productType = default(string), string productDescription = default(string), string transactionType = default(string), Amount transactionAmount = default(Amount), int? quantity = default(int?), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string customerId = default(string), string customerDisplayName = default(string), string subscriptionId = default(string), string subscriptionName = default(string)) + /// The date of transaction. + /// Invoice on which the transaction was billed + /// or 'pending' if the transaction is not billed. + /// The ID of the invoice on which the + /// transaction was billed. This field is only applicable for + /// transactions which are billed. + /// The order ID of the reservation. The field is + /// only applicable for transaction of kind reservation. + /// The name of the reservation order. The + /// field is only applicable for transactions of kind + /// reservation. + /// The family of the product for which the + /// transaction took place. + /// The ID of the product type for which + /// the transaction took place. + /// The type of the product for which the + /// transaction took place. + /// The description of the product for + /// which the transaction took place. + /// The type of transaction. Possible + /// values include: 'Purchase', 'Usage Charge' + /// The charge associated with the + /// transaction. + /// The quantity purchased in the + /// transaction. + /// The ID of the invoice section which + /// will be billed for the transaction. + /// The name of the invoice + /// section which will be billed for the transaction. + /// The ID of the billing profile which + /// will be billed for the transaction. + /// The name of the billing + /// profile which will be billed for the transaction. + /// The ID of the customer for which the + /// transaction took place. The field is applicable only for Microsoft + /// Partner Agreement billing account. + /// The name of the customer for + /// which the transaction took place. The field is applicable only for + /// Microsoft Partner Agreement billing account. + /// The ID of the subscription that was + /// used for the transaction. The field is only applicable for + /// transaction of kind reservation. + /// The name of the subscription that + /// was used for the transaction. The field is only applicable for + /// transaction of kind reservation. + /// The type of azure plan of the subscription + /// that was used for the transaction. + /// The amount of any Azure credits + /// automatically applied to this transaction. + /// The ISO 4217 code for the currency in + /// which this transaction is billed. + /// The percentage discount, if any, applied to + /// this transaction. + /// The price of the product after + /// applying any discounts. + /// The exchange rate used to convert + /// charged amount to billing currency, if applicable. + /// The retail price of the product. + /// The ISO 4217 code for the currency in + /// which the product is priced. + /// The date of the purchase of + /// the product, or the start date of the month in which usage + /// started. + /// The end date of the product + /// term, or the end date of the month in which usage ended. + /// The pre-tax charged amount for the + /// transaction. + /// The tax amount applied to the + /// transaction. + /// The unit of measure used to bill for + /// the product. For example, compute services are billed per + /// hour. + /// The number of units used for a given + /// product. + /// The description for the unit of measure for + /// a given product. + public Transaction(string id = default(string), string name = default(string), string type = default(string), string kind = default(string), System.DateTime? date = default(System.DateTime?), string invoice = default(string), string invoiceId = default(string), string orderId = default(string), string orderName = default(string), string productFamily = default(string), string productTypeId = default(string), string productType = default(string), string productDescription = default(string), string transactionType = default(string), Amount transactionAmount = default(Amount), int? quantity = default(int?), string invoiceSectionId = default(string), string invoiceSectionDisplayName = default(string), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string customerId = default(string), string customerDisplayName = default(string), string subscriptionId = default(string), string subscriptionName = default(string), string azurePlan = default(string), Amount azureCreditApplied = default(Amount), string billingCurrency = default(string), double? discount = default(double?), Amount effectivePrice = default(Amount), double? exchangeRate = default(double?), Amount marketPrice = default(Amount), string pricingCurrency = default(string), System.DateTime? servicePeriodStartDate = default(System.DateTime?), System.DateTime? servicePeriodEndDate = default(System.DateTime?), Amount subTotal = default(Amount), Amount tax = default(Amount), string unitOfMeasure = default(string), double? units = default(double?), string unitType = default(string)) : base(id, name, type) { Kind = kind; Date = date; Invoice = invoice; + InvoiceId = invoiceId; OrderId = orderId; OrderName = orderName; ProductFamily = productFamily; @@ -88,6 +137,21 @@ public Transaction() CustomerDisplayName = customerDisplayName; SubscriptionId = subscriptionId; SubscriptionName = subscriptionName; + AzurePlan = azurePlan; + AzureCreditApplied = azureCreditApplied; + BillingCurrency = billingCurrency; + Discount = discount; + EffectivePrice = effectivePrice; + ExchangeRate = exchangeRate; + MarketPrice = marketPrice; + PricingCurrency = pricingCurrency; + ServicePeriodStartDate = servicePeriodStartDate; + ServicePeriodEndDate = servicePeriodEndDate; + SubTotal = subTotal; + Tax = tax; + UnitOfMeasure = unitOfMeasure; + Units = units; + UnitType = unitType; CustomInit(); } @@ -97,126 +161,248 @@ public Transaction() partial void CustomInit(); /// - /// Gets or sets the kind of transaction. Choices are all and + /// Gets or sets the kind of transaction. Options are all or /// reservation. Possible values include: 'all', 'reservation' /// [JsonProperty(PropertyName = "properties.kind")] public string Kind { get; set; } /// - /// Gets the date of reservation transaction. + /// Gets the date of transaction. /// [JsonProperty(PropertyName = "properties.date")] public System.DateTime? Date { get; private set; } /// - /// Gets invoice number or 'pending' if not invoiced. + /// Gets invoice on which the transaction was billed or 'pending' if + /// the transaction is not billed. /// [JsonProperty(PropertyName = "properties.invoice")] public string Invoice { get; private set; } /// - /// Gets the reservation order id. + /// Gets the ID of the invoice on which the transaction was billed. + /// This field is only applicable for transactions which are billed. + /// + [JsonProperty(PropertyName = "properties.invoiceId")] + public string InvoiceId { get; private set; } + + /// + /// Gets the order ID of the reservation. The field is only applicable + /// for transaction of kind reservation. /// [JsonProperty(PropertyName = "properties.orderId")] public string OrderId { get; private set; } /// - /// Gets the reservation order name. + /// Gets the name of the reservation order. The field is only + /// applicable for transactions of kind reservation. /// [JsonProperty(PropertyName = "properties.orderName")] public string OrderName { get; private set; } /// - /// Gets the product family. + /// Gets the family of the product for which the transaction took + /// place. /// [JsonProperty(PropertyName = "properties.productFamily")] public string ProductFamily { get; private set; } /// - /// Gets the product type id. + /// Gets the ID of the product type for which the transaction took + /// place. /// [JsonProperty(PropertyName = "properties.productTypeId")] public string ProductTypeId { get; private set; } /// - /// Gets the type of product. + /// Gets the type of the product for which the transaction took place. /// [JsonProperty(PropertyName = "properties.productType")] public string ProductType { get; private set; } /// - /// Gets product description. + /// Gets the description of the product for which the transaction took + /// place. /// [JsonProperty(PropertyName = "properties.productDescription")] public string ProductDescription { get; private set; } /// - /// Gets or sets transaction types. Possible values include: + /// Gets or sets the type of transaction. Possible values include: /// 'Purchase', 'Usage Charge' /// [JsonProperty(PropertyName = "properties.transactionType")] public string TransactionType { get; set; } /// - /// Gets last charge associated with the purchase. + /// Gets the charge associated with the transaction. /// [JsonProperty(PropertyName = "properties.transactionAmount")] public Amount TransactionAmount { get; private set; } /// - /// Gets purchase quantity. + /// Gets the quantity purchased in the transaction. /// [JsonProperty(PropertyName = "properties.quantity")] public int? Quantity { get; private set; } /// - /// Gets invoice section id to which this product belongs. + /// Gets the ID of the invoice section which will be billed for the + /// transaction. /// [JsonProperty(PropertyName = "properties.invoiceSectionId")] public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section display name to which this product belongs. + /// Gets the name of the invoice section which will be billed for the + /// transaction. /// [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] public string InvoiceSectionDisplayName { get; private set; } /// - /// Gets billing Profile id to which this product belongs. + /// Gets the ID of the billing profile which will be billed for the + /// transaction. /// [JsonProperty(PropertyName = "properties.billingProfileId")] public string BillingProfileId { get; private set; } /// - /// Gets billing Profile display name to which this product belongs. + /// Gets the name of the billing profile which will be billed for the + /// transaction. /// [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] public string BillingProfileDisplayName { get; private set; } /// - /// Gets customer id to which this product belongs. + /// Gets the ID of the customer for which the transaction took place. + /// The field is applicable only for Microsoft Partner Agreement + /// billing account. /// [JsonProperty(PropertyName = "properties.customerId")] public string CustomerId { get; private set; } /// - /// Gets display name of customer to which this product belongs. + /// Gets the name of the customer for which the transaction took place. + /// The field is applicable only for Microsoft Partner Agreement + /// billing account. /// [JsonProperty(PropertyName = "properties.customerDisplayName")] public string CustomerDisplayName { get; private set; } /// - /// Gets the subscription id. + /// Gets the ID of the subscription that was used for the transaction. + /// The field is only applicable for transaction of kind reservation. /// [JsonProperty(PropertyName = "properties.subscriptionId")] public string SubscriptionId { get; private set; } /// - /// Gets the subscription name. + /// Gets the name of the subscription that was used for the + /// transaction. The field is only applicable for transaction of kind + /// reservation. /// [JsonProperty(PropertyName = "properties.subscriptionName")] public string SubscriptionName { get; private set; } + /// + /// Gets the type of azure plan of the subscription that was used for + /// the transaction. + /// + [JsonProperty(PropertyName = "properties.azurePlan")] + public string AzurePlan { get; private set; } + + /// + /// Gets the amount of any Azure credits automatically applied to this + /// transaction. + /// + [JsonProperty(PropertyName = "properties.azureCreditApplied")] + public Amount AzureCreditApplied { get; private set; } + + /// + /// Gets the ISO 4217 code for the currency in which this transaction + /// is billed. + /// + [JsonProperty(PropertyName = "properties.billingCurrency")] + public string BillingCurrency { get; private set; } + + /// + /// Gets the percentage discount, if any, applied to this transaction. + /// + [JsonProperty(PropertyName = "properties.discount")] + public double? Discount { get; private set; } + + /// + /// Gets the price of the product after applying any discounts. + /// + [JsonProperty(PropertyName = "properties.effectivePrice")] + public Amount EffectivePrice { get; private set; } + + /// + /// Gets the exchange rate used to convert charged amount to billing + /// currency, if applicable. + /// + [JsonProperty(PropertyName = "properties.exchangeRate")] + public double? ExchangeRate { get; private set; } + + /// + /// Gets the retail price of the product. + /// + [JsonProperty(PropertyName = "properties.marketPrice")] + public Amount MarketPrice { get; private set; } + + /// + /// Gets the ISO 4217 code for the currency in which the product is + /// priced. + /// + [JsonProperty(PropertyName = "properties.pricingCurrency")] + public string PricingCurrency { get; private set; } + + /// + /// Gets the date of the purchase of the product, or the start date of + /// the month in which usage started. + /// + [JsonProperty(PropertyName = "properties.servicePeriodStartDate")] + public System.DateTime? ServicePeriodStartDate { get; private set; } + + /// + /// Gets the end date of the product term, or the end date of the month + /// in which usage ended. + /// + [JsonProperty(PropertyName = "properties.servicePeriodEndDate")] + public System.DateTime? ServicePeriodEndDate { get; private set; } + + /// + /// Gets the pre-tax charged amount for the transaction. + /// + [JsonProperty(PropertyName = "properties.subTotal")] + public Amount SubTotal { get; private set; } + + /// + /// Gets the tax amount applied to the transaction. + /// + [JsonProperty(PropertyName = "properties.tax")] + public Amount Tax { get; private set; } + + /// + /// Gets the unit of measure used to bill for the product. For example, + /// compute services are billed per hour. + /// + [JsonProperty(PropertyName = "properties.unitOfMeasure")] + public string UnitOfMeasure { get; private set; } + + /// + /// Gets the number of units used for a given product. + /// + [JsonProperty(PropertyName = "properties.units")] + public double? Units { get; private set; } + + /// + /// Gets the description for the unit of measure for a given product. + /// + [JsonProperty(PropertyName = "properties.unitType")] + public string UnitType { get; private set; } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs deleted file mode 100644 index b38f7aa05616f..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of listing reservation transactions. - /// - public partial class TransactionListResult - { - /// - /// Initializes a new instance of the TransactionListResult class. - /// - public TransactionListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TransactionListResult class. - /// - /// The list of reservation transactions. - /// The link (url) to the next page of - /// results. - public TransactionListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of reservation transactions. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - /// - /// Gets the link (url) to the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs deleted file mode 100644 index caee5a03f3323..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Request parameters to transfer billing subscription. - /// - [Rest.Serialization.JsonTransformation] - public partial class TransferBillingSubscriptionRequest - { - /// - /// Initializes a new instance of the - /// TransferBillingSubscriptionRequest class. - /// - public TransferBillingSubscriptionRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// TransferBillingSubscriptionRequest class. - /// - /// The destination invoice - /// section id. - /// The destination billing - /// profile id. - public TransferBillingSubscriptionRequest(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) - { - DestinationInvoiceSectionId = destinationInvoiceSectionId; - DestinationBillingProfileId = destinationBillingProfileId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the destination invoice section id. - /// - [JsonProperty(PropertyName = "properties.destinationInvoiceSectionId")] - public string DestinationInvoiceSectionId { get; set; } - - /// - /// Gets or sets the destination billing profile id. - /// - [JsonProperty(PropertyName = "properties.destinationBillingProfileId")] - public string DestinationBillingProfileId { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs index c441d309ce65a..58ad2fc19b6b9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.Billing.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -33,12 +34,9 @@ public TransferBillingSubscriptionRequestProperties() /// /// The destination invoice /// section id. - /// The destination billing - /// profile id. - public TransferBillingSubscriptionRequestProperties(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) + public TransferBillingSubscriptionRequestProperties(string destinationInvoiceSectionId) { DestinationInvoiceSectionId = destinationInvoiceSectionId; - DestinationBillingProfileId = destinationBillingProfileId; CustomInit(); } @@ -54,10 +52,17 @@ public TransferBillingSubscriptionRequestProperties() public string DestinationInvoiceSectionId { get; set; } /// - /// Gets or sets the destination billing profile id. + /// Validate the object. /// - [JsonProperty(PropertyName = "destinationBillingProfileId")] - public string DestinationBillingProfileId { get; set; } - + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DestinationInvoiceSectionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DestinationInvoiceSectionId"); + } + } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionResult.cs deleted file mode 100644 index fb1f3255f86fe..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionResult.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Request parameters to transfer billing subscription. - /// - [Rest.Serialization.JsonTransformation] - public partial class TransferBillingSubscriptionResult - { - /// - /// Initializes a new instance of the TransferBillingSubscriptionResult - /// class. - /// - public TransferBillingSubscriptionResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TransferBillingSubscriptionResult - /// class. - /// - /// The destination billing - /// subscription id. - public TransferBillingSubscriptionResult(string billingSubscriptionName = default(string)) - { - BillingSubscriptionName = billingSubscriptionName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the destination billing subscription id. - /// - [JsonProperty(PropertyName = "properties.billingSubscriptionName")] - public string BillingSubscriptionName { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs deleted file mode 100644 index 293d805691c8d..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs +++ /dev/null @@ -1,170 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Details of the transfer. - /// - [Rest.Serialization.JsonTransformation] - public partial class TransferDetails - { - /// - /// Initializes a new instance of the TransferDetails class. - /// - public TransferDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TransferDetails class. - /// - /// Transfer creation time. - /// Transfer expiration time. - /// Target invoice section Id. - /// Target billing account Id. - /// Reseller Id for transfer. - /// Reseller name for transfer. - /// Customer type of the - /// initiator. - /// Target billing profile Id. - /// Overall transfer status. Possible - /// values include: 'Pending', 'InProgress', 'Completed', - /// 'CompletedWithErrors', 'Failed', 'Canceled', 'Declined' - /// Email Id of recipient of - /// transfer. - /// Email Id of initiator of - /// transfer. - /// Email Id who user canceled the - /// transfer. - /// Transfer last modification - /// time. - /// Detailed transfer - /// status. - public TransferDetails(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expirationTime = default(System.DateTime?), string invoiceSectionId = default(string), string billingAccountId = default(string), string resellerId = default(string), string resellerName = default(string), string initiatorCustomerType = default(string), string billingProfileId = default(string), string transferStatus = default(string), string recipientEmailId = default(string), string initiatorEmailId = default(string), string canceledBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IList detailedTransferStatus = default(IList)) - { - CreationTime = creationTime; - ExpirationTime = expirationTime; - InvoiceSectionId = invoiceSectionId; - BillingAccountId = billingAccountId; - ResellerId = resellerId; - ResellerName = resellerName; - InitiatorCustomerType = initiatorCustomerType; - BillingProfileId = billingProfileId; - TransferStatus = transferStatus; - RecipientEmailId = recipientEmailId; - InitiatorEmailId = initiatorEmailId; - CanceledBy = canceledBy; - LastModifiedTime = lastModifiedTime; - DetailedTransferStatus = detailedTransferStatus; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets transfer creation time. - /// - [JsonProperty(PropertyName = "properties.creationTime")] - public System.DateTime? CreationTime { get; private set; } - - /// - /// Gets transfer expiration time. - /// - [JsonProperty(PropertyName = "properties.expirationTime")] - public System.DateTime? ExpirationTime { get; private set; } - - /// - /// Gets target invoice section Id. - /// - [JsonProperty(PropertyName = "properties.invoiceSectionId")] - public string InvoiceSectionId { get; private set; } - - /// - /// Gets target billing account Id. - /// - [JsonProperty(PropertyName = "properties.billingAccountId")] - public string BillingAccountId { get; private set; } - - /// - /// Gets reseller Id for transfer. - /// - [JsonProperty(PropertyName = "properties.resellerId")] - public string ResellerId { get; private set; } - - /// - /// Gets reseller name for transfer. - /// - [JsonProperty(PropertyName = "properties.resellerName")] - public string ResellerName { get; private set; } - - /// - /// Gets customer type of the initiator. - /// - [JsonProperty(PropertyName = "properties.initiatorCustomerType")] - public string InitiatorCustomerType { get; private set; } - - /// - /// Gets target billing profile Id. - /// - [JsonProperty(PropertyName = "properties.billingProfileId")] - public string BillingProfileId { get; private set; } - - /// - /// Gets overall transfer status. Possible values include: 'Pending', - /// 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', - /// 'Canceled', 'Declined' - /// - [JsonProperty(PropertyName = "properties.transferStatus")] - public string TransferStatus { get; private set; } - - /// - /// Gets email Id of recipient of transfer. - /// - [JsonProperty(PropertyName = "properties.recipientEmailId")] - public string RecipientEmailId { get; private set; } - - /// - /// Gets email Id of initiator of transfer. - /// - [JsonProperty(PropertyName = "properties.initiatorEmailId")] - public string InitiatorEmailId { get; private set; } - - /// - /// Gets email Id who user canceled the transfer. - /// - [JsonProperty(PropertyName = "properties.canceledBy")] - public string CanceledBy { get; private set; } - - /// - /// Gets transfer last modification time. - /// - [JsonProperty(PropertyName = "properties.lastModifiedTime")] - public System.DateTime? LastModifiedTime { get; private set; } - - /// - /// Gets detailed transfer status. - /// - [JsonProperty(PropertyName = "properties.detailedTransferStatus")] - public IList DetailedTransferStatus { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferProductRequestProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferProductRequestProperties.cs index 76f21e33a9eb6..f8ce7edb5219d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferProductRequestProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferProductRequestProperties.cs @@ -33,12 +33,9 @@ public TransferProductRequestProperties() /// /// The destination invoice /// section id. - /// The destination billing - /// profile id. - public TransferProductRequestProperties(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) + public TransferProductRequestProperties(string destinationInvoiceSectionId = default(string)) { DestinationInvoiceSectionId = destinationInvoiceSectionId; - DestinationBillingProfileId = destinationBillingProfileId; CustomInit(); } @@ -53,11 +50,5 @@ public TransferProductRequestProperties() [JsonProperty(PropertyName = "destinationInvoiceSectionId")] public string DestinationInvoiceSectionId { get; set; } - /// - /// Gets or sets the destination billing profile id. - /// - [JsonProperty(PropertyName = "destinationBillingProfileId")] - public string DestinationBillingProfileId { get; set; } - } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferStatus.cs deleted file mode 100644 index 922c838a72440..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferStatus.cs +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - - /// - /// Defines values for TransferStatus. - /// - public static class TransferStatus - { - public const string Pending = "Pending"; - public const string InProgress = "InProgress"; - public const string Completed = "Completed"; - public const string CompletedWithErrors = "CompletedWithErrors"; - public const string Failed = "Failed"; - public const string Canceled = "Canceled"; - public const string Declined = "Declined"; - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs deleted file mode 100644 index d30e817542b05..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Summary of cancel product operation - /// - [Rest.Serialization.JsonTransformation] - public partial class UpdateAutoRenewOperation - { - /// - /// Initializes a new instance of the UpdateAutoRenewOperation class. - /// - public UpdateAutoRenewOperation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UpdateAutoRenewOperation class. - /// - /// The end date of this asset - public UpdateAutoRenewOperation(System.DateTime? endDate = default(System.DateTime?)) - { - EndDate = endDate; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the end date of this asset - /// - [JsonProperty(PropertyName = "properties.endDate")] - public System.DateTime? EndDate { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewRequest.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewRequest.cs deleted file mode 100644 index 40e406b512007..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewRequest.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Request parameters to update auto renew for support product. - /// - public partial class UpdateAutoRenewRequest - { - /// - /// Initializes a new instance of the UpdateAutoRenewRequest class. - /// - public UpdateAutoRenewRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UpdateAutoRenewRequest class. - /// - /// Request parameters to update auto renew - /// policy a product. Possible values include: 'true', 'false' - public UpdateAutoRenewRequest(string autoRenew = default(string)) - { - AutoRenew = autoRenew; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets request parameters to update auto renew policy a - /// product. Possible values include: 'true', 'false' - /// - [JsonProperty(PropertyName = "autoRenew")] - public string AutoRenew { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateAddressResponse.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateAddressResponse.cs index 076c6728e33de..f3ec2bbcb8462 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateAddressResponse.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateAddressResponse.cs @@ -33,7 +33,7 @@ public ValidateAddressResponse() /// /// status of the address validation. Possible /// values include: 'Valid', 'Invalid' - /// list of suggested + /// The list of suggested /// addresses. /// Validation error message. public ValidateAddressResponse(string status = default(string), IList suggestedAddresses = default(IList), string validationMessage = default(string)) @@ -57,7 +57,7 @@ public ValidateAddressResponse() public string Status { get; set; } /// - /// Gets or sets list of suggested addresses. + /// Gets or sets the list of suggested addresses. /// [JsonProperty(PropertyName = "suggestedAddresses")] public IList SuggestedAddresses { get; set; } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs index 20546dd70c0fe..ff0c8119304e4 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs @@ -31,12 +31,12 @@ public ValidateProductTransferEligibilityResult() /// Initializes a new instance of the /// ValidateProductTransferEligibilityResult class. /// - /// Specifies whether the transfer is + /// Specifies whether the transfer is /// eligible or not. /// Validation error details. - public ValidateProductTransferEligibilityResult(bool? isTransferEligible = default(bool?), ValidateProductTransferEligibilityError errorDetails = default(ValidateProductTransferEligibilityError)) + public ValidateProductTransferEligibilityResult(bool? isMoveEligible = default(bool?), ValidateProductTransferEligibilityError errorDetails = default(ValidateProductTransferEligibilityError)) { - IsTransferEligible = isTransferEligible; + IsMoveEligible = isMoveEligible; ErrorDetails = errorDetails; CustomInit(); } @@ -49,8 +49,8 @@ public ValidateProductTransferEligibilityResult() /// /// Gets specifies whether the transfer is eligible or not. /// - [JsonProperty(PropertyName = "isTransferEligible")] - public bool? IsTransferEligible { get; private set; } + [JsonProperty(PropertyName = "isMoveEligible")] + public bool? IsMoveEligible { get; private set; } /// /// Gets or sets validation error details. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs index d467475793bac..e8fb98e410444 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs @@ -31,12 +31,12 @@ public ValidateSubscriptionTransferEligibilityResult() /// Initializes a new instance of the /// ValidateSubscriptionTransferEligibilityResult class. /// - /// Specifies whether the transfer is - /// eligible or not. + /// Specifies whether the subscription is + /// eligible to be transferred. /// Validation error details. - public ValidateSubscriptionTransferEligibilityResult(bool? isTransferEligible = default(bool?), ValidateSubscriptionTransferEligibilityError errorDetails = default(ValidateSubscriptionTransferEligibilityError)) + public ValidateSubscriptionTransferEligibilityResult(bool? isMoveEligible = default(bool?), ValidateSubscriptionTransferEligibilityError errorDetails = default(ValidateSubscriptionTransferEligibilityError)) { - IsTransferEligible = isTransferEligible; + IsMoveEligible = isMoveEligible; ErrorDetails = errorDetails; CustomInit(); } @@ -47,10 +47,11 @@ public ValidateSubscriptionTransferEligibilityResult() partial void CustomInit(); /// - /// Gets specifies whether the transfer is eligible or not. + /// Gets specifies whether the subscription is eligible to be + /// transferred. /// - [JsonProperty(PropertyName = "isTransferEligible")] - public bool? IsTransferEligible { get; private set; } + [JsonProperty(PropertyName = "isMoveEligible")] + public bool? IsMoveEligible { get; private set; } /// /// Gets or sets validation error details. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs deleted file mode 100644 index 3315764c903f1..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Result of transfer validation. - /// - public partial class ValidateTransferListResponse - { - /// - /// Initializes a new instance of the ValidateTransferListResponse - /// class. - /// - public ValidateTransferListResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ValidateTransferListResponse - /// class. - /// - /// The list of transfer validation - /// results. - public ValidateTransferListResponse(IList value = default(IList)) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of transfer validation results. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.cs deleted file mode 100644 index e5ff705c05b19..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Transfer validation response. - /// - [Rest.Serialization.JsonTransformation] - public partial class ValidateTransferResponse - { - /// - /// Initializes a new instance of the ValidateTransferResponse class. - /// - public ValidateTransferResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ValidateTransferResponse class. - /// - /// The status of validation - /// The product id for which this result - /// applies. - /// Array of validation results. - public ValidateTransferResponse(string status = default(string), string productId = default(string), IList results = default(IList)) - { - Status = status; - ProductId = productId; - Results = results; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the status of validation - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; private set; } - - /// - /// Gets the product id for which this result applies. - /// - [JsonProperty(PropertyName = "properties.productId")] - public string ProductId { get; private set; } - - /// - /// Gets or sets array of validation results. - /// - [JsonProperty(PropertyName = "properties.results")] - public IList Results { get; set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.cs deleted file mode 100644 index 5f59a5f39c399..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The properties of the validation result. - /// - public partial class ValidationResultProperties - { - /// - /// Initializes a new instance of the ValidationResultProperties class. - /// - public ValidationResultProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ValidationResultProperties class. - /// - /// Result Level. - /// Result Code. - /// The validation message. - public ValidationResultProperties(string level = default(string), string code = default(string), string message = default(string)) - { - Level = level; - Code = code; - Message = message; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets result Level. - /// - [JsonProperty(PropertyName = "level")] - public string Level { get; private set; } - - /// - /// Gets result Code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets the validation message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Operations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Operations.cs index 45722dc878eb1..7507aedc34766 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Operations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Operations.cs @@ -51,7 +51,8 @@ internal Operations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists all of the available billing REST API operations. + /// Lists the available billing REST API operations. + /// /// /// /// Headers that will be added to request. @@ -219,7 +220,8 @@ internal Operations(BillingManagementClient client) } /// - /// Lists all of the available billing REST API operations. + /// Lists the available billing REST API operations. + /// /// /// /// The NextLink from the previous successful call to List operation. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/OperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/OperationsExtensions.cs index b9095e5290b64..e34702e764991 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/OperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/OperationsExtensions.cs @@ -22,7 +22,8 @@ namespace Microsoft.Azure.Management.Billing public static partial class OperationsExtensions { /// - /// Lists all of the available billing REST API operations. + /// Lists the available billing REST API operations. + /// /// /// /// The operations group for this extension method. @@ -33,7 +34,8 @@ public static IPage List(this IOperations operations) } /// - /// Lists all of the available billing REST API operations. + /// Lists the available billing REST API operations. + /// /// /// /// The operations group for this extension method. @@ -50,7 +52,8 @@ public static IPage List(this IOperations operations) } /// - /// Lists all of the available billing REST API operations. + /// Lists the available billing REST API operations. + /// /// /// /// The operations group for this extension method. @@ -64,7 +67,8 @@ public static IPage ListNext(this IOperations operations, string next } /// - /// Lists all of the available billing REST API operations. + /// Lists the available billing REST API operations. + /// /// /// /// The operations group for this extension method. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs deleted file mode 100644 index 8f13960e5ac32..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs +++ /dev/null @@ -1,175 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for PaymentMethodsOperations. - /// - public static partial class PaymentMethodsOperationsExtensions - { - /// - /// Lists the Payment Methods by billing account Id. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - public static IPage ListByBillingAccount(this IPaymentMethodsOperations operations, string billingAccountName) - { - return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); - } - - /// - /// Lists the Payment Methods by billing account Id. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByBillingAccountAsync(this IPaymentMethodsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the Payment Methods by billing profile Id. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - public static IPage ListByBillingProfile(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName) - { - return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); - } - - /// - /// Lists the Payment Methods by billing profile Id. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByBillingProfileAsync(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the Payment Methods by billing account Id. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByBillingAccountNext(this IPaymentMethodsOperations operations, string nextPageLink) - { - return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists the Payment Methods by billing account Id. - /// - /// - /// - /// 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 IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the Payment Methods by billing profile Id. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByBillingProfileNext(this IPaymentMethodsOperations operations, string nextPageLink) - { - return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists the Payment Methods by billing profile Id. - /// - /// - /// - /// 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 IPaymentMethodsOperations 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/PoliciesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs index be77473861973..c4a27e1102a32 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs @@ -51,14 +51,15 @@ internal PoliciesOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// The policy for a given billing account name and billing profile name. + /// Lists the policies for a billing profile. This 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. @@ -238,16 +239,17 @@ internal PoliciesOperations(BillingManagementClient client) } /// - /// The operation to update a policy. + /// Updates the policies for a billing profile. This 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. /// /// - /// Parameters supplied to the update policy operation. + /// Request parameters that are provided to the update policies operation. /// /// /// Headers that will be added to request. @@ -438,14 +440,15 @@ internal PoliciesOperations(BillingManagementClient client) } /// - /// The policy for a given billing account name and customer name. + /// Lists the policies for a customer. This operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. /// /// /// - /// 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. @@ -625,16 +628,17 @@ internal PoliciesOperations(BillingManagementClient client) } /// - /// The operation to update a Customer policy. + /// Updates the policies for a customer. This operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. + /// The ID that uniquely identifies a customer. /// /// - /// Parameters supplied to the update customer policy operation. + /// Request parameters that are provided to the update policies operation. /// /// /// Headers that will be added to request. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs index 05364c6b933fd..bad12c0bcf9a0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs @@ -22,17 +22,18 @@ namespace Microsoft.Azure.Management.Billing public static partial class PoliciesOperationsExtensions { /// - /// The policy for a given billing account name and billing profile name. + /// Lists the policies for a billing profile. This 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 Policy GetByBillingProfile(this IPoliciesOperations operations, string billingAccountName, string billingProfileName) { @@ -40,17 +41,18 @@ public static Policy GetByBillingProfile(this IPoliciesOperations operations, st } /// - /// The policy for a given billing account name and billing profile name. + /// Lists the policies for a billing profile. This 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. @@ -64,19 +66,20 @@ public static Policy GetByBillingProfile(this IPoliciesOperations operations, st } /// - /// The operation to update a policy. + /// Updates the policies for a billing profile. This 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. /// /// - /// Parameters supplied to the update policy operation. + /// Request parameters that are provided to the update policies operation. /// public static Policy Update(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, Policy parameters) { @@ -84,19 +87,20 @@ public static Policy Update(this IPoliciesOperations operations, string billingA } /// - /// The operation to update a policy. + /// Updates the policies for a billing profile. This 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. /// /// - /// Parameters supplied to the update policy operation. + /// Request parameters that are provided to the update policies operation. /// /// /// The cancellation token. @@ -110,17 +114,18 @@ public static Policy Update(this IPoliciesOperations operations, string billingA } /// - /// The policy for a given billing account name and customer name. + /// Lists the policies for a customer. This operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. /// /// /// /// 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 CustomerPolicy GetByCustomer(this IPoliciesOperations operations, string billingAccountName, string customerName) { @@ -128,17 +133,18 @@ public static CustomerPolicy GetByCustomer(this IPoliciesOperations operations, } /// - /// The policy for a given billing account name and customer name. + /// Lists the policies for a customer. This operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. /// /// /// /// 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. @@ -152,19 +158,20 @@ public static CustomerPolicy GetByCustomer(this IPoliciesOperations operations, } /// - /// The operation to update a Customer policy. + /// Updates the policies for a customer. This operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. /// /// /// 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. /// /// - /// Parameters supplied to the update customer policy operation. + /// Request parameters that are provided to the update policies operation. /// public static CustomerPolicy UpdateCustomer(this IPoliciesOperations operations, string billingAccountName, string customerName, CustomerPolicy parameters) { @@ -172,19 +179,20 @@ public static CustomerPolicy UpdateCustomer(this IPoliciesOperations operations, } /// - /// The operation to update a Customer policy. + /// Updates the policies for a customer. This operation is supported only for + /// billing accounts with agreement type Microsoft Partner Agreement. /// /// /// 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. /// /// - /// Parameters supplied to the update customer policy operation. + /// Request parameters that are provided to the update policies operation. /// /// /// The cancellation token. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs deleted file mode 100644 index 73c97053b8c61..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs +++ /dev/null @@ -1,508 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// PriceSheetOperations operations. - /// - internal partial class PriceSheetOperations : IServiceOperations, IPriceSheetOperations - { - /// - /// Initializes a new instance of the PriceSheetOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal PriceSheetOperations(BillingManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the BillingManagementClient - /// - public BillingManagementClient Client { get; private set; } - - /// - /// Download price sheet for an invoice. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Invoice Id. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> DownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDownloadWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Download price sheet for a billing profile. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> DownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDownloadByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Download price sheet for an invoice. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Invoice Id. - /// - /// - /// 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> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, 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 (invoiceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceName"); - } - // 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("invoiceName", invoiceName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDownload", 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}/invoices/{invoiceName}/pricesheet/default/download").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); - _url = _url.Replace("{invoiceName}", System.Uri.EscapeDataString(invoiceName)); - 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("POST"); - _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 && (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; - } - - /// - /// Download price sheet for a billing profile. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// 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> BeginDownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, 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"); - } - // 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDownloadByBillingProfile", 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}/pricesheet/default/download").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("POST"); - _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 && (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; - } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs deleted file mode 100644 index a1be5f407ad0e..0000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs +++ /dev/null @@ -1,197 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Billing -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for PriceSheetOperations. - /// - public static partial class PriceSheetOperationsExtensions - { - /// - /// Download price sheet for an invoice. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Invoice Id. - /// - public static DownloadUrl Download(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName) - { - return operations.DownloadAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); - } - - /// - /// Download price sheet for an invoice. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Invoice Id. - /// - /// - /// The cancellation token. - /// - public static async Task DownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DownloadWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Download price sheet for a billing profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - public static DownloadUrl DownloadByBillingProfile(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName) - { - return operations.DownloadByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); - } - - /// - /// Download price sheet for a billing profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// The cancellation token. - /// - public static async Task DownloadByBillingProfileAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DownloadByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Download price sheet for an invoice. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Invoice Id. - /// - public static DownloadUrl BeginDownload(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName) - { - return operations.BeginDownloadAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); - } - - /// - /// Download price sheet for an invoice. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Invoice Id. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDownloadWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Download price sheet for a billing profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - public static DownloadUrl BeginDownloadByBillingProfile(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName) - { - return operations.BeginDownloadByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); - } - - /// - /// Download price sheet for a billing profile. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDownloadByBillingProfileAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDownloadByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs index 7ad32db0d2a88..f172b07bacbaa 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs @@ -51,20 +51,16 @@ internal ProductsOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists products by customer id. + /// Lists the products for a customer. These don't include products billed + /// based on usage.The operation is supported only for billing accounts with + /// agreement type Microsoft Partner Agreement. /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. - /// - /// - /// May be used to filter by product type. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). + /// The ID that uniquely identifies a customer. /// /// /// Headers that will be added to request. @@ -87,7 +83,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -110,7 +106,6 @@ internal ProductsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("customerName", customerName); - tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByCustomer", tracingParameters); } @@ -124,10 +119,6 @@ internal ProductsOperations(BillingManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -216,7 +207,7 @@ internal ProductsOperations(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")) @@ -229,7 +220,7 @@ internal ProductsOperations(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) { @@ -249,17 +240,19 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// Get a customer's product by name. + /// Lists the products for a billing account. These don't include products + /// billed based on usage. 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. /// - /// - /// Customer name. - /// - /// - /// Invoice Id. + /// + /// May be used to filter by product type. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value are + /// separated by a colon (:). /// /// /// Headers that will be added to request. @@ -282,20 +275,12 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (customerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); - } - if (productName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "productName"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -308,22 +293,23 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("customerName", customerName); - tracingParameters.Add("productName", productName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByCustomer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products/{productName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); - _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -412,7 +398,7 @@ internal ProductsOperations(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")) @@ -425,7 +411,7 @@ internal ProductsOperations(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) { @@ -445,16 +431,21 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// Lists products by billing account name. + /// Lists the products for a billing profile. These don't include products + /// billed based on usage. 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. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// May be used to filter by product type. The filter supports 'eq', 'lt', /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is + /// 'not'. Tag filter is a key value pair string where key and value are /// separated by a colon (:). /// /// @@ -478,12 +469,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -496,14 +491,16 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", 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}/products").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/products").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) { @@ -634,22 +631,24 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// Lists products by invoice section name. + /// Lists the products for an invoice section. These don't include products + /// billed based on usage. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// May be used to filter by product type. The filter supports 'eq', 'lt', /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is + /// 'not'. Tag filter is a key value pair string where key and value are /// separated by a colon (:). /// /// @@ -673,7 +672,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -808,7 +807,7 @@ internal ProductsOperations(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")) @@ -821,7 +820,7 @@ internal ProductsOperations(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) { @@ -841,20 +840,15 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// Get a single product by name. + /// Gets a product by ID. The operation is supported only for billing accounts + /// with agreement type Microsoft Customer Agreement. /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// /// Headers that will be added to request. @@ -877,20 +871,12 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { 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 (productName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "productName"); @@ -907,18 +893,14 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("productName", productName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", 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}/products/{productName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}").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)); _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1046,22 +1028,18 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// The operation to transfer a Product to another invoice section. + /// Updates the properties of a Product. Currently, auto renew can be updated. + /// The operation is supported only for billing accounts with agreement type + /// Microsoft Customer Agreement. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// - /// Parameters supplied to the Transfer Product operation. + /// Request parameters that are provided to the update product operation. /// /// /// Headers that will be added to request. @@ -1084,20 +1062,12 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string billingAccountName, string productName, Product parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { 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 (productName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "productName"); @@ -1118,19 +1088,15 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("productName", productName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Transfer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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}/products/{productName}/transfer").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}").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)); _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1144,7 +1110,7 @@ internal ProductsOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1201,7 +1167,7 @@ internal ProductsOperations(BillingManagementClient client) 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 @@ -1231,7 +1197,7 @@ internal ProductsOperations(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")) @@ -1256,19 +1222,6 @@ internal ProductsOperations(BillingManagementClient client) 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); @@ -1277,22 +1230,21 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// Validates the transfer of products across invoice sections. + /// Moves a product's charges to a new invoice section. The new invoice section + /// must belong to the same billing profile as the existing invoice section. + /// This operation is supported only for products that are purchased with a + /// recurring charge and for billing accounts with agreement type Microsoft + /// Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// - /// Parameters supplied to the Transfer Products operation. + /// Request parameters that are provided to the move product operation. /// /// /// Headers that will be added to request. @@ -1315,24 +1267,20 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> MoveWithHttpMessagesAsync(string billingAccountName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { 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 (productName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "productName"); } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); @@ -1345,21 +1293,21 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("productName", productName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ValidateTransfer", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Move", 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}/products/{productName}/validateTransferEligibility").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/move").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)); _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); 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); @@ -1424,7 +1372,7 @@ internal ProductsOperations(BillingManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1454,7 +1402,7 @@ internal ProductsOperations(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")) @@ -1467,7 +1415,7 @@ internal ProductsOperations(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) { @@ -1479,6 +1427,19 @@ internal ProductsOperations(BillingManagementClient client) 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); @@ -1487,22 +1448,21 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// Cancel auto renew for product by product id and invoice section name + /// Validates if a product's charges can be moved to a new invoice section. + /// This operation is supported only for products that are purchased with a + /// recurring charge and for billing accounts with agreement type Microsoft + /// Customer Agreement. + /// /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// - /// - /// Update auto renew request parameters. + /// + /// Request parameters that are provided to the validate move eligibility + /// operation. /// /// /// Headers that will be added to request. @@ -1525,20 +1485,12 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ValidateMoveWithHttpMessagesAsync(string billingAccountName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { 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 (productName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "productName"); @@ -1547,9 +1499,9 @@ internal ProductsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (body == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1559,19 +1511,15 @@ internal ProductsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("productName", productName); - tracingParameters.Add("body", body); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAutoRenewByInvoiceSection", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ValidateMove", 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}/products/{productName}/updateAutoRenew").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/validateMoveEligibility").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)); _url = _url.Replace("{productName}", System.Uri.EscapeDataString(productName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1616,9 +1564,9 @@ internal ProductsOperations(BillingManagementClient client) // Serialize Request string _requestContent = null; - if(body != null) + if(parameters != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _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"); } @@ -1672,7 +1620,7 @@ internal ProductsOperations(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")) @@ -1685,7 +1633,7 @@ internal ProductsOperations(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) { @@ -1705,7 +1653,9 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// Lists products by billing account name. + /// Lists the products for a customer. These don't include products billed + /// based on usage.The operation is supported only for billing accounts with + /// agreement type Microsoft Partner Agreement. /// /// /// @@ -1732,7 +1682,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1747,7 +1697,520 @@ internal ProductsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); + 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 products for a billing account. These don't include products + /// billed based on usage. 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; + } + + /// + /// Lists the products for a billing profile. These don't include products + /// billed based on usage. 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>> 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) + { + _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 products for an invoice section. These don't include products + /// billed based on usage. The operation is supported only for billing accounts + /// with agreement type Microsoft Customer 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>> ListByInvoiceSectionNextWithHttpMessagesAsync(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, "ListByInvoiceSectionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs index d01234b0c380f..e6e85e29175ed 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs @@ -22,208 +22,218 @@ namespace Microsoft.Azure.Management.Billing public static partial class ProductsOperationsExtensions { /// - /// Lists products by customer id. + /// Lists the products for a customer. These don't include products billed + /// based on usage.The operation is supported only for billing accounts with + /// agreement type Microsoft Partner Agreement. /// /// /// /// 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. /// - /// - /// May be used to filter by product type. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - public static ProductsListResult ListByCustomer(this IProductsOperations operations, string billingAccountName, string customerName, string filter = default(string)) + public static IPage ListByCustomer(this IProductsOperations operations, string billingAccountName, string customerName) { - return operations.ListByCustomerAsync(billingAccountName, customerName, filter).GetAwaiter().GetResult(); + return operations.ListByCustomerAsync(billingAccountName, customerName).GetAwaiter().GetResult(); } /// - /// Lists products by customer id. + /// Lists the products for a customer. These don't include products billed + /// based on usage.The operation is supported only for billing accounts with + /// agreement type Microsoft Partner Agreement. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Customer name. - /// - /// - /// May be used to filter by product type. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). + /// The ID that uniquely identifies a customer. /// /// /// The cancellation token. /// - public static async Task ListByCustomerAsync(this IProductsOperations operations, string billingAccountName, string customerName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByCustomerAsync(this IProductsOperations operations, string billingAccountName, string customerName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get a customer's product by name. + /// Lists the products for a billing account. These don't include products + /// billed based on usage. 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. /// - /// - /// Customer name. - /// - /// - /// Invoice Id. + /// + /// May be used to filter by product type. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value are + /// separated by a colon (:). /// - public static Product GetByCustomer(this IProductsOperations operations, string billingAccountName, string customerName, string productName) + public static IPage ListByBillingAccount(this IProductsOperations operations, string billingAccountName, string filter = default(string)) { - return operations.GetByCustomerAsync(billingAccountName, customerName, productName).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, filter).GetAwaiter().GetResult(); } /// - /// Get a customer's product by name. + /// Lists the products for a billing account. These don't include products + /// billed based on usage. 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. - /// - /// - /// Customer name. + /// The ID that uniquely identifies a billing account. /// - /// - /// Invoice Id. + /// + /// May be used to filter by product type. The filter supports 'eq', 'lt', + /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + /// 'not'. Tag filter is a key value pair string where key and value are + /// separated by a colon (:). /// /// /// The cancellation token. /// - public static async Task GetByCustomerAsync(this IProductsOperations operations, string billingAccountName, string customerName, string productName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this IProductsOperations operations, string billingAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByCustomerWithHttpMessagesAsync(billingAccountName, customerName, productName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists products by billing account name. + /// Lists the products for a billing profile. These don't include products + /// billed based on usage. 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. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// May be used to filter by product type. The filter supports 'eq', 'lt', /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is + /// 'not'. Tag filter is a key value pair string where key and value are /// separated by a colon (:). /// - public static IPage ListByBillingAccount(this IProductsOperations operations, string billingAccountName, string filter = default(string)) + public static IPage ListByBillingProfile(this IProductsOperations operations, string billingAccountName, string billingProfileName, string filter = default(string)) { - return operations.ListByBillingAccountAsync(billingAccountName, filter).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, filter).GetAwaiter().GetResult(); } /// - /// Lists products by billing account name. + /// Lists the products for a billing profile. These don't include products + /// billed based on usage. 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. + /// + /// + /// The ID that uniquely identifies a billing profile. /// /// /// May be used to filter by product type. The filter supports 'eq', 'lt', /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is + /// 'not'. Tag filter is a key value pair string where key and value are /// separated by a colon (:). /// /// /// The cancellation token. /// - public static async Task> ListByBillingAccountAsync(this IProductsOperations operations, string billingAccountName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists products by invoice section name. + /// Lists the products for an invoice section. These don't include products + /// billed based on usage. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// May be used to filter by product type. The filter supports 'eq', 'lt', /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is + /// 'not'. Tag filter is a key value pair string where key and value are /// separated by a colon (:). /// - public static ProductsListResult ListByInvoiceSection(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string)) + public static IPage ListByInvoiceSection(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string)) { return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter).GetAwaiter().GetResult(); } /// - /// Lists products by invoice section name. + /// Lists the products for an invoice section. These don't include products + /// billed based on usage. 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. /// /// - /// InvoiceSection Id. + /// The ID that uniquely identifies an invoice section. /// /// /// May be used to filter by product type. The filter supports 'eq', 'lt', /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is + /// 'not'. Tag filter is a key value pair string where key and value are /// separated by a colon (:). /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInvoiceSectionAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, filter, null, cancellationToken).ConfigureAwait(false)) { @@ -232,235 +242,255 @@ public static Product GetByCustomer(this IProductsOperations operations, string } /// - /// Get a single product by name. + /// Gets a product by ID. The operation is supported only for billing accounts + /// with agreement type Microsoft Customer Agreement. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// - public static Product Get(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName) + public static Product Get(this IProductsOperations operations, string billingAccountName, string productName) { - return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName, productName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, productName).GetAwaiter().GetResult(); } /// - /// Get a single product by name. + /// Gets a product by ID. The operation is supported only for billing accounts + /// with agreement type Microsoft Customer Agreement. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IProductsOperations operations, string billingAccountName, string productName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, productName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// The operation to transfer a Product to another invoice section. + /// Updates the properties of a Product. Currently, auto renew 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. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// - /// Parameters supplied to the Transfer Product operation. + /// Request parameters that are provided to the update product operation. /// - public static Product Transfer(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters) + public static Product Update(this IProductsOperations operations, string billingAccountName, string productName, Product parameters) { - return operations.TransferAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(billingAccountName, productName, parameters).GetAwaiter().GetResult(); } /// - /// The operation to transfer a Product to another invoice section. + /// Updates the properties of a Product. Currently, auto renew 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. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// - /// Parameters supplied to the Transfer Product operation. + /// Request parameters that are provided to the update product operation. /// /// /// The cancellation token. /// - public static async Task TransferAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IProductsOperations operations, string billingAccountName, string productName, Product parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(billingAccountName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Validates the transfer of products across invoice sections. + /// Moves a product's charges to a new invoice section. The new invoice section + /// must belong to the same billing profile as the existing invoice section. + /// This operation is supported only for products that are purchased with a + /// recurring charge and for billing accounts with agreement type Microsoft + /// Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// - /// Parameters supplied to the Transfer Products operation. + /// Request parameters that are provided to the move product operation. /// - public static ValidateProductTransferEligibilityResult ValidateTransfer(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters) + public static Product Move(this IProductsOperations operations, string billingAccountName, string productName, TransferProductRequestProperties parameters) { - return operations.ValidateTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).GetAwaiter().GetResult(); + return operations.MoveAsync(billingAccountName, productName, parameters).GetAwaiter().GetResult(); } /// - /// Validates the transfer of products across invoice sections. + /// Moves a product's charges to a new invoice section. The new invoice section + /// must belong to the same billing profile as the existing invoice section. + /// This operation is supported only for products that are purchased with a + /// recurring charge and for billing accounts with agreement type Microsoft + /// Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// /// - /// Parameters supplied to the Transfer Products operation. + /// Request parameters that are provided to the move product operation. /// /// /// The cancellation token. /// - public static async Task ValidateTransferAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task MoveAsync(this IProductsOperations operations, string billingAccountName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ValidateTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.MoveWithHttpMessagesAsync(billingAccountName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Cancel auto renew for product by product id and invoice section name + /// Validates if a product's charges can be moved to a new invoice section. + /// This operation is supported only for products that are purchased with a + /// recurring charge and for billing accounts with agreement type Microsoft + /// Customer Agreement. + /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. + /// The ID that uniquely identifies a billing account. /// /// - /// Invoice Id. + /// The ID that uniquely identifies a product. /// - /// - /// Update auto renew request parameters. + /// + /// Request parameters that are provided to the validate move eligibility + /// operation. /// - public static UpdateAutoRenewOperation UpdateAutoRenewByInvoiceSection(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body) + public static ValidateProductTransferEligibilityResult ValidateMove(this IProductsOperations operations, string billingAccountName, string productName, TransferProductRequestProperties parameters) { - return operations.UpdateAutoRenewByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, body).GetAwaiter().GetResult(); + return operations.ValidateMoveAsync(billingAccountName, productName, parameters).GetAwaiter().GetResult(); } /// - /// Cancel auto renew for product by product id and invoice section name + /// Validates if a product's charges can be moved to a new invoice section. + /// This operation is supported only for products that are purchased with a + /// recurring charge and 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 product. /// - /// - /// InvoiceSection Id. + /// + /// Request parameters that are provided to the validate move eligibility + /// operation. /// - /// - /// Invoice Id. + /// + /// The cancellation token. + /// + public static async Task ValidateMoveAsync(this IProductsOperations operations, string billingAccountName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateMoveWithHttpMessagesAsync(billingAccountName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the products for a customer. These don't include products billed + /// based on usage.The operation is supported only for billing accounts with + /// agreement type Microsoft Partner Agreement. + /// + /// + /// + /// The operations group for this extension method. /// - /// - /// Update auto renew request parameters. + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByCustomerNext(this IProductsOperations operations, string nextPageLink) + { + return operations.ListByCustomerNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the products for a customer. These don't include products billed + /// based on usage.The operation is supported only for billing accounts with + /// agreement type 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 UpdateAutoRenewByInvoiceSectionAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByCustomerNextAsync(this IProductsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByCustomerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists products by billing account name. + /// Lists the products for a billing account. These don't include products + /// billed based on usage. The operation is supported for billing accounts with + /// agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. /// /// /// @@ -475,7 +505,9 @@ public static IPage ListByBillingAccountNext(this IProductsOperations o } /// - /// Lists products by billing account name. + /// Lists the products for a billing account. These don't include products + /// billed based on usage. The operation is supported for billing accounts with + /// agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. /// /// /// @@ -495,5 +527,85 @@ public static IPage ListByBillingAccountNext(this IProductsOperations o } } + /// + /// Lists the products for a billing profile. These don't include products + /// billed based on usage. 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 ListByBillingProfileNext(this IProductsOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the products for a billing profile. These don't include products + /// billed based on usage. 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> ListByBillingProfileNextAsync(this IProductsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the products for an invoice section. These don't include products + /// billed based on usage. The operation is supported only for billing accounts + /// with agreement type Microsoft Customer Agreement. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByInvoiceSectionNext(this IProductsOperations operations, string nextPageLink) + { + return operations.ListByInvoiceSectionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the products for an invoice section. These don't include products + /// billed based on usage. The operation is supported only for billing accounts + /// with agreement type Microsoft Customer 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> ListByInvoiceSectionNextAsync(this IProductsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInvoiceSectionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs index 0f3cc0d1d42fa..8b3c30035787b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/SdkInfo_BillingManagementClient.cs @@ -19,45 +19,26 @@ public static IEnumerable> ApiInfo_BillingManageme { return new Tuple[] { - new Tuple("Billing", "Address", "2019-10-01-preview"), - new Tuple("Billing", "Agreements", "2019-10-01-preview"), - new Tuple("Billing", "AvailableBalances", "2019-10-01-preview"), - new Tuple("Billing", "BillingAccounts", "2019-10-01-preview"), - new Tuple("Billing", "BillingPermissions", "2019-10-01-preview"), - new Tuple("Billing", "BillingProfiles", "2019-10-01-preview"), - new Tuple("Billing", "BillingProperty", "2019-10-01-preview"), - new Tuple("Billing", "BillingRoleAssignments", "2019-10-01-preview"), - new Tuple("Billing", "BillingRoleDefinitions", "2019-10-01-preview"), - new Tuple("Billing", "BillingSubscriptions", "2019-10-01-preview"), - new Tuple("Billing", "Customers", "2019-10-01-preview"), - new Tuple("Billing", "Departments", "2019-10-01-preview"), - new Tuple("Billing", "EnrollmentAccounts", "2019-10-01-preview"), - new Tuple("Billing", "InvoiceSections", "2019-10-01-preview"), - new Tuple("Billing", "Invoices", "2019-10-01-preview"), - new Tuple("Billing", "LineOfCredits", "2019-10-01-preview"), - new Tuple("Billing", "Operations", "2019-10-01-preview"), - new Tuple("Billing", "PartnerTransfers", "2019-10-01-preview"), - new Tuple("Billing", "PartnerTransfersTransfers", "2019-10-01-preview"), - new Tuple("Billing", "PaymentMethods", "2019-10-01-preview"), - new Tuple("Billing", "Policies", "2019-10-01-preview"), - new Tuple("Billing", "PriceSheet", "2019-10-01-preview"), - new Tuple("Billing", "Products", "2019-10-01-preview"), - new Tuple("Billing", "RecipientTransfers", "2019-10-01-preview"), - new Tuple("Billing", "Transactions", "2019-10-01-preview"), - new Tuple("Billing", "Transfers", "2019-10-01-preview"), + new Tuple("Billing", "Address", "2020-05-01"), + new Tuple("Billing", "Agreements", "2020-05-01"), + new Tuple("Billing", "AvailableBalances", "2020-05-01"), + new Tuple("Billing", "BillingAccounts", "2020-05-01"), + new Tuple("Billing", "BillingPermissions", "2020-05-01"), + new Tuple("Billing", "BillingProfiles", "2020-05-01"), + new Tuple("Billing", "BillingProperty", "2020-05-01"), + new Tuple("Billing", "BillingRoleAssignments", "2020-05-01"), + new Tuple("Billing", "BillingRoleDefinitions", "2020-05-01"), + new Tuple("Billing", "BillingSubscriptions", "2020-05-01"), + new Tuple("Billing", "Customers", "2020-05-01"), + new Tuple("Billing", "Instructions", "2020-05-01"), + new Tuple("Billing", "InvoiceSections", "2020-05-01"), + new Tuple("Billing", "Invoices", "2020-05-01"), + new Tuple("Billing", "Operations", "2020-05-01"), + new Tuple("Billing", "Policies", "2020-05-01"), + new Tuple("Billing", "Products", "2020-05-01"), + new Tuple("Billing", "Transactions", "2020-05-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4407"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/billing/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\Users\\ansar\\Documents\\GitHub\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "998331a0fa9d2e7897bc689787d74caeb60779d7"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs index 942f120bea52a..b0fe0e9a99116 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs @@ -51,914 +51,15 @@ internal TransactionsOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists the transactions by customer id for given start date and end date. - /// - /// - /// - /// billing Account Id. - /// - /// - /// Customer name. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - /// - /// 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>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string periodStartDate, string periodEndDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (billingAccountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); - } - if (customerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (periodStartDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodStartDate"); - } - if (periodEndDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodEndDate"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("customerName", customerName); - tracingParameters.Add("periodStartDate", periodStartDate); - tracingParameters.Add("periodEndDate", periodEndDate); - tracingParameters.Add("filter", filter); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByCustomer", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/transactions").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (periodStartDate != null) - { - _queryParameters.Add(string.Format("periodStartDate={0}", System.Uri.EscapeDataString(periodStartDate))); - } - if (periodEndDate != null) - { - _queryParameters.Add(string.Format("periodEndDate={0}", System.Uri.EscapeDataString(periodEndDate))); - } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } - 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 transactions by billing account name for given start and end - /// date. - /// - /// - /// - /// billing Account Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - /// - /// 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>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string periodStartDate, string periodEndDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (billingAccountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (periodStartDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodStartDate"); - } - if (periodEndDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodEndDate"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("periodStartDate", periodStartDate); - tracingParameters.Add("periodEndDate", periodEndDate); - tracingParameters.Add("filter", filter); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/transactions").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 (periodStartDate != null) - { - _queryParameters.Add(string.Format("periodStartDate={0}", System.Uri.EscapeDataString(periodStartDate))); - } - if (periodEndDate != null) - { - _queryParameters.Add(string.Format("periodEndDate={0}", System.Uri.EscapeDataString(periodEndDate))); - } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } - 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 transactions by billing profile name for given start date and end - /// date. - /// - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - /// - /// 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> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (billingAccountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); - } - if (billingProfileName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (periodStartDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodStartDate"); - } - if (periodEndDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodEndDate"); - } - // 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("periodStartDate", periodStartDate); - tracingParameters.Add("periodEndDate", periodEndDate); - tracingParameters.Add("filter", filter); - tracingParameters.Add("cancellationToken", cancellationToken); - 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}/transactions").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 (periodStartDate != null) - { - _queryParameters.Add(string.Format("periodStartDate={0}", System.Uri.EscapeDataString(periodStartDate))); - } - if (periodEndDate != null) - { - _queryParameters.Add(string.Format("periodEndDate={0}", System.Uri.EscapeDataString(periodEndDate))); - } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } - 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 transactions by invoice section name for given start date and end - /// date. - /// - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - /// - /// 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> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string periodStartDate, string periodEndDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (periodStartDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodStartDate"); - } - if (periodEndDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodEndDate"); - } - // 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("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("periodStartDate", periodStartDate); - tracingParameters.Add("periodEndDate", periodEndDate); - tracingParameters.Add("filter", filter); - tracingParameters.Add("cancellationToken", cancellationToken); - 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}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transactions").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) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (periodStartDate != null) - { - _queryParameters.Add(string.Format("periodStartDate={0}", System.Uri.EscapeDataString(periodStartDate))); - } - if (periodEndDate != null) - { - _queryParameters.Add(string.Format("periodEndDate={0}", System.Uri.EscapeDataString(periodEndDate))); - } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } - 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; - } - - /// - /// Get the transaction. + /// Lists the transactions for an invoice. Transactions include purchases, + /// refunds and Azure usage charges. /// /// /// - /// billing Account Id. + /// The ID that uniquely identifies a billing account. /// - /// - /// Billing Profile Id. - /// - /// - /// Transaction name. - /// - /// - /// Start date - /// - /// - /// End date + /// + /// The ID that uniquely identifies an invoice. /// /// /// Headers that will be added to request. @@ -981,27 +82,15 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string transactionName, string periodStartDate, string periodEndDate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByInvoiceWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (billingProfileName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); - } - if (transactionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "transactionName"); - } - if (periodStartDate == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "periodStartDate"); - } - if (periodEndDate == null) + if (invoiceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "periodEndDate"); + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceName"); } if (Client.ApiVersion == null) { @@ -1015,28 +104,16 @@ internal TransactionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); - tracingParameters.Add("transactionName", transactionName); - tracingParameters.Add("periodStartDate", periodStartDate); - tracingParameters.Add("periodEndDate", periodEndDate); + tracingParameters.Add("invoiceName", invoiceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInvoice", 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}/transactions/{transactionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/transactions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); - _url = _url.Replace("{transactionName}", System.Uri.EscapeDataString(transactionName)); + _url = _url.Replace("{invoiceName}", System.Uri.EscapeDataString(invoiceName)); List _queryParameters = new List(); - if (periodStartDate != null) - { - _queryParameters.Add(string.Format("periodStartDate={0}", System.Uri.EscapeDataString(periodStartDate))); - } - if (periodEndDate != null) - { - _queryParameters.Add(string.Format("periodEndDate={0}", System.Uri.EscapeDataString(periodEndDate))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -1065,175 +142,6 @@ internal TransactionsOperations(BillingManagementClient client) } - 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 transactions by customer id for given start date and end date. - /// - /// - /// - /// 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) @@ -1331,8 +239,8 @@ internal TransactionsOperations(BillingManagementClient client) } /// - /// Lists the transactions by billing account name for given start and end - /// date. + /// Lists the transactions for an invoice. Transactions include purchases, + /// refunds and Azure usage charges. /// /// /// @@ -1359,7 +267,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByInvoiceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1374,7 +282,7 @@ internal TransactionsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs index 882a02d6b544a..9273d6443e9eb 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs @@ -22,374 +22,52 @@ namespace Microsoft.Azure.Management.Billing public static partial class TransactionsOperationsExtensions { /// - /// Lists the transactions by customer id for given start date and end date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Customer name. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - public static IPage ListByCustomer(this ITransactionsOperations operations, string billingAccountName, string customerName, string periodStartDate, string periodEndDate, string filter = default(string)) - { - return operations.ListByCustomerAsync(billingAccountName, customerName, periodStartDate, periodEndDate, filter).GetAwaiter().GetResult(); - } - - /// - /// Lists the transactions by customer id for given start date and end date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Customer name. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - /// - /// The cancellation token. - /// - public static async Task> ListByCustomerAsync(this ITransactionsOperations operations, string billingAccountName, string customerName, string periodStartDate, string periodEndDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, periodStartDate, periodEndDate, filter, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the transactions by billing account name for given start and end - /// date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - public static IPage ListByBillingAccount(this ITransactionsOperations operations, string billingAccountName, string periodStartDate, string periodEndDate, string filter = default(string)) - { - return operations.ListByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate, filter).GetAwaiter().GetResult(); - } - - /// - /// Lists the transactions by billing account name for given start and end - /// date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - /// - /// The cancellation token. - /// - public static async Task> ListByBillingAccountAsync(this ITransactionsOperations operations, string billingAccountName, string periodStartDate, string periodEndDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, periodStartDate, periodEndDate, filter, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the transactions by billing profile name for given start date and end - /// date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - public static TransactionListResult ListByBillingProfile(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, string filter = default(string)) - { - return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate, filter).GetAwaiter().GetResult(); - } - - /// - /// Lists the transactions by billing profile name for given start date and end - /// date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - /// - /// The cancellation token. - /// - public static async Task ListByBillingProfileAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string periodStartDate, string periodEndDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, periodStartDate, periodEndDate, filter, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the transactions by invoice section name for given start date and end - /// date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - public static TransactionListResult ListByInvoiceSection(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string periodStartDate, string periodEndDate, string filter = default(string)) - { - return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, periodStartDate, periodEndDate, filter).GetAwaiter().GetResult(); - } - - /// - /// Lists the transactions by invoice section name for given start date and end - /// date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// InvoiceSection Id. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// May be used to filter by transaction kind. The filter supports 'eq', 'lt', - /// 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - /// 'not'. Tag filter is a key value pair string where key and value is - /// separated by a colon (:). - /// - /// - /// The cancellation token. - /// - public static async Task ListByInvoiceSectionAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string periodStartDate, string periodEndDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, periodStartDate, periodEndDate, filter, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get the transaction. + /// Lists the transactions for an invoice. Transactions include purchases, + /// refunds and Azure usage charges. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. + /// The ID that uniquely identifies a billing account. /// - /// - /// Transaction name. + /// + /// The ID that uniquely identifies an invoice. /// - /// - /// Start date - /// - /// - /// End date - /// - public static Transaction Get(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string transactionName, string periodStartDate, string periodEndDate) + public static IPage ListByInvoice(this ITransactionsOperations operations, string billingAccountName, string invoiceName) { - return operations.GetAsync(billingAccountName, billingProfileName, transactionName, periodStartDate, periodEndDate).GetAwaiter().GetResult(); + return operations.ListByInvoiceAsync(billingAccountName, invoiceName).GetAwaiter().GetResult(); } /// - /// Get the transaction. + /// Lists the transactions for an invoice. Transactions include purchases, + /// refunds and Azure usage charges. /// /// /// /// The operations group for this extension method. /// /// - /// billing Account Id. - /// - /// - /// Billing Profile Id. - /// - /// - /// Transaction name. - /// - /// - /// Start date - /// - /// - /// End date - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string transactionName, string periodStartDate, string periodEndDate, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, transactionName, periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the transactions by customer id for given start date and end date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. + /// The ID that uniquely identifies a billing account. /// - public static IPage ListByCustomerNext(this ITransactionsOperations operations, string nextPageLink) - { - return operations.ListByCustomerNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists the transactions by customer id for given start date and end date. - /// - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The ID that uniquely identifies an invoice. /// /// /// The cancellation token. /// - public static async Task> ListByCustomerNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInvoiceAsync(this ITransactionsOperations operations, string billingAccountName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByCustomerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceWithHttpMessagesAsync(billingAccountName, invoiceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists the transactions by billing account name for given start and end - /// date. + /// Lists the transactions for an invoice. Transactions include purchases, + /// refunds and Azure usage charges. /// /// /// @@ -398,14 +76,14 @@ public static IPage ListByCustomerNext(this ITransactionsOperations /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNext(this ITransactionsOperations operations, string nextPageLink) + public static IPage ListByInvoiceNext(this ITransactionsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByInvoiceNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Lists the transactions by billing account name for given start and end - /// date. + /// Lists the transactions for an invoice. Transactions include purchases, + /// refunds and Azure usage charges. /// /// /// @@ -417,9 +95,9 @@ public static IPage ListByBillingAccountNext(this ITransactionsOper /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByInvoiceNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; }