diff --git a/src/SDKs/Billing/Management.Billing/Generated/BillingAccountsValidateAddressOperations.cs b/src/SDKs/Billing/Management.Billing/Generated/BillingAccountsValidateAddressOperations.cs new file mode 100644 index 000000000000..bc198f574f60 --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/BillingAccountsValidateAddressOperations.cs @@ -0,0 +1,244 @@ +// +// 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; + + /// + /// BillingAccountsValidateAddressOperations operations. + /// + internal partial class BillingAccountsValidateAddressOperations : IServiceOperations, IBillingAccountsValidateAddressOperations + { + /// + /// Initializes a new instance of the BillingAccountsValidateAddressOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BillingAccountsValidateAddressOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Validates the address. + /// + /// + /// billing Account 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> PostWithHttpMessagesAsync(string billingAccountName, Address address, 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 (address == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "address"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("address", address); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Post", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/validateAddress").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("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; + if(address != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(address, 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/src/SDKs/Billing/Management.Billing/Generated/BillingAccountsValidateAddressOperationsExtensions.cs b/src/SDKs/Billing/Management.Billing/Generated/BillingAccountsValidateAddressOperationsExtensions.cs new file mode 100644 index 000000000000..1b585e79e304 --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/BillingAccountsValidateAddressOperationsExtensions.cs @@ -0,0 +1,63 @@ +// +// 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 BillingAccountsValidateAddressOperations. + /// + public static partial class BillingAccountsValidateAddressOperationsExtensions + { + /// + /// Validates the address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// + public static ValidateAddressResponse Post(this IBillingAccountsValidateAddressOperations operations, string billingAccountName, Address address) + { + return operations.PostAsync(billingAccountName, address).GetAwaiter().GetResult(); + } + + /// + /// Validates the address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task PostAsync(this IBillingAccountsValidateAddressOperations operations, string billingAccountName, Address address, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PostWithHttpMessagesAsync(billingAccountName, address, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/BillingManagementClient.cs b/src/SDKs/Billing/Management.Billing/Generated/BillingManagementClient.cs index c1d0683efb03..db08a7089bdf 100644 --- a/src/SDKs/Billing/Management.Billing/Generated/BillingManagementClient.cs +++ b/src/SDKs/Billing/Management.Billing/Generated/BillingManagementClient.cs @@ -86,6 +86,11 @@ public partial class BillingManagementClient : ServiceClient public virtual IPaymentMethodsOperations PaymentMethods { get; private set; } + /// + /// Gets the IBillingAccountsValidateAddressOperations. + /// + public virtual IBillingAccountsValidateAddressOperations BillingAccountsValidateAddress { get; private set; } + /// /// Gets the IAvailableBalancesOperations. /// @@ -424,6 +429,7 @@ private void Initialize() { BillingAccounts = new BillingAccountsOperations(this); PaymentMethods = new PaymentMethodsOperations(this); + BillingAccountsValidateAddress = new BillingAccountsValidateAddressOperations(this); AvailableBalances = new AvailableBalancesOperations(this); BillingProfiles = new BillingProfilesOperations(this); InvoiceSections = new InvoiceSectionsOperations(this); diff --git a/src/SDKs/Billing/Management.Billing/Generated/IBillingAccountsValidateAddressOperations.cs b/src/SDKs/Billing/Management.Billing/Generated/IBillingAccountsValidateAddressOperations.cs new file mode 100644 index 000000000000..b78a41362673 --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/IBillingAccountsValidateAddressOperations.cs @@ -0,0 +1,51 @@ +// +// 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; + + /// + /// BillingAccountsValidateAddressOperations operations. + /// + public partial interface IBillingAccountsValidateAddressOperations + { + /// + /// Validates the address. + /// + /// + /// billing Account 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> PostWithHttpMessagesAsync(string billingAccountName, Address address, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/IBillingManagementClient.cs b/src/SDKs/Billing/Management.Billing/Generated/IBillingManagementClient.cs index 1a737016940c..95d19c7b906a 100644 --- a/src/SDKs/Billing/Management.Billing/Generated/IBillingManagementClient.cs +++ b/src/SDKs/Billing/Management.Billing/Generated/IBillingManagementClient.cs @@ -81,6 +81,11 @@ public partial interface IBillingManagementClient : System.IDisposable /// IPaymentMethodsOperations PaymentMethods { get; } + /// + /// Gets the IBillingAccountsValidateAddressOperations. + /// + IBillingAccountsValidateAddressOperations BillingAccountsValidateAddress { get; } + /// /// Gets the IAvailableBalancesOperations. /// diff --git a/src/SDKs/Billing/Management.Billing/Generated/Models/AddressValidationStatus.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/AddressValidationStatus.cs new file mode 100644 index 000000000000..41d215933e7e --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/AddressValidationStatus.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 AddressValidationStatus. + /// + public static class AddressValidationStatus + { + public const string Valid = "Valid"; + public const string Invalid = "Invalid"; + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/Models/ProductTransferValidationErrorCode.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/ProductTransferValidationErrorCode.cs new file mode 100644 index 000000000000..5f29231b5730 --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/ProductTransferValidationErrorCode.cs @@ -0,0 +1,29 @@ +// +// 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 ProductTransferValidationErrorCode. + /// + public static class ProductTransferValidationErrorCode + { + public const string InvalidSource = "InvalidSource"; + public const string ProductNotActive = "ProductNotActive"; + public const string InsufficienctPermissionOnSource = "InsufficienctPermissionOnSource"; + public const string InsufficienctPermissionOnDestination = "InsufficienctPermissionOnDestination"; + public const string DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue"; + public const string ProductTypeNotSupported = "ProductTypeNotSupported"; + public const string CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed"; + public const string NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket"; + public const string OneTimePurchaseProductTransferNotAllowed = "OneTimePurchaseProductTransferNotAllowed"; + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/Models/SubscriptionTransferValidationErrorCode.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/SubscriptionTransferValidationErrorCode.cs new file mode 100644 index 000000000000..03bf915bd4bb --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/SubscriptionTransferValidationErrorCode.cs @@ -0,0 +1,28 @@ +// +// 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 SubscriptionTransferValidationErrorCode. + /// + public static class SubscriptionTransferValidationErrorCode + { + public const string InvalidSource = "InvalidSource"; + public const string SubscriptionNotActive = "SubscriptionNotActive"; + public const string InsufficienctPermissionOnSource = "InsufficienctPermissionOnSource"; + public const string InsufficienctPermissionOnDestination = "InsufficienctPermissionOnDestination"; + public const string DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue"; + public const string SubscriptionTypeNotSupported = "SubscriptionTypeNotSupported"; + public const string CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed"; + public const string NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket"; + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/Models/TransferBillingSubscriptionRequest.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/TransferBillingSubscriptionRequest.cs index 73356f7165b6..caee5a03f332 100644 --- a/src/SDKs/Billing/Management.Billing/Generated/Models/TransferBillingSubscriptionRequest.cs +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/TransferBillingSubscriptionRequest.cs @@ -36,9 +36,12 @@ public TransferBillingSubscriptionRequest() /// /// The destination invoice /// section id. - public TransferBillingSubscriptionRequest(string destinationInvoiceSectionId = default(string)) + /// The destination billing + /// profile id. + public TransferBillingSubscriptionRequest(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) { DestinationInvoiceSectionId = destinationInvoiceSectionId; + DestinationBillingProfileId = destinationBillingProfileId; CustomInit(); } @@ -53,5 +56,11 @@ public TransferBillingSubscriptionRequest() [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/src/SDKs/Billing/Management.Billing/Generated/Models/TransferBillingSubscriptionRequestProperties.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/TransferBillingSubscriptionRequestProperties.cs index 1de9174f58fd..c441d309ce65 100644 --- a/src/SDKs/Billing/Management.Billing/Generated/Models/TransferBillingSubscriptionRequestProperties.cs +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/TransferBillingSubscriptionRequestProperties.cs @@ -33,9 +33,12 @@ public TransferBillingSubscriptionRequestProperties() /// /// The destination invoice /// section id. - public TransferBillingSubscriptionRequestProperties(string destinationInvoiceSectionId = default(string)) + /// The destination billing + /// profile id. + public TransferBillingSubscriptionRequestProperties(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) { DestinationInvoiceSectionId = destinationInvoiceSectionId; + DestinationBillingProfileId = destinationBillingProfileId; CustomInit(); } @@ -50,5 +53,11 @@ public TransferBillingSubscriptionRequestProperties() [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/src/SDKs/Billing/Management.Billing/Generated/Models/TransferProductRequestProperties.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/TransferProductRequestProperties.cs index dab785ca787c..76f21e33a9eb 100644 --- a/src/SDKs/Billing/Management.Billing/Generated/Models/TransferProductRequestProperties.cs +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/TransferProductRequestProperties.cs @@ -31,11 +31,14 @@ public TransferProductRequestProperties() /// Initializes a new instance of the TransferProductRequestProperties /// class. /// - /// Destination invoice + /// The destination invoice /// section id. - public TransferProductRequestProperties(string destinationInvoiceSectionId = default(string)) + /// The destination billing + /// profile id. + public TransferProductRequestProperties(string destinationInvoiceSectionId = default(string), string destinationBillingProfileId = default(string)) { DestinationInvoiceSectionId = destinationInvoiceSectionId; + DestinationBillingProfileId = destinationBillingProfileId; CustomInit(); } @@ -45,10 +48,16 @@ public TransferProductRequestProperties() partial void CustomInit(); /// - /// Gets or sets destination invoice section id. + /// Gets or sets the destination invoice section id. /// [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/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateAddressResponse.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateAddressResponse.cs new file mode 100644 index 000000000000..8e6b3487d409 --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateAddressResponse.cs @@ -0,0 +1,72 @@ +// +// 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 the address validation + /// + public partial class ValidateAddressResponse + { + /// + /// Initializes a new instance of the ValidateAddressResponse class. + /// + public ValidateAddressResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidateAddressResponse class. + /// + /// status of the address validation. Possible + /// values include: 'Valid', 'Invalid' + /// list of suggested + /// addresses. + /// Validation error message. + public ValidateAddressResponse(string status = default(string), IList
suggestedAddresses = default(IList
), string validationMessage = default(string)) + { + Status = status; + SuggestedAddresses = suggestedAddresses; + ValidationMessage = validationMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of the address validation. Possible values + /// include: 'Valid', 'Invalid' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets list of suggested addresses. + /// + [JsonProperty(PropertyName = "suggestedAddresses")] + public IList
SuggestedAddresses { get; set; } + + /// + /// Gets or sets validation error message. + /// + [JsonProperty(PropertyName = "validationMessage")] + public string ValidationMessage { get; set; } + + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateProductTransferEligibilityError.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateProductTransferEligibilityError.cs new file mode 100644 index 000000000000..53aeab1b78ac --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateProductTransferEligibilityError.cs @@ -0,0 +1,84 @@ +// +// 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 of the product transfer eligibility validation. + /// + public partial class ValidateProductTransferEligibilityError + { + /// + /// Initializes a new instance of the + /// ValidateProductTransferEligibilityError class. + /// + public ValidateProductTransferEligibilityError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateProductTransferEligibilityError class. + /// + /// Error code for the product transfer validation. + /// Possible values include: 'InvalidSource', 'ProductNotActive', + /// 'InsufficienctPermissionOnSource', + /// 'InsufficienctPermissionOnDestination', + /// 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', + /// 'CrossBillingAccountNotAllowed', + /// 'NotAvailableForDestinationMarket', + /// 'OneTimePurchaseProductTransferNotAllowed' + /// The error message. + /// Detailed error message explaining the + /// error. + public ValidateProductTransferEligibilityError(string code = default(string), string message = default(string), string details = default(string)) + { + Code = code; + Message = message; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code for the product transfer validation. + /// Possible values include: 'InvalidSource', 'ProductNotActive', + /// 'InsufficienctPermissionOnSource', + /// 'InsufficienctPermissionOnDestination', + /// 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', + /// 'CrossBillingAccountNotAllowed', + /// 'NotAvailableForDestinationMarket', + /// 'OneTimePurchaseProductTransferNotAllowed' + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets detailed error message explaining the error. + /// + [JsonProperty(PropertyName = "details")] + public string Details { get; set; } + + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateProductTransferEligibilityResult.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateProductTransferEligibilityResult.cs new file mode 100644 index 000000000000..20546dd70c0f --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateProductTransferEligibilityResult.cs @@ -0,0 +1,62 @@ +// +// 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; + + /// + /// Result of the product transfer eligibility validation. + /// + public partial class ValidateProductTransferEligibilityResult + { + /// + /// Initializes a new instance of the + /// ValidateProductTransferEligibilityResult class. + /// + public ValidateProductTransferEligibilityResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateProductTransferEligibilityResult class. + /// + /// Specifies whether the transfer is + /// eligible or not. + /// Validation error details. + public ValidateProductTransferEligibilityResult(bool? isTransferEligible = default(bool?), ValidateProductTransferEligibilityError errorDetails = default(ValidateProductTransferEligibilityError)) + { + IsTransferEligible = isTransferEligible; + ErrorDetails = errorDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies whether the transfer is eligible or not. + /// + [JsonProperty(PropertyName = "isTransferEligible")] + public bool? IsTransferEligible { get; private set; } + + /// + /// Gets or sets validation error details. + /// + [JsonProperty(PropertyName = "errorDetails")] + public ValidateProductTransferEligibilityError ErrorDetails { get; set; } + + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs new file mode 100644 index 000000000000..081ef756068f --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs @@ -0,0 +1,81 @@ +// +// 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 of the transfer eligibility validation + /// + public partial class ValidateSubscriptionTransferEligibilityError + { + /// + /// Initializes a new instance of the + /// ValidateSubscriptionTransferEligibilityError class. + /// + public ValidateSubscriptionTransferEligibilityError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateSubscriptionTransferEligibilityError class. + /// + /// Error code for the product transfer validation. + /// Possible values include: 'InvalidSource', 'SubscriptionNotActive', + /// 'InsufficienctPermissionOnSource', + /// 'InsufficienctPermissionOnDestination', + /// 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', + /// 'CrossBillingAccountNotAllowed', + /// 'NotAvailableForDestinationMarket' + /// The error message. + /// Detailed error message explaining the + /// error. + public ValidateSubscriptionTransferEligibilityError(string code = default(string), string message = default(string), string details = default(string)) + { + Code = code; + Message = message; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error code for the product transfer validation. + /// Possible values include: 'InvalidSource', 'SubscriptionNotActive', + /// 'InsufficienctPermissionOnSource', + /// 'InsufficienctPermissionOnDestination', + /// 'DestinationBillingProfilePastDue', 'SubscriptionTypeNotSupported', + /// 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket' + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets detailed error message explaining the error. + /// + [JsonProperty(PropertyName = "details")] + public string Details { get; set; } + + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs new file mode 100644 index 000000000000..d467475793ba --- /dev/null +++ b/src/SDKs/Billing/Management.Billing/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs @@ -0,0 +1,62 @@ +// +// 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; + + /// + /// Result of the transfer eligibility validation. + /// + public partial class ValidateSubscriptionTransferEligibilityResult + { + /// + /// Initializes a new instance of the + /// ValidateSubscriptionTransferEligibilityResult class. + /// + public ValidateSubscriptionTransferEligibilityResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ValidateSubscriptionTransferEligibilityResult class. + /// + /// Specifies whether the transfer is + /// eligible or not. + /// Validation error details. + public ValidateSubscriptionTransferEligibilityResult(bool? isTransferEligible = default(bool?), ValidateSubscriptionTransferEligibilityError errorDetails = default(ValidateSubscriptionTransferEligibilityError)) + { + IsTransferEligible = isTransferEligible; + ErrorDetails = errorDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies whether the transfer is eligible or not. + /// + [JsonProperty(PropertyName = "isTransferEligible")] + public bool? IsTransferEligible { get; private set; } + + /// + /// Gets or sets validation error details. + /// + [JsonProperty(PropertyName = "errorDetails")] + public ValidateSubscriptionTransferEligibilityError ErrorDetails { get; set; } + + } +} diff --git a/src/SDKs/Billing/Management.Billing/Generated/SdkInfo_BillingManagementClient.cs b/src/SDKs/Billing/Management.Billing/Generated/SdkInfo_BillingManagementClient.cs index ea1bcebcf0bd..fffc013404a4 100644 --- a/src/SDKs/Billing/Management.Billing/Generated/SdkInfo_BillingManagementClient.cs +++ b/src/SDKs/Billing/Management.Billing/Generated/SdkInfo_BillingManagementClient.cs @@ -22,6 +22,7 @@ public static IEnumerable> ApiInfo_BillingManageme new Tuple("Billing", "Agreements", "2018-11-01-preview"), new Tuple("Billing", "AvailableBalances", "2018-11-01-preview"), new Tuple("Billing", "BillingAccounts", "2018-11-01-preview"), + new Tuple("Billing", "BillingAccountsValidateAddress", "2018-11-01-preview"), new Tuple("Billing", "BillingPermissions", "2018-11-01-preview"), new Tuple("Billing", "BillingProfiles", "2018-11-01-preview"), new Tuple("Billing", "BillingProperty", "2018-11-01-preview"),