From 1c0c9964485c020cb301d39ca49a73db3c1b2380 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2019 19:51:52 +0000 Subject: [PATCH 01/23] Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus --- .../src/Generated/INamespacesOperations.cs | 47 +++ .../src/Generated/Models/Rule.cs | 13 + .../src/Generated/Models/SqlFilter.cs | 24 +- .../src/Generated/NamespacesOperations.cs | 381 ++++++++++++++++++ .../NamespacesOperationsExtensions.cs | 74 ++++ .../src/Generated/RulesOperations.cs | 4 + 6 files changed, 540 insertions(+), 3 deletions(-) diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/INamespacesOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/INamespacesOperations.cs index 29a4a7d572bc..796c5382204e 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/INamespacesOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/INamespacesOperations.cs @@ -454,6 +454,31 @@ public partial interface INamespacesOperations /// Task> GetNetworkRuleSetWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// 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>> ListNetworkRuleSetsWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates or updates a service namespace. Once created, this /// namespace's resource manifest is immutable. This operation is /// idempotent. @@ -578,5 +603,27 @@ public partial interface INamespacesOperations /// Thrown when a required parameter is null /// Task>> ListAuthorizationRulesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// 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>> ListNetworkRuleSetsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Rule.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Rule.cs index bc710c0eae42..7cfe24bb1132 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Rule.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/Rule.cs @@ -87,5 +87,18 @@ public Rule() [JsonProperty(PropertyName = "properties.correlationFilter")] public CorrelationFilter CorrelationFilter { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SqlFilter != null) + { + SqlFilter.Validate(); + } + } } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SqlFilter.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SqlFilter.cs index eb1bbf03609a..f21026875bad 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SqlFilter.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/Models/SqlFilter.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.ServiceBus.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -57,11 +58,11 @@ public SqlFilter() public string SqlExpression { get; set; } /// - /// Gets this property is reserved for future use. An integer value - /// showing the compatibility level, currently hard-coded to 20. + /// Gets or sets this property is reserved for future use. An integer + /// value showing the compatibility level, currently hard-coded to 20. /// [JsonProperty(PropertyName = "compatibilityLevel")] - public int? CompatibilityLevel { get; private set; } + public int? CompatibilityLevel { get; set; } /// /// Gets or sets value that indicates whether the rule action requires @@ -70,5 +71,22 @@ public SqlFilter() [JsonProperty(PropertyName = "requiresPreprocessing")] public bool? RequiresPreprocessing { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (CompatibilityLevel > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "CompatibilityLevel", 20); + } + if (CompatibilityLevel < 20) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "CompatibilityLevel", 20); + } + } } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperations.cs index 3b8e4f25b6f2..dce1f03b4ac2 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperations.cs @@ -3170,6 +3170,219 @@ internal NamespacesOperations(ServiceBusManagementClient client) return _result; } + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// 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>> ListNetworkRuleSetsWithHttpMessagesAsync(string resourceGroupName, string namespaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (namespaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "namespaceName"); + } + if (namespaceName != null) + { + if (namespaceName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "namespaceName", 50); + } + if (namespaceName.Length < 6) + { + throw new ValidationException(ValidationRules.MinLength, "namespaceName", 6); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("namespaceName", namespaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNetworkRuleSets", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/networkRuleSets").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{namespaceName}", System.Uri.EscapeDataString(namespaceName)); + _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("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; + } + /// /// Creates or updates a service namespace. Once created, this namespace's /// resource manifest is immutable. This operation is idempotent. @@ -4112,5 +4325,173 @@ internal NamespacesOperations(ServiceBusManagementClient client) return _result; } + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// 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>> ListNetworkRuleSetsNextWithHttpMessagesAsync(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, "ListNetworkRuleSetsNext", 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/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperationsExtensions.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperationsExtensions.cs index be74f0e08a73..e1f14089154b 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperationsExtensions.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/NamespacesOperationsExtensions.cs @@ -724,6 +724,46 @@ public static NetworkRuleSet GetNetworkRuleSet(this INamespacesOperations operat } } + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + public static IPage ListNetworkRuleSets(this INamespacesOperations operations, string resourceGroupName, string namespaceName) + { + return operations.ListNetworkRuleSetsAsync(resourceGroupName, namespaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the Resource group within the Azure subscription. + /// + /// + /// The namespace name + /// + /// + /// The cancellation token. + /// + public static async Task> ListNetworkRuleSetsAsync(this INamespacesOperations operations, string resourceGroupName, string namespaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNetworkRuleSetsWithHttpMessagesAsync(resourceGroupName, namespaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates a service namespace. Once created, this namespace's /// resource manifest is immutable. This operation is idempotent. @@ -925,5 +965,39 @@ public static IPage ListAuthorizationRulesNext(this INamesp } } + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNetworkRuleSetsNext(this INamespacesOperations operations, string nextPageLink) + { + return operations.ListNetworkRuleSetsNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets list of NetworkRuleSet for a Namespace. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNetworkRuleSetsNextAsync(this INamespacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNetworkRuleSetsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RulesOperations.cs b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RulesOperations.cs index f162eb0c4024..05a5b053c266 100644 --- a/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RulesOperations.cs +++ b/sdk/servicebus/Microsoft.Azure.Management.ServiceBus/src/Generated/RulesOperations.cs @@ -454,6 +454,10 @@ internal RulesOperations(ServiceBusManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); From 749a11622d5c7198a5550690e2f698e93043d5a1 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2019 01:17:33 +0000 Subject: [PATCH 02/23] Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. --- .../SdkInfo_HealthcareApisManagementClient.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sdk/healthcareapis/Microsoft.Azure.Management.HealthcareApis/src/Generated/SdkInfo_HealthcareApisManagementClient.cs b/sdk/healthcareapis/Microsoft.Azure.Management.HealthcareApis/src/Generated/SdkInfo_HealthcareApisManagementClient.cs index 2f9b10186b4e..a0f9f7e31853 100644 --- a/sdk/healthcareapis/Microsoft.Azure.Management.HealthcareApis/src/Generated/SdkInfo_HealthcareApisManagementClient.cs +++ b/sdk/healthcareapis/Microsoft.Azure.Management.HealthcareApis/src/Generated/SdkInfo_HealthcareApisManagementClient.cs @@ -25,16 +25,5 @@ public static IEnumerable> ApiInfo_HealthcareApisM }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/healthcareapis/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\Repo\\azuresdk\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "8a02736ee4e89d8115d4ed5d2001e8c8d78ca878"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - From d8bf3d93f923103b232d14415659b5ef3b8f2a8a Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2019 02:39:46 +0000 Subject: [PATCH 03/23] Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 --- .../src/Generated/Models/ScaleInPolicy.cs | 92 +++++++++++++++++++ .../Models/VirtualMachineScaleSet.cs | 14 ++- .../VirtualMachineScaleSetScaleInRules.cs | 23 +++++ .../Models/VirtualMachineScaleSetUpdate.cs | 14 ++- .../SdkInfo_ComputeManagementClient.cs | 11 --- 5 files changed, 141 insertions(+), 13 deletions(-) create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ScaleInPolicy.cs create mode 100644 sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetScaleInRules.cs diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ScaleInPolicy.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ScaleInPolicy.cs new file mode 100644 index 000000000000..894e661e2ff5 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/ScaleInPolicy.cs @@ -0,0 +1,92 @@ +// +// 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.Compute.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes a scale-in policy for a virtual machine scale set. + /// + public partial class ScaleInPolicy + { + /// + /// Initializes a new instance of the ScaleInPolicy class. + /// + public ScaleInPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScaleInPolicy class. + /// + /// The rules to be followed when scaling-in a + /// virtual machine scale set. <br><br> Possible values + /// are: <br><br> **Default** When a virtual machine scale + /// set is scaled in, the scale set will first be balanced across zones + /// if it is a zonal scale set. Then, it will be balanced across Fault + /// Domains as far as possible. Within each Fault Domain, the virtual + /// machines chosen for removal will be the newest ones that are not + /// protected from scale-in. <br><br> **OldestVM** When a + /// virtual machine scale set is being scaled-in, the oldest virtual + /// machines that are not protected from scale-in will be chosen for + /// removal. For zonal virtual machine scale sets, the scale set will + /// first be balanced across zones. Within each zone, the oldest + /// virtual machines that are not protected will be chosen for removal. + /// <br><br> **NewestVM** When a virtual machine scale set + /// is being scaled-in, the newest virtual machines that are not + /// protected from scale-in will be chosen for removal. For zonal + /// virtual machine scale sets, the scale set will first be balanced + /// across zones. Within each zone, the newest virtual machines that + /// are not protected will be chosen for removal. + /// <br><br> + public ScaleInPolicy(IList rules = default(IList)) + { + Rules = rules; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the rules to be followed when scaling-in a virtual + /// machine scale set. &lt;br&gt;&lt;br&gt; Possible + /// values are: &lt;br&gt;&lt;br&gt; **Default** When a + /// virtual machine scale set is scaled in, the scale set will first be + /// balanced across zones if it is a zonal scale set. Then, it will be + /// balanced across Fault Domains as far as possible. Within each Fault + /// Domain, the virtual machines chosen for removal will be the newest + /// ones that are not protected from scale-in. + /// &lt;br&gt;&lt;br&gt; **OldestVM** When a virtual + /// machine scale set is being scaled-in, the oldest virtual machines + /// that are not protected from scale-in will be chosen for removal. + /// For zonal virtual machine scale sets, the scale set will first be + /// balanced across zones. Within each zone, the oldest virtual + /// machines that are not protected will be chosen for removal. + /// &lt;br&gt;&lt;br&gt; **NewestVM** When a virtual + /// machine scale set is being scaled-in, the newest virtual machines + /// that are not protected from scale-in will be chosen for removal. + /// For zonal virtual machine scale sets, the scale set will first be + /// balanced across zones. Within each zone, the newest virtual + /// machines that are not protected will be chosen for removal. + /// &lt;br&gt;&lt;br&gt; + /// + [JsonProperty(PropertyName = "rules")] + public IList Rules { get; set; } + + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSet.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSet.cs index b72fa2db6acf..9564720813b1 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSet.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSet.cs @@ -78,10 +78,13 @@ public VirtualMachineScaleSet() /// Virtual Machine Scale Set. For instance: whether the Virtual /// Machines have the capability to support attaching managed data /// disks with UltraSSD_LRS storage account type. + /// Specifies the scale-in policy that + /// decides which virtual machines are chosen for removal when a + /// Virtual Machine Scale Set is scaled-in. /// The identity of the virtual machine scale /// set, if configured. /// The virtual machine scale set zones. - public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVMs = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList zones = default(IList)) + public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVMs = default(bool?), string uniqueId = default(string), bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList zones = default(IList)) : base(location, id, name, type, tags) { Sku = sku; @@ -97,6 +100,7 @@ public VirtualMachineScaleSet() PlatformFaultDomainCount = platformFaultDomainCount; ProximityPlacementGroup = proximityPlacementGroup; AdditionalCapabilities = additionalCapabilities; + ScaleInPolicy = scaleInPolicy; Identity = identity; Zones = zones; CustomInit(); @@ -205,6 +209,14 @@ public VirtualMachineScaleSet() [JsonProperty(PropertyName = "properties.additionalCapabilities")] public AdditionalCapabilities AdditionalCapabilities { get; set; } + /// + /// Gets or sets specifies the scale-in policy that decides which + /// virtual machines are chosen for removal when a Virtual Machine + /// Scale Set is scaled-in. + /// + [JsonProperty(PropertyName = "properties.scaleInPolicy")] + public ScaleInPolicy ScaleInPolicy { get; set; } + /// /// Gets or sets the identity of the virtual machine scale set, if /// configured. diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetScaleInRules.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetScaleInRules.cs new file mode 100644 index 000000000000..bbe4bf22bc33 --- /dev/null +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetScaleInRules.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.Compute.Models +{ + + /// + /// Defines values for VirtualMachineScaleSetScaleInRules. + /// + public static class VirtualMachineScaleSetScaleInRules + { + public const string Default = "Default"; + public const string OldestVM = "OldestVM"; + public const string NewestVM = "NewestVM"; + } +} diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetUpdate.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetUpdate.cs index 0f18654a4461..266834c34d7b 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetUpdate.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/Models/VirtualMachineScaleSetUpdate.cs @@ -53,9 +53,12 @@ public VirtualMachineScaleSetUpdate() /// Virtual Machine Scale Set. For instance: whether the Virtual /// Machines have the capability to support attaching managed data /// disks with UltraSSD_LRS storage account type. + /// Specifies the scale-in policy that + /// decides which virtual machines are chosen for removal when a + /// Virtual Machine Scale Set is scaled-in. /// The identity of the virtual machine scale /// set, if configured. - public VirtualMachineScaleSetUpdate(IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile = default(VirtualMachineScaleSetUpdateVMProfile), bool? overprovision = default(bool?), bool? singlePlacementGroup = default(bool?), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity)) + public VirtualMachineScaleSetUpdate(IDictionary tags = default(IDictionary), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile = default(VirtualMachineScaleSetUpdateVMProfile), bool? overprovision = default(bool?), bool? singlePlacementGroup = default(bool?), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity)) : base(tags) { Sku = sku; @@ -65,6 +68,7 @@ public VirtualMachineScaleSetUpdate() Overprovision = overprovision; SinglePlacementGroup = singlePlacementGroup; AdditionalCapabilities = additionalCapabilities; + ScaleInPolicy = scaleInPolicy; Identity = identity; CustomInit(); } @@ -123,6 +127,14 @@ public VirtualMachineScaleSetUpdate() [JsonProperty(PropertyName = "properties.additionalCapabilities")] public AdditionalCapabilities AdditionalCapabilities { get; set; } + /// + /// Gets or sets specifies the scale-in policy that decides which + /// virtual machines are chosen for removal when a Virtual Machine + /// Scale Set is scaled-in. + /// + [JsonProperty(PropertyName = "properties.scaleInPolicy")] + public ScaleInPolicy ScaleInPolicy { get; set; } + /// /// Gets or sets the identity of the virtual machine scale set, if /// configured. diff --git a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs index e8ef6710bfa7..92e16cbf4f6d 100644 --- a/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs +++ b/sdk/compute/Microsoft.Azure.Management.Compute/src/Generated/SdkInfo_ComputeManagementClient.cs @@ -49,16 +49,5 @@ public static IEnumerable> ApiInfo_ComputeManageme }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\hylee-sdk\\avset\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "6359c5dac93947b24007afd9c569e23e92848ea5"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - From 8babe3bad599c4d4692a4e3a612be8f352b6be78 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2019 05:03:37 +0000 Subject: [PATCH 04/23] Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source --- .../src/Generated/SdkInfo_iotHubClient.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/SdkInfo_iotHubClient.cs b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/SdkInfo_iotHubClient.cs index d7f57f93b58b..c06db3d986a1 100644 --- a/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/SdkInfo_iotHubClient.cs +++ b/sdk/iothub/Microsoft.Azure.Management.IotHub/src/Generated/SdkInfo_iotHubClient.cs @@ -27,16 +27,5 @@ public static IEnumerable> ApiInfo_iotHubClient }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/iothub/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "a942bf5703a34a66ca0fb7190bdb6e0c0875e12a"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - From 4d2bb018c52b211ff995d047dba7fda07ff43262 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2019 08:45:14 +0000 Subject: [PATCH 05/23] [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example --- .../src/Generated/APIKeysOperations.cs | 987 ++++++++ .../Generated/APIKeysOperationsExtensions.cs | 207 ++ .../src/Generated/AnalyticsItemsOperations.cs | 1065 ++++++++ .../AnalyticsItemsOperationsExtensions.cs | 298 +++ .../src/Generated/AnnotationsOperations.cs | 978 ++++++++ .../AnnotationsOperationsExtensions.cs | 222 ++ ...=> ApplicationInsightsManagementClient.cs} | 203 +- .../ComponentAvailableFeaturesOperations.cs | 279 +++ ...ntAvailableFeaturesOperationsExtensions.cs | 65 + ...mponentCurrentBillingFeaturesOperations.cs | 519 ++++ ...rentBillingFeaturesOperationsExtensions.cs | 113 + .../ComponentFeatureCapabilitiesOperations.cs | 279 +++ ...FeatureCapabilitiesOperationsExtensions.cs | 65 + ...s.cs => ComponentQuotaStatusOperations.cs} | 151 +- ...omponentQuotaStatusOperationsExtensions.cs | 67 + .../src/Generated/ComponentsOperations.cs | 2211 +++++++++++++++++ .../ComponentsOperationsExtensions.cs | 446 ++++ .../src/Generated/Events.cs | 651 ----- .../src/Generated/EventsExtensions.cs | 265 -- .../ExportConfigurationsOperations.cs | 1242 +++++++++ ...xportConfigurationsOperationsExtensions.cs | 273 ++ .../src/Generated/FavoritesOperations.cs | 1262 ++++++++++ .../FavoritesOperationsExtensions.cs | 300 +++ .../src/Generated/IAPIKeysOperations.cs | 139 ++ .../Generated/IAnalyticsItemsOperations.cs | 189 ++ .../src/Generated/IAnnotationsOperations.cs | 143 ++ .../IApplicationInsightsDataClient.cs | 60 - .../IApplicationInsightsManagementClient.cs | 153 ++ .../IComponentAvailableFeaturesOperations.cs | 53 + ...mponentCurrentBillingFeaturesOperations.cs | 83 + ...IComponentFeatureCapabilitiesOperations.cs | 52 + .../IComponentQuotaStatusOperations.cs | 53 + .../src/Generated/IComponentsOperations.cs | 289 +++ .../src/Generated/IEvents.cs | 165 -- .../IExportConfigurationsOperations.cs | 175 ++ .../src/Generated/IFavoritesOperations.cs | 195 ++ .../src/Generated/IMetrics.cs | 173 -- .../src/Generated/IOperations.cs | 68 + ...activeDetectionConfigurationsOperations.cs | 116 + .../src/Generated/IQueryOperations.cs | 65 - .../Generated/IWebTestLocationsOperations.cs | 53 + .../src/Generated/IWebTestsOperations.cs | 269 ++ .../IWorkItemConfigurationsOperations.cs | 200 ++ .../src/Generated/IWorkbooksOperations.cs | 165 ++ .../src/Generated/MetricsExtensions.cs | 283 --- .../src/Generated/Models/APIKeyRequest.cs | 71 + .../src/Generated/Models/Annotation.cs | 93 + ...{EventsTraceInfo.cs => AnnotationError.cs} | 35 +- .../Models/AnnotationErrorException.cs | 62 + .../Models/ApplicationInsightsComponent.cs | 227 ++ .../ApplicationInsightsComponentAPIKey.cs | 102 + ...plicationInsightsComponentAnalyticsItem.cs | 131 + ...nsightsComponentAnalyticsItemProperties.cs | 56 + ...ationInsightsComponentAvailableFeatures.cs | 56 + ...icationInsightsComponentBillingFeatures.cs | 69 + ...plicationInsightsComponentDataVolumeCap.cs | 99 + ...ionInsightsComponentExportConfiguration.cs | 234 ++ ...plicationInsightsComponentExportRequest.cs | 134 + .../ApplicationInsightsComponentFavorite.cs | 162 ++ .../ApplicationInsightsComponentFeature.cs | 123 + ...ionInsightsComponentFeatureCapabilities.cs | 178 ++ ...ationInsightsComponentFeatureCapability.cs | 95 + ...omponentProactiveDetectionConfiguration.cs | 107 + ...veDetectionConfigurationRuleDefinitions.cs | 123 + ...ApplicationInsightsComponentQuotaStatus.cs | 74 + ...icationInsightsComponentWebTestLocation.cs | 64 + ...tricsAggregation.cs => ApplicationType.cs} | 14 +- .../src/Generated/Models/CategoryType.cs | 24 + ...csResultsItem.cs => ComponentPurgeBody.cs} | 56 +- .../Models/ComponentPurgeBodyFilters.cs | 90 + ...ryResults.cs => ComponentPurgeResponse.cs} | 45 +- .../Models/ComponentPurgeStatusResponse.cs | 70 + .../Generated/Models/ComponentsResource.cs | 100 + .../src/Generated/Models/ErrorDetail.cs | 115 - .../Generated/Models/ErrorFieldContract.cs | 68 + .../src/Generated/Models/ErrorInfo.cs | 115 - .../src/Generated/Models/ErrorResponse.cs | 43 +- .../Models/ErrorResponseException.cs | 2 +- .../src/Generated/Models/EventType.cs | 31 - .../src/Generated/Models/EventsAiInfo.cs | 75 - .../Models/EventsAvailabilityResultInfo.cs | 114 - .../Models/EventsAvailabilityResultResult.cs | 67 - .../Models/EventsBrowserTimingInfo.cs | 127 - .../Models/EventsBrowserTimingResult.cs | 71 - .../src/Generated/Models/EventsClientInfo.cs | 109 - .../src/Generated/Models/EventsCloudInfo.cs | 59 - .../Generated/Models/EventsCustomEventInfo.cs | 51 - .../Models/EventsCustomEventResult.cs | 65 - .../Models/EventsCustomMetricInfo.cs | 102 - .../Models/EventsCustomMetricResult.cs | 65 - .../Generated/Models/EventsDependencyInfo.cs | 117 - .../Models/EventsDependencyResult.cs | 65 - .../Generated/Models/EventsExceptionDetail.cs | 94 - .../EventsExceptionDetailsParsedStack.cs | 77 - .../Generated/Models/EventsExceptionInfo.cs | 182 -- .../Generated/Models/EventsExceptionResult.cs | 65 - .../Generated/Models/EventsOperationInfo.cs | 76 - .../Generated/Models/EventsPageViewInfo.cs | 76 - .../Generated/Models/EventsPageViewResult.cs | 65 - .../Models/EventsPerformanceCounterInfo.cs | 97 - .../Models/EventsPerformanceCounterResult.cs | 67 - .../src/Generated/Models/EventsRequestInfo.cs | 109 - .../Generated/Models/EventsRequestResult.cs | 65 - .../src/Generated/Models/EventsResult.cs | 59 - .../src/Generated/Models/EventsResultData.cs | 142 -- .../EventsResultDataCustomMeasurements.cs | 51 - .../src/Generated/Models/EventsResults.cs | 70 - .../src/Generated/Models/EventsSessionInfo.cs | 51 - .../src/Generated/Models/EventsTraceResult.cs | 65 - .../src/Generated/Models/EventsUserInfo.cs | 67 - .../Generated/Models/FavoriteSourceType.cs | 28 + .../src/Generated/Models/FavoriteType.cs | 60 + .../src/Generated/Models/FlowType.cs | 21 + .../src/Generated/Models/InnerError.cs | 60 + .../src/Generated/Models/ItemScope.cs | 22 + .../src/Generated/Models/ItemScopePath.cs | 22 + .../src/Generated/Models/ItemType.cs | 24 + .../src/Generated/Models/ItemTypeParameter.cs | 25 + .../src/Generated/Models/LinkProperties.cs | 67 + .../src/Generated/Models/MetricId.cs | 52 - .../Generated/Models/MetricsPostBodySchema.cs | 87 - .../Models/MetricsPostBodySchemaParameters.cs | 149 -- .../src/Generated/Models/MetricsResult.cs | 49 - .../src/Generated/Models/MetricsResultInfo.cs | 89 - .../src/Generated/Models/MetricsSegment.cs | 36 - .../Generated/Models/MetricsSegmentInfo.cs | 84 - .../Models/{Column.cs => Operation.cs} | 33 +- .../src/Generated/Models/OperationDisplay.cs | 70 + .../src/Generated/Models/Page.cs | 53 + .../src/Generated/Models/Page1.cs | 53 + .../src/Generated/Models/PurgeState.cs | 22 + .../src/Generated/Models/QueryBody.cs | 91 - .../src/Generated/Models/RequestSource.cs | 21 + .../src/Generated/Models/SharedTypeKind.cs | 22 + .../src/Generated/Models/Table.cs | 94 - ...entsApplicationInfo.cs => TagsResource.cs} | 27 +- .../src/Generated/Models/WebTest.cs | 200 ++ ...rformanceInfo.cs => WebTestGeolocation.cs} | 28 +- .../src/Generated/Models/WebTestKind.cs | 60 + ...s.cs => WebTestPropertiesConfiguration.cs} | 24 +- .../src/Generated/Models/WebtestsResource.cs | 100 + .../Generated/Models/WorkItemConfiguration.cs | 88 + .../Models/WorkItemConfigurationError.cs | 66 + .../WorkItemConfigurationErrorException.cs | 62 + .../Models/WorkItemCreateConfiguration.cs | 81 + .../src/Generated/Models/Workbook.cs | 201 ++ .../src/Generated/Models/WorkbookError.cs | 75 + .../Models/WorkbookErrorException.cs | 62 + .../src/Generated/Models/WorkbookResource.cs | 87 + .../src/Generated/Operations.cs | 397 +++ .../src/Generated/OperationsExtensions.cs | 87 + ...ctiveDetectionConfigurationsOperations.cs} | 488 ++-- ...ctionConfigurationsOperationsExtensions.cs | 173 ++ .../Generated/QueryOperationsExtensions.cs | 93 - .../SdkInfo_ApplicationInsightsDataClient.cs | 29 - ...nfo_ApplicationInsightsManagementClient.cs | 42 + .../Generated/WebTestLocationsOperations.cs | 280 +++ .../WebTestLocationsOperationsExtensions.cs | 69 + .../src/Generated/WebTestsOperations.cs | 2123 ++++++++++++++++ .../Generated/WebTestsOperationsExtensions.cs | 410 +++ .../WorkItemConfigurationsOperations.cs | 1439 +++++++++++ ...kItemConfigurationsOperationsExtensions.cs | 306 +++ .../src/Generated/WorkbooksOperations.cs | 1204 +++++++++ .../WorkbooksOperationsExtensions.cs | 252 ++ 164 files changed, 25017 insertions(+), 5792 deletions(-) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/APIKeysOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/APIKeysOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnalyticsItemsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnalyticsItemsOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnnotationsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnnotationsOperationsExtensions.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/{ApplicationInsightsDataClient.cs => ApplicationInsightsManagementClient.cs} (55%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentAvailableFeaturesOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentAvailableFeaturesOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentCurrentBillingFeaturesOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentCurrentBillingFeaturesOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentFeatureCapabilitiesOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentFeatureCapabilitiesOperationsExtensions.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/{QueryOperations.cs => ComponentQuotaStatusOperations.cs} (54%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentQuotaStatusOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentsOperationsExtensions.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Events.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/EventsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ExportConfigurationsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ExportConfigurationsOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/FavoritesOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/FavoritesOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAPIKeysOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAnalyticsItemsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAnnotationsOperations.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IApplicationInsightsDataClient.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IApplicationInsightsManagementClient.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentAvailableFeaturesOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentCurrentBillingFeaturesOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentFeatureCapabilitiesOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentQuotaStatusOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentsOperations.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IEvents.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IExportConfigurationsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IFavoritesOperations.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IMetrics.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IProactiveDetectionConfigurationsOperations.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IQueryOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWebTestLocationsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWebTestsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWorkItemConfigurationsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWorkbooksOperations.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/MetricsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/APIKeyRequest.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Annotation.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/{EventsTraceInfo.cs => AnnotationError.cs} (50%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/AnnotationErrorException.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponent.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAPIKey.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAnalyticsItem.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAnalyticsItemProperties.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAvailableFeatures.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentBillingFeatures.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentDataVolumeCap.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentExportConfiguration.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentExportRequest.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFavorite.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeature.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeatureCapabilities.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeatureCapability.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentProactiveDetectionConfiguration.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentQuotaStatus.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentWebTestLocation.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/{MetricsAggregation.cs => ApplicationType.cs} (50%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/CategoryType.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/{MetricsResultsItem.cs => ComponentPurgeBody.cs} (50%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeBodyFilters.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/{QueryResults.cs => ComponentPurgeResponse.cs} (52%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeStatusResponse.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentsResource.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorDetail.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorFieldContract.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventType.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAiInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAvailabilityResultInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAvailabilityResultResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsBrowserTimingInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsBrowserTimingResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsClientInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCloudInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomEventInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomEventResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomMetricInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomMetricResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsDependencyInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsDependencyResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionDetail.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionDetailsParsedStack.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsOperationInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPageViewInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPageViewResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPerformanceCounterInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPerformanceCounterResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsRequestInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsRequestResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultData.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultDataCustomMeasurements.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResults.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsSessionInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsTraceResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsUserInfo.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FavoriteSourceType.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FavoriteType.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FlowType.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/InnerError.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemScope.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemScopePath.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemType.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemTypeParameter.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/LinkProperties.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricId.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsPostBodySchema.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsPostBodySchemaParameters.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResult.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResultInfo.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsSegment.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsSegmentInfo.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/{Column.cs => Operation.cs} (53%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/OperationDisplay.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Page.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Page1.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/PurgeState.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/QueryBody.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/RequestSource.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/SharedTypeKind.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Table.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/{EventsApplicationInfo.cs => TagsResource.cs} (51%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTest.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/{EventsClientPerformanceInfo.cs => WebTestGeolocation.cs} (52%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestKind.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/{EventsResultDataCustomDimensions.cs => WebTestPropertiesConfiguration.cs} (52%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebtestsResource.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfiguration.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfigurationError.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfigurationErrorException.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemCreateConfiguration.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Workbook.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookError.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookErrorException.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookResource.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Operations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/OperationsExtensions.cs rename sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/{Metrics.cs => ProactiveDetectionConfigurationsOperations.cs} (51%) create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ProactiveDetectionConfigurationsOperationsExtensions.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/QueryOperationsExtensions.cs delete mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/SdkInfo_ApplicationInsightsDataClient.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/SdkInfo_ApplicationInsightsManagementClient.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestLocationsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestLocationsOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestsOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkItemConfigurationsOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkItemConfigurationsOperationsExtensions.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkbooksOperations.cs create mode 100644 sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkbooksOperationsExtensions.cs diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/APIKeysOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/APIKeysOperations.cs new file mode 100644 index 000000000000..67529382daa0 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/APIKeysOperations.cs @@ -0,0 +1,987 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// APIKeysOperations operations. + /// + internal partial class APIKeysOperations : IServiceOperations, IAPIKeysOperations + { + /// + /// Initializes a new instance of the APIKeysOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal APIKeysOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of API keys of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Create an API Key of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an API key of a Application + /// Insights component. + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, APIKeyRequest aPIKeyProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (aPIKeyProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "aPIKeyProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("aPIKeyProperties", aPIKeyProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(aPIKeyProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(aPIKeyProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Delete an API Key of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The API Key ID. This is unique within a Application Insights component. + /// + /// + /// 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> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string keyId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (keyId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("keyId", keyId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{keyId}", System.Uri.EscapeDataString(keyId)); + 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("DELETE"); + _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 API Key for this key id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The API Key ID. This is unique within a Application Insights component. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string keyId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (keyId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "keyId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("keyId", keyId); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{keyId}", System.Uri.EscapeDataString(keyId)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/APIKeysOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/APIKeysOperationsExtensions.cs new file mode 100644 index 000000000000..4e850259461b --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/APIKeysOperationsExtensions.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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for APIKeysOperations. + /// + public static partial class APIKeysOperationsExtensions + { + /// + /// Gets a list of API keys of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static IEnumerable List(this IAPIKeysOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of API keys of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create an API Key of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an API key of a Application + /// Insights component. + /// + public static ApplicationInsightsComponentAPIKey Create(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, APIKeyRequest aPIKeyProperties) + { + return operations.CreateAsync(resourceGroupName, resourceName, aPIKeyProperties).GetAwaiter().GetResult(); + } + + /// + /// Create an API Key of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an API key of a Application + /// Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, APIKeyRequest aPIKeyProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, resourceName, aPIKeyProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete an API Key of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The API Key ID. This is unique within a Application Insights component. + /// + public static ApplicationInsightsComponentAPIKey Delete(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, string keyId) + { + return operations.DeleteAsync(resourceGroupName, resourceName, keyId).GetAwaiter().GetResult(); + } + + /// + /// Delete an API Key of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The API Key ID. This is unique within a Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, string keyId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, keyId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the API Key for this key id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The API Key ID. This is unique within a Application Insights component. + /// + public static ApplicationInsightsComponentAPIKey Get(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, string keyId) + { + return operations.GetAsync(resourceGroupName, resourceName, keyId).GetAwaiter().GetResult(); + } + + /// + /// Get the API Key for this key id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The API Key ID. This is unique within a Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, string keyId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, keyId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnalyticsItemsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnalyticsItemsOperations.cs new file mode 100644 index 000000000000..062bf473adb0 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnalyticsItemsOperations.cs @@ -0,0 +1,1065 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// AnalyticsItemsOperations operations. + /// + internal partial class AnalyticsItemsOperations : IServiceOperations, IAnalyticsItemsOperations + { + /// + /// Initializes a new instance of the AnalyticsItemsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AnalyticsItemsOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'shared', 'user' + /// + /// + /// Enum indicating the type of the Analytics item. Possible values include: + /// 'none', 'query', 'function', 'folder', 'recent' + /// + /// + /// Flag indicating whether or not to return the content of each applicable + /// item. If false, only return the item information. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, string scopePath, string scope = default(string), string type = default(string), bool? includeContent = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (scopePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopePath"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("scopePath", scopePath); + tracingParameters.Add("scope", scope); + tracingParameters.Add("type", type); + tracingParameters.Add("includeContent", includeContent); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{scopePath}", System.Uri.EscapeDataString(scopePath)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (scope != null) + { + _queryParameters.Add(string.Format("scope={0}", System.Uri.EscapeDataString(scope))); + } + if (type != null) + { + _queryParameters.Add(string.Format("type={0}", System.Uri.EscapeDataString(type))); + } + if (includeContent != null) + { + _queryParameters.Add(string.Format("includeContent={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeContent, Client.SerializationSettings).Trim('"')))); + } + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 specific Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// The Id of a specific item defined in the Application Insights component + /// + /// + /// The name of a specific item defined in the Application Insights component + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string scopePath, string id = default(string), string name = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (scopePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopePath"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("scopePath", scopePath); + tracingParameters.Add("id", id); + tracingParameters.Add("name", name); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{scopePath}", System.Uri.EscapeDataString(scopePath)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (id != null) + { + _queryParameters.Add(string.Format("id={0}", System.Uri.EscapeDataString(id))); + } + if (name != null) + { + _queryParameters.Add(string.Format("name={0}", System.Uri.EscapeDataString(name))); + } + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Adds or Updates a specific Analytics Item within an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// Properties that need to be specified to create a new item and add it to an + /// Application Insights component. + /// + /// + /// Flag indicating whether or not to force save an item. This allows + /// overriding an item if it already exists. + /// + /// + /// 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> PutWithHttpMessagesAsync(string resourceGroupName, string resourceName, string scopePath, ApplicationInsightsComponentAnalyticsItem itemProperties, bool? overrideItem = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (scopePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopePath"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (itemProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "itemProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("scopePath", scopePath); + tracingParameters.Add("overrideItem", overrideItem); + tracingParameters.Add("itemProperties", itemProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{scopePath}", System.Uri.EscapeDataString(scopePath)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (overrideItem != null) + { + _queryParameters.Add(string.Format("overrideItem={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(overrideItem, Client.SerializationSettings).Trim('"')))); + } + 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(itemProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(itemProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Deletes a specific Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// The Id of a specific item defined in the Application Insights component + /// + /// + /// The name of a specific item defined in the Application Insights component + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string scopePath, string id = default(string), string name = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (scopePath == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopePath"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("scopePath", scopePath); + tracingParameters.Add("id", id); + tracingParameters.Add("name", name); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{scopePath}", System.Uri.EscapeDataString(scopePath)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (id != null) + { + _queryParameters.Add(string.Format("id={0}", System.Uri.EscapeDataString(id))); + } + if (name != null) + { + _queryParameters.Add(string.Format("name={0}", System.Uri.EscapeDataString(name))); + } + 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("DELETE"); + _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnalyticsItemsOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnalyticsItemsOperationsExtensions.cs new file mode 100644 index 000000000000..8f4f7ffa4b64 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnalyticsItemsOperationsExtensions.cs @@ -0,0 +1,298 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AnalyticsItemsOperations. + /// + public static partial class AnalyticsItemsOperationsExtensions + { + /// + /// Gets a list of Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'shared', 'user' + /// + /// + /// Enum indicating the type of the Analytics item. Possible values include: + /// 'none', 'query', 'function', 'folder', 'recent' + /// + /// + /// Flag indicating whether or not to return the content of each applicable + /// item. If false, only return the item information. + /// + public static IList List(this IAnalyticsItemsOperations operations, string resourceGroupName, string resourceName, string scopePath, string scope = default(string), string type = default(string), bool? includeContent = default(bool?)) + { + return operations.ListAsync(resourceGroupName, resourceName, scopePath, scope, type, includeContent).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'shared', 'user' + /// + /// + /// Enum indicating the type of the Analytics item. Possible values include: + /// 'none', 'query', 'function', 'folder', 'recent' + /// + /// + /// Flag indicating whether or not to return the content of each applicable + /// item. If false, only return the item information. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IAnalyticsItemsOperations operations, string resourceGroupName, string resourceName, string scopePath, string scope = default(string), string type = default(string), bool? includeContent = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, scopePath, scope, type, includeContent, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a specific Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// The Id of a specific item defined in the Application Insights component + /// + /// + /// The name of a specific item defined in the Application Insights component + /// + public static ApplicationInsightsComponentAnalyticsItem Get(this IAnalyticsItemsOperations operations, string resourceGroupName, string resourceName, string scopePath, string id = default(string), string name = default(string)) + { + return operations.GetAsync(resourceGroupName, resourceName, scopePath, id, name).GetAwaiter().GetResult(); + } + + /// + /// Gets a specific Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// The Id of a specific item defined in the Application Insights component + /// + /// + /// The name of a specific item defined in the Application Insights component + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IAnalyticsItemsOperations operations, string resourceGroupName, string resourceName, string scopePath, string id = default(string), string name = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, scopePath, id, name, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Adds or Updates a specific Analytics Item within an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// Properties that need to be specified to create a new item and add it to an + /// Application Insights component. + /// + /// + /// Flag indicating whether or not to force save an item. This allows + /// overriding an item if it already exists. + /// + public static ApplicationInsightsComponentAnalyticsItem Put(this IAnalyticsItemsOperations operations, string resourceGroupName, string resourceName, string scopePath, ApplicationInsightsComponentAnalyticsItem itemProperties, bool? overrideItem = default(bool?)) + { + return operations.PutAsync(resourceGroupName, resourceName, scopePath, itemProperties, overrideItem).GetAwaiter().GetResult(); + } + + /// + /// Adds or Updates a specific Analytics Item within an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// Properties that need to be specified to create a new item and add it to an + /// Application Insights component. + /// + /// + /// Flag indicating whether or not to force save an item. This allows + /// overriding an item if it already exists. + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IAnalyticsItemsOperations operations, string resourceGroupName, string resourceName, string scopePath, ApplicationInsightsComponentAnalyticsItem itemProperties, bool? overrideItem = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, resourceName, scopePath, itemProperties, overrideItem, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a specific Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// The Id of a specific item defined in the Application Insights component + /// + /// + /// The name of a specific item defined in the Application Insights component + /// + public static void Delete(this IAnalyticsItemsOperations operations, string resourceGroupName, string resourceName, string scopePath, string id = default(string), string name = default(string)) + { + operations.DeleteAsync(resourceGroupName, resourceName, scopePath, id, name).GetAwaiter().GetResult(); + } + + /// + /// Deletes a specific Analytics Items defined within an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user or is + /// shared between all users with access to the Application Insights component. + /// Possible values include: 'analyticsItems', 'myanalyticsItems' + /// + /// + /// The Id of a specific item defined in the Application Insights component + /// + /// + /// The name of a specific item defined in the Application Insights component + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAnalyticsItemsOperations operations, string resourceGroupName, string resourceName, string scopePath, string id = default(string), string name = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, scopePath, id, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnnotationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnnotationsOperations.cs new file mode 100644 index 000000000000..579a7f55dd31 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnnotationsOperations.cs @@ -0,0 +1,978 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// AnnotationsOperations operations. + /// + internal partial class AnnotationsOperations : IServiceOperations, IAnnotationsOperations + { + /// + /// Initializes a new instance of the AnnotationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AnnotationsOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Gets the list of annotations for a component for given time range + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The start time to query from for annotations, cannot be older than 90 days + /// from current date. + /// + /// + /// The end time to query for annotations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, string start, string end, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (start == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "start"); + } + if (end == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "end"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("start", start); + tracingParameters.Add("end", end); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (start != null) + { + _queryParameters.Add(string.Format("start={0}", System.Uri.EscapeDataString(start))); + } + if (end != null) + { + _queryParameters.Add(string.Format("end={0}", System.Uri.EscapeDataString(end))); + } + 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 AnnotationErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + AnnotationError _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; + } + + /// + /// Create an Annotation of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an annotation of a + /// Application Insights component. + /// + /// + /// 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>> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, Annotation annotationProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (annotationProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "annotationProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("annotationProperties", annotationProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(annotationProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(annotationProperties, 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 AnnotationErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + AnnotationError _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; + } + + /// + /// Delete an Annotation of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique annotation ID. This is unique within a Application Insights + /// component. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string annotationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (annotationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "annotationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("annotationId", annotationId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{annotationId}", System.Uri.EscapeDataString(annotationId)); + 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("DELETE"); + _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get the annotation for given id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique annotation ID. This is unique within a Application Insights + /// component. + /// + /// + /// 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>> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string annotationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (annotationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "annotationId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("annotationId", annotationId); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{annotationId}", System.Uri.EscapeDataString(annotationId)); + 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 AnnotationErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + AnnotationError _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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnnotationsOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnnotationsOperationsExtensions.cs new file mode 100644 index 000000000000..3ac7686026fe --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/AnnotationsOperationsExtensions.cs @@ -0,0 +1,222 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AnnotationsOperations. + /// + public static partial class AnnotationsOperationsExtensions + { + /// + /// Gets the list of annotations for a component for given time range + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The start time to query from for annotations, cannot be older than 90 days + /// from current date. + /// + /// + /// The end time to query for annotations. + /// + public static IEnumerable List(this IAnnotationsOperations operations, string resourceGroupName, string resourceName, string start, string end) + { + return operations.ListAsync(resourceGroupName, resourceName, start, end).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of annotations for a component for given time range + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The start time to query from for annotations, cannot be older than 90 days + /// from current date. + /// + /// + /// The end time to query for annotations. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IAnnotationsOperations operations, string resourceGroupName, string resourceName, string start, string end, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, start, end, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create an Annotation of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an annotation of a + /// Application Insights component. + /// + public static IList Create(this IAnnotationsOperations operations, string resourceGroupName, string resourceName, Annotation annotationProperties) + { + return operations.CreateAsync(resourceGroupName, resourceName, annotationProperties).GetAwaiter().GetResult(); + } + + /// + /// Create an Annotation of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an annotation of a + /// Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task> CreateAsync(this IAnnotationsOperations operations, string resourceGroupName, string resourceName, Annotation annotationProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, resourceName, annotationProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete an Annotation of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique annotation ID. This is unique within a Application Insights + /// component. + /// + public static void Delete(this IAnnotationsOperations operations, string resourceGroupName, string resourceName, string annotationId) + { + operations.DeleteAsync(resourceGroupName, resourceName, annotationId).GetAwaiter().GetResult(); + } + + /// + /// Delete an Annotation of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique annotation ID. This is unique within a Application Insights + /// component. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAnnotationsOperations operations, string resourceGroupName, string resourceName, string annotationId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, annotationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Get the annotation for given id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique annotation ID. This is unique within a Application Insights + /// component. + /// + public static IList Get(this IAnnotationsOperations operations, string resourceGroupName, string resourceName, string annotationId) + { + return operations.GetAsync(resourceGroupName, resourceName, annotationId).GetAwaiter().GetResult(); + } + + /// + /// Get the annotation for given id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique annotation ID. This is unique within a Application Insights + /// component. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAsync(this IAnnotationsOperations operations, string resourceGroupName, string resourceName, string annotationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, annotationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ApplicationInsightsDataClient.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ApplicationInsightsManagementClient.cs similarity index 55% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ApplicationInsightsDataClient.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ApplicationInsightsManagementClient.cs index ee70799c84ea..0f94ec45392e 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ApplicationInsightsDataClient.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ApplicationInsightsManagementClient.cs @@ -8,21 +8,23 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query +namespace Microsoft.Azure.Management.ApplicationInsights.Management { using Microsoft.Rest; + using Microsoft.Rest.Azure; using Microsoft.Rest.Serialization; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; + using System.Linq; using System.Net; using System.Net.Http; /// - /// Composite Swagger for Application Insights Data Client + /// Composite Swagger for Application Insights Management Client /// - public partial class ApplicationInsightsDataClient : ServiceClient, IApplicationInsightsDataClient + public partial class ApplicationInsightsManagementClient : ServiceClient, IApplicationInsightsManagementClient, IAzureClient { /// /// The base URI of the service. @@ -40,51 +42,144 @@ public partial class ApplicationInsightsDataClient : ServiceClient - /// Subscription credentials which uniquely identify client subscription. + /// Credentials needed for the client to connect to Azure. /// public ServiceClientCredentials Credentials { get; private set; } /// - /// Gets the IMetrics. + /// The API version to use for this operation. /// - public virtual IMetrics Metrics { get; private set; } + public string ApiVersion { get; private set; } /// - /// Gets the IEvents. + /// The ID of the target subscription. /// - public virtual IEvents Events { get; private set; } + public string SubscriptionId { get; set; } /// - /// Gets the IQueryOperations. + /// The preferred language for the response. /// - public virtual IQueryOperations Query { get; private set; } + public string AcceptLanguage { get; set; } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IAnnotationsOperations. + /// + public virtual IAnnotationsOperations Annotations { get; private set; } + + /// + /// Gets the IAPIKeysOperations. + /// + public virtual IAPIKeysOperations APIKeys { get; private set; } + + /// + /// Gets the IExportConfigurationsOperations. + /// + public virtual IExportConfigurationsOperations ExportConfigurations { get; private set; } + + /// + /// Gets the IComponentCurrentBillingFeaturesOperations. + /// + public virtual IComponentCurrentBillingFeaturesOperations ComponentCurrentBillingFeatures { get; private set; } + + /// + /// Gets the IComponentQuotaStatusOperations. + /// + public virtual IComponentQuotaStatusOperations ComponentQuotaStatus { get; private set; } + + /// + /// Gets the IComponentFeatureCapabilitiesOperations. + /// + public virtual IComponentFeatureCapabilitiesOperations ComponentFeatureCapabilities { get; private set; } + + /// + /// Gets the IComponentAvailableFeaturesOperations. + /// + public virtual IComponentAvailableFeaturesOperations ComponentAvailableFeatures { get; private set; } + + /// + /// Gets the IProactiveDetectionConfigurationsOperations. + /// + public virtual IProactiveDetectionConfigurationsOperations ProactiveDetectionConfigurations { get; private set; } + + /// + /// Gets the IComponentsOperations. + /// + public virtual IComponentsOperations Components { get; private set; } + + /// + /// Gets the IWorkItemConfigurationsOperations. + /// + public virtual IWorkItemConfigurationsOperations WorkItemConfigurations { get; private set; } + + /// + /// Gets the IFavoritesOperations. + /// + public virtual IFavoritesOperations Favorites { get; private set; } + + /// + /// Gets the IWebTestLocationsOperations. + /// + public virtual IWebTestLocationsOperations WebTestLocations { get; private set; } + + /// + /// Gets the IWebTestsOperations. + /// + public virtual IWebTestsOperations WebTests { get; private set; } + + /// + /// Gets the IAnalyticsItemsOperations. + /// + public virtual IAnalyticsItemsOperations AnalyticsItems { get; private set; } + + /// + /// Gets the IWorkbooksOperations. + /// + public virtual IWorkbooksOperations Workbooks { get; private set; } + + /// + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// /// HttpClient to be used /// /// - /// True: will dispose the provided httpClient on calling ApplicationInsightsDataClient.Dispose(). False: will not dispose provided httpClient - protected ApplicationInsightsDataClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + /// True: will dispose the provided httpClient on calling ApplicationInsightsManagementClient.Dispose(). False: will not dispose provided httpClient + protected ApplicationInsightsManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { Initialize(); } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected ApplicationInsightsDataClient(params DelegatingHandler[] handlers) : base(handlers) + protected ApplicationInsightsManagementClient(params DelegatingHandler[] handlers) : base(handlers) { Initialize(); } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -92,13 +187,13 @@ protected ApplicationInsightsDataClient(params DelegatingHandler[] handlers) : b /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected ApplicationInsightsDataClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected ApplicationInsightsManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { Initialize(); } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// /// Optional. The base URI of the service. @@ -109,7 +204,7 @@ protected ApplicationInsightsDataClient(HttpClientHandler rootHandler, params De /// /// Thrown when a required parameter is null /// - protected ApplicationInsightsDataClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected ApplicationInsightsManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -119,7 +214,7 @@ protected ApplicationInsightsDataClient(System.Uri baseUri, params DelegatingHan } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// /// Optional. The base URI of the service. @@ -133,7 +228,7 @@ protected ApplicationInsightsDataClient(System.Uri baseUri, params DelegatingHan /// /// Thrown when a required parameter is null /// - protected ApplicationInsightsDataClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected ApplicationInsightsManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -143,10 +238,10 @@ protected ApplicationInsightsDataClient(System.Uri baseUri, HttpClientHandler ro } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// - /// Required. Subscription credentials which uniquely identify client subscription. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The delegating handlers to add to the http client pipeline. @@ -154,7 +249,7 @@ protected ApplicationInsightsDataClient(System.Uri baseUri, HttpClientHandler ro /// /// Thrown when a required parameter is null /// - public ApplicationInsightsDataClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public ApplicationInsightsManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { @@ -168,20 +263,20 @@ public ApplicationInsightsDataClient(ServiceClientCredentials credentials, param } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// - /// Required. Subscription credentials which uniquely identify client subscription. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// HttpClient to be used /// /// - /// True: will dispose the provided httpClient on calling ApplicationInsightsDataClient.Dispose(). False: will not dispose provided httpClient + /// True: will dispose the provided httpClient on calling ApplicationInsightsManagementClient.Dispose(). False: will not dispose provided httpClient /// /// Thrown when a required parameter is null /// - public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public ApplicationInsightsManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { @@ -195,10 +290,10 @@ public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpC } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// - /// Required. Subscription credentials which uniquely identify client subscription. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. @@ -209,7 +304,7 @@ public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpC /// /// Thrown when a required parameter is null /// - public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public ApplicationInsightsManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { @@ -223,13 +318,13 @@ public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpC } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// /// Optional. The base URI of the service. /// /// - /// Required. Subscription credentials which uniquely identify client subscription. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The delegating handlers to add to the http client pipeline. @@ -237,7 +332,7 @@ public ApplicationInsightsDataClient(ServiceClientCredentials credentials, HttpC /// /// Thrown when a required parameter is null /// - public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public ApplicationInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -256,13 +351,13 @@ public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredential } /// - /// Initializes a new instance of the ApplicationInsightsDataClient class. + /// Initializes a new instance of the ApplicationInsightsManagementClient class. /// /// /// Optional. The base URI of the service. /// /// - /// Required. Subscription credentials which uniquely identify client subscription. + /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. @@ -273,7 +368,7 @@ public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredential /// /// Thrown when a required parameter is null /// - public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public ApplicationInsightsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -293,17 +388,34 @@ public ApplicationInsightsDataClient(System.Uri baseUri, ServiceClientCredential /// /// An optional partial-method to perform custom initialization. - /// + /// partial void CustomInitialize(); /// /// Initializes client properties. /// private void Initialize() { - Metrics = new Metrics(this); - Events = new Events(this); - Query = new QueryOperations(this); - BaseUri = new System.Uri("https://api.applicationinsights.io/v1"); + Operations = new Operations(this); + Annotations = new AnnotationsOperations(this); + APIKeys = new APIKeysOperations(this); + ExportConfigurations = new ExportConfigurationsOperations(this); + ComponentCurrentBillingFeatures = new ComponentCurrentBillingFeaturesOperations(this); + ComponentQuotaStatus = new ComponentQuotaStatusOperations(this); + ComponentFeatureCapabilities = new ComponentFeatureCapabilitiesOperations(this); + ComponentAvailableFeatures = new ComponentAvailableFeaturesOperations(this); + ProactiveDetectionConfigurations = new ProactiveDetectionConfigurationsOperations(this); + Components = new ComponentsOperations(this); + WorkItemConfigurations = new WorkItemConfigurationsOperations(this); + Favorites = new FavoritesOperations(this); + WebTestLocations = new WebTestLocationsOperations(this); + WebTests = new WebTestsOperations(this); + AnalyticsItems = new AnalyticsItemsOperations(this); + Workbooks = new WorkbooksOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2015-05-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, @@ -312,11 +424,12 @@ private void Initialize() NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + Converters = new List { new Iso8601TimeSpanConverter() } }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, @@ -329,9 +442,9 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentAvailableFeaturesOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentAvailableFeaturesOperations.cs new file mode 100644 index 000000000000..6ce9d56bd2d2 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentAvailableFeaturesOperations.cs @@ -0,0 +1,279 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// ComponentAvailableFeaturesOperations operations. + /// + internal partial class ComponentAvailableFeaturesOperations : IServiceOperations, IComponentAvailableFeaturesOperations + { + /// + /// Initializes a new instance of the ComponentAvailableFeaturesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ComponentAvailableFeaturesOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Returns all available features of the application insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/getavailablebillingfeatures").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentAvailableFeaturesOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentAvailableFeaturesOperationsExtensions.cs new file mode 100644 index 000000000000..7e3573984435 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentAvailableFeaturesOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ComponentAvailableFeaturesOperations. + /// + public static partial class ComponentAvailableFeaturesOperationsExtensions + { + /// + /// Returns all available features of the application insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static ApplicationInsightsComponentAvailableFeatures Get(this IComponentAvailableFeaturesOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Returns all available features of the application insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IComponentAvailableFeaturesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentCurrentBillingFeaturesOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentCurrentBillingFeaturesOperations.cs new file mode 100644 index 000000000000..b6e4872a00ef --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentCurrentBillingFeaturesOperations.cs @@ -0,0 +1,519 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// ComponentCurrentBillingFeaturesOperations operations. + /// + internal partial class ComponentCurrentBillingFeaturesOperations : IServiceOperations, IComponentCurrentBillingFeaturesOperations + { + /// + /// Initializes a new instance of the ComponentCurrentBillingFeaturesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ComponentCurrentBillingFeaturesOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Returns current billing features for an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Update current billing features for an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to update billing features for an + /// Application Insights component. + /// + /// + /// 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(string resourceGroupName, string resourceName, ApplicationInsightsComponentBillingFeatures billingFeaturesProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (billingFeaturesProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingFeaturesProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("billingFeaturesProperties", billingFeaturesProperties); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(billingFeaturesProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(billingFeaturesProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentCurrentBillingFeaturesOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentCurrentBillingFeaturesOperationsExtensions.cs new file mode 100644 index 000000000000..bfe874ee7a55 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentCurrentBillingFeaturesOperationsExtensions.cs @@ -0,0 +1,113 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ComponentCurrentBillingFeaturesOperations. + /// + public static partial class ComponentCurrentBillingFeaturesOperationsExtensions + { + /// + /// Returns current billing features for an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static ApplicationInsightsComponentBillingFeatures Get(this IComponentCurrentBillingFeaturesOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Returns current billing features for an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IComponentCurrentBillingFeaturesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update current billing features for an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to update billing features for an + /// Application Insights component. + /// + public static ApplicationInsightsComponentBillingFeatures Update(this IComponentCurrentBillingFeaturesOperations operations, string resourceGroupName, string resourceName, ApplicationInsightsComponentBillingFeatures billingFeaturesProperties) + { + return operations.UpdateAsync(resourceGroupName, resourceName, billingFeaturesProperties).GetAwaiter().GetResult(); + } + + /// + /// Update current billing features for an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to update billing features for an + /// Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IComponentCurrentBillingFeaturesOperations operations, string resourceGroupName, string resourceName, ApplicationInsightsComponentBillingFeatures billingFeaturesProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, billingFeaturesProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentFeatureCapabilitiesOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentFeatureCapabilitiesOperations.cs new file mode 100644 index 000000000000..310673117efe --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentFeatureCapabilitiesOperations.cs @@ -0,0 +1,279 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// ComponentFeatureCapabilitiesOperations operations. + /// + internal partial class ComponentFeatureCapabilitiesOperations : IServiceOperations, IComponentFeatureCapabilitiesOperations + { + /// + /// Initializes a new instance of the ComponentFeatureCapabilitiesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ComponentFeatureCapabilitiesOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Returns feature capabilities of the application insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/featurecapabilities").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentFeatureCapabilitiesOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentFeatureCapabilitiesOperationsExtensions.cs new file mode 100644 index 000000000000..22beeeb25ff4 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentFeatureCapabilitiesOperationsExtensions.cs @@ -0,0 +1,65 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ComponentFeatureCapabilitiesOperations. + /// + public static partial class ComponentFeatureCapabilitiesOperationsExtensions + { + /// + /// Returns feature capabilities of the application insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static ApplicationInsightsComponentFeatureCapabilities Get(this IComponentFeatureCapabilitiesOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Returns feature capabilities of the application insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IComponentFeatureCapabilitiesOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/QueryOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentQuotaStatusOperations.cs similarity index 54% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/QueryOperations.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentQuotaStatusOperations.cs index be4285fadbe6..170b7f378779 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/QueryOperations.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentQuotaStatusOperations.cs @@ -8,14 +8,14 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query +namespace Microsoft.Azure.Management.ApplicationInsights.Management { using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -23,12 +23,12 @@ namespace Microsoft.Azure.ApplicationInsights.Query using System.Threading.Tasks; /// - /// QueryOperations operations. + /// ComponentQuotaStatusOperations operations. /// - public partial class QueryOperations : IServiceOperations, IQueryOperations + internal partial class ComponentQuotaStatusOperations : IServiceOperations, IComponentQuotaStatusOperations { /// - /// Initializes a new instance of the QueryOperations class. + /// Initializes a new instance of the ComponentQuotaStatusOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ public partial class QueryOperations : IServiceOperations /// Thrown when a required parameter is null /// - public QueryOperations(ApplicationInsightsDataClient client) + internal ComponentQuotaStatusOperations(ApplicationInsightsManagementClient client) { if (client == null) { @@ -46,32 +46,19 @@ public QueryOperations(ApplicationInsightsDataClient client) } /// - /// Gets a reference to the ApplicationInsightsDataClient + /// Gets a reference to the ApplicationInsightsManagementClient /// - public ApplicationInsightsDataClient Client { get; private set; } + public ApplicationInsightsManagementClient Client { get; private set; } /// - /// Execute an Analytics query + /// Returns daily data volume cap (quota) status for an Application Insights + /// component. /// - /// - /// Executes an Analytics query for data. - /// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) - /// is an example for using POST with an Analytics query. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. + /// + /// The name of the resource group. The name is case insensitive. /// - /// - /// The query to execute. - /// - /// - /// Optional. The timespan over which to query data. This is an ISO8601 time - /// period value. This timespan is applied in addition to any that are - /// specified in the query expression. - /// - /// - /// A list of Application IDs for cross-application queries. + /// + /// The name of the Application Insights component resource. /// /// /// Headers that will be added to request. @@ -79,7 +66,7 @@ public QueryOperations(ApplicationInsightsDataClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -94,22 +81,52 @@ public QueryOperations(ApplicationInsightsDataClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ExecuteWithHttpMessagesAsync(string appId, string query, string timespan = default(string), IList applications = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (appId == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (query == null) + if (Client.SubscriptionId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "query"); + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - QueryBody body = new QueryBody(); - if (query != null || timespan != null || applications != null) + if (resourceName == null) { - body.Query = query; - body.Timespan = timespan; - body.Applications = applications; + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -118,21 +135,44 @@ public QueryOperations(ApplicationInsightsDataClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appId", appId); - tracingParameters.Add("body", body); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Execute", 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("/") ? "" : "/")), "apps/{appId}/query").ToString(); - _url = _url.Replace("{appId}", System.Uri.EscapeDataString(appId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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.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) @@ -149,12 +189,6 @@ public QueryOperations(ApplicationInsightsDataClient client) // Serialize Request string _requestContent = null; - if(body != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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) { @@ -177,13 +211,14 @@ public QueryOperations(ApplicationInsightsDataClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(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); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -193,6 +228,10 @@ public QueryOperations(ApplicationInsightsDataClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -205,16 +244,20 @@ public QueryOperations(ApplicationInsightsDataClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + 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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentQuotaStatusOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentQuotaStatusOperationsExtensions.cs new file mode 100644 index 000000000000..38372e71e887 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentQuotaStatusOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ComponentQuotaStatusOperations. + /// + public static partial class ComponentQuotaStatusOperationsExtensions + { + /// + /// Returns daily data volume cap (quota) status for an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static ApplicationInsightsComponentQuotaStatus Get(this IComponentQuotaStatusOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Returns daily data volume cap (quota) status for an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IComponentQuotaStatusOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentsOperations.cs new file mode 100644 index 000000000000..04869f0406d5 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentsOperations.cs @@ -0,0 +1,2211 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// ComponentsOperations operations. + /// + internal partial class ComponentsOperations : IServiceOperations, IComponentsOperations + { + /// + /// Initializes a new instance of the ComponentsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ComponentsOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of all Application Insights components within a subscription. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/components").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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 list of Application Insights components within a resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Deletes an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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("DELETE"); + _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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates (or updates) an Application Insights component. Note: You cannot + /// specify a different value for InstrumentationKey nor AppId in the Put + /// operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an Application Insights + /// component. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ApplicationInsightsComponent insightProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (insightProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "insightProperties"); + } + if (insightProperties != null) + { + insightProperties.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("insightProperties", insightProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(insightProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(insightProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Updates an existing component's tags. To update other fields use the + /// CreateOrUpdate method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Resource tags + /// + /// + /// 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + TagsResource componentTags = new TagsResource(); + if (tags != null) + { + componentTags.Tags = tags; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("componentTags", componentTags); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(componentTags != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(componentTags, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Purges data in an Application Insights component by a set of user-defined + /// filters. + /// + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Describes the body of a request to purge data in a single table of an + /// Application Insights component + /// + /// + /// 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> PurgeWithHttpMessagesAsync(string resourceGroupName, string resourceName, ComponentPurgeBody body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Purge", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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 != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 == 202) + { + _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 status for an ongoing purge operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + /// + /// 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> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string resourceName, string purgeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (purgeId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "purgeId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("purgeId", purgeId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetPurgeStatus", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{purgeId}", System.Uri.EscapeDataString(purgeId)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 list of all Application Insights components within a subscription. + /// + /// + /// 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 list of Application Insights components within a resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentsOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentsOperationsExtensions.cs new file mode 100644 index 000000000000..334b4b42bf7e --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ComponentsOperationsExtensions.cs @@ -0,0 +1,446 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ComponentsOperations. + /// + public static partial class ComponentsOperationsExtensions + { + /// + /// Gets a list of all Application Insights components within a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IComponentsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all Application Insights components within a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IComponentsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of Application Insights components within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IPage ListByResourceGroup(this IComponentsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of Application Insights components within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IComponentsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static void Delete(this IComponentsOperations operations, string resourceGroupName, string resourceName) + { + operations.DeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IComponentsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Returns an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static ApplicationInsightsComponent Get(this IComponentsOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Returns an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IComponentsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates (or updates) an Application Insights component. Note: You cannot + /// specify a different value for InstrumentationKey nor AppId in the Put + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an Application Insights + /// component. + /// + public static ApplicationInsightsComponent CreateOrUpdate(this IComponentsOperations operations, string resourceGroupName, string resourceName, ApplicationInsightsComponent insightProperties) + { + return operations.CreateOrUpdateAsync(resourceGroupName, resourceName, insightProperties).GetAwaiter().GetResult(); + } + + /// + /// Creates (or updates) an Application Insights component. Note: You cannot + /// specify a different value for InstrumentationKey nor AppId in the Put + /// operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an Application Insights + /// component. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IComponentsOperations operations, string resourceGroupName, string resourceName, ApplicationInsightsComponent insightProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, insightProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates an existing component's tags. To update other fields use the + /// CreateOrUpdate method. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Resource tags + /// + public static ApplicationInsightsComponent UpdateTags(this IComponentsOperations operations, string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary)) + { + return operations.UpdateTagsAsync(resourceGroupName, resourceName, tags).GetAwaiter().GetResult(); + } + + /// + /// Updates an existing component's tags. To update other fields use the + /// CreateOrUpdate method. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Resource tags + /// + /// + /// The cancellation token. + /// + public static async Task UpdateTagsAsync(this IComponentsOperations operations, string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, resourceName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Purges data in an Application Insights component by a set of user-defined + /// filters. + /// + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Describes the body of a request to purge data in a single table of an + /// Application Insights component + /// + public static ComponentPurgeResponse Purge(this IComponentsOperations operations, string resourceGroupName, string resourceName, ComponentPurgeBody body) + { + return operations.PurgeAsync(resourceGroupName, resourceName, body).GetAwaiter().GetResult(); + } + + /// + /// Purges data in an Application Insights component by a set of user-defined + /// filters. + /// + /// In order to manage system resources, purge requests are throttled at 50 + /// requests per hour. You should batch the execution of purge requests by + /// sending a single command whose predicate includes all user identities that + /// require purging. Use the in operator to specify multiple identities. You + /// should run the query prior to using for a purge request to verify that the + /// results are expected. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Describes the body of a request to purge data in a single table of an + /// Application Insights component + /// + /// + /// The cancellation token. + /// + public static async Task PurgeAsync(this IComponentsOperations operations, string resourceGroupName, string resourceName, ComponentPurgeBody body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PurgeWithHttpMessagesAsync(resourceGroupName, resourceName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get status for an ongoing purge operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + public static ComponentPurgeStatusResponse GetPurgeStatus(this IComponentsOperations operations, string resourceGroupName, string resourceName, string purgeId) + { + return operations.GetPurgeStatusAsync(resourceGroupName, resourceName, purgeId).GetAwaiter().GetResult(); + } + + /// + /// Get status for an ongoing purge operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// In a purge status request, this is the Id of the operation the status of + /// which is returned. + /// + /// + /// The cancellation token. + /// + public static async Task GetPurgeStatusAsync(this IComponentsOperations operations, string resourceGroupName, string resourceName, string purgeId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetPurgeStatusWithHttpMessagesAsync(resourceGroupName, resourceName, purgeId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of all Application Insights components within a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IComponentsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of all Application Insights components within a subscription. + /// + /// + /// 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 IComponentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of Application Insights components within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IComponentsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of Application Insights components within a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IComponentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Events.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Events.cs deleted file mode 100644 index 495ea13b6a4c..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Events.cs +++ /dev/null @@ -1,651 +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.ApplicationInsights.Query -{ - using Microsoft.Rest; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Events operations. - /// - public partial class Events : IServiceOperations, IEvents - { - /// - /// Initializes a new instance of the Events class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - public Events(ApplicationInsightsDataClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the ApplicationInsightsDataClient - /// - public ApplicationInsightsDataClient Client { get; private set; } - - /// - /// Execute OData query - /// - /// - /// Executes an OData query for events - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The type of events to query; either a standard event type (`traces`, - /// `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, - /// `availabilityResults`) or `$all` to query across all event types. Possible - /// values include: '$all', 'traces', 'customEvents', 'pageViews', - /// 'browserTimings', 'requests', 'dependencies', 'exceptions', - /// 'availabilityResults', 'performanceCounters', 'customMetrics' - /// - /// - /// Optional. The timespan over which to retrieve events. This is an ISO8601 - /// time period value. This timespan is applied in addition to any that are - /// specified in the Odata expression. - /// - /// - /// An expression used to filter the returned events - /// - /// - /// A free-text search expression to match for whether a particular event - /// should be returned - /// - /// - /// A comma-separated list of properties with \"asc\" (the default) or \"desc\" - /// to control the order of returned events - /// - /// - /// Limits the properties to just those requested on each returned event - /// - /// - /// The number of items to skip over before returning events - /// - /// - /// The number of events to return - /// - /// - /// Format for the returned events - /// - /// - /// Request a count of matching items included with the returned events - /// - /// - /// An expression used for aggregation over returned events - /// - /// - /// 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> GetByTypeWithHttpMessagesAsync(string appId, string eventType, string timespan = default(string), string filter = default(string), string search = default(string), string orderby = default(string), string select = default(string), int? skip = default(int?), int? top = default(int?), string format = default(string), bool? count = default(bool?), string apply = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (appId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "appId"); - } - if (eventType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "eventType"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appId", appId); - tracingParameters.Add("eventType", eventType); - tracingParameters.Add("timespan", timespan); - tracingParameters.Add("filter", filter); - tracingParameters.Add("search", search); - tracingParameters.Add("orderby", orderby); - tracingParameters.Add("select", select); - tracingParameters.Add("skip", skip); - tracingParameters.Add("top", top); - tracingParameters.Add("format", format); - tracingParameters.Add("count", count); - tracingParameters.Add("apply", apply); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByType", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apps/{appId}/events/{eventType}").ToString(); - _url = _url.Replace("{appId}", System.Uri.EscapeDataString(appId)); - _url = _url.Replace("{eventType}", System.Uri.EscapeDataString(eventType)); - List _queryParameters = new List(); - if (timespan != null) - { - _queryParameters.Add(string.Format("timespan={0}", System.Uri.EscapeDataString(timespan))); - } - if (filter != null) - { - _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); - } - if (search != null) - { - _queryParameters.Add(string.Format("$search={0}", System.Uri.EscapeDataString(search))); - } - if (orderby != null) - { - _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (skip != null) - { - _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"')))); - } - if (top != null) - { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); - } - if (format != null) - { - _queryParameters.Add(string.Format("$format={0}", System.Uri.EscapeDataString(format))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (apply != null) - { - _queryParameters.Add(string.Format("$apply={0}", System.Uri.EscapeDataString(apply))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + 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 (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 HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // 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 an event - /// - /// - /// Gets the data for a single event - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The type of events to query; either a standard event type (`traces`, - /// `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, - /// `availabilityResults`) or `$all` to query across all event types. Possible - /// values include: '$all', 'traces', 'customEvents', 'pageViews', - /// 'browserTimings', 'requests', 'dependencies', 'exceptions', - /// 'availabilityResults', 'performanceCounters', 'customMetrics' - /// - /// - /// ID of event. - /// - /// - /// Optional. The timespan over which to retrieve events. This is an ISO8601 - /// time period value. This timespan is applied in addition to any that are - /// specified in the Odata expression. - /// - /// - /// 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> GetWithHttpMessagesAsync(string appId, string eventType, string eventId, string timespan = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (appId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "appId"); - } - if (eventType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "eventType"); - } - if (eventId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "eventId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appId", appId); - tracingParameters.Add("eventType", eventType); - tracingParameters.Add("timespan", timespan); - tracingParameters.Add("eventId", eventId); - 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("/") ? "" : "/")), "apps/{appId}/events/{eventType}/{eventId}").ToString(); - _url = _url.Replace("{appId}", System.Uri.EscapeDataString(appId)); - _url = _url.Replace("{eventType}", System.Uri.EscapeDataString(eventType)); - _url = _url.Replace("{eventId}", System.Uri.EscapeDataString(eventId)); - List _queryParameters = new List(); - if (timespan != null) - { - _queryParameters.Add(string.Format("timespan={0}", System.Uri.EscapeDataString(timespan))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + 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 (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 HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // 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 OData metadata - /// - /// - /// Gets OData EDMX metadata describing the event data model - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// 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> GetOdataMetadataWithHttpMessagesAsync(string appId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (appId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "appId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appId", appId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOdataMetadata", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apps/{appId}/events/$metadata").ToString(); - _url = _url.Replace("{appId}", System.Uri.EscapeDataString(appId)); - // 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 (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 HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/EventsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/EventsExtensions.cs deleted file mode 100644 index 3a8eceb61006..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/EventsExtensions.cs +++ /dev/null @@ -1,265 +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.ApplicationInsights.Query -{ - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for Events. - /// - public static partial class EventsExtensions - { - /// - /// Execute OData query - /// - /// - /// Executes an OData query for events - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The type of events to query; either a standard event type (`traces`, - /// `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, - /// `availabilityResults`) or `$all` to query across all event types. Possible - /// values include: '$all', 'traces', 'customEvents', 'pageViews', - /// 'browserTimings', 'requests', 'dependencies', 'exceptions', - /// 'availabilityResults', 'performanceCounters', 'customMetrics' - /// - /// - /// Optional. The timespan over which to retrieve events. This is an ISO8601 - /// time period value. This timespan is applied in addition to any that are - /// specified in the Odata expression. - /// - /// - /// An expression used to filter the returned events - /// - /// - /// A free-text search expression to match for whether a particular event - /// should be returned - /// - /// - /// A comma-separated list of properties with \"asc\" (the default) or \"desc\" - /// to control the order of returned events - /// - /// - /// Limits the properties to just those requested on each returned event - /// - /// - /// The number of items to skip over before returning events - /// - /// - /// The number of events to return - /// - /// - /// Format for the returned events - /// - /// - /// Request a count of matching items included with the returned events - /// - /// - /// An expression used for aggregation over returned events - /// - public static EventsResults GetByType(this IEvents operations, string appId, string eventType, string timespan = default(string), string filter = default(string), string search = default(string), string orderby = default(string), string select = default(string), int? skip = default(int?), int? top = default(int?), string format = default(string), bool? count = default(bool?), string apply = default(string)) - { - return operations.GetByTypeAsync(appId, eventType, timespan, filter, search, orderby, select, skip, top, format, count, apply).GetAwaiter().GetResult(); - } - - /// - /// Execute OData query - /// - /// - /// Executes an OData query for events - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The type of events to query; either a standard event type (`traces`, - /// `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, - /// `availabilityResults`) or `$all` to query across all event types. Possible - /// values include: '$all', 'traces', 'customEvents', 'pageViews', - /// 'browserTimings', 'requests', 'dependencies', 'exceptions', - /// 'availabilityResults', 'performanceCounters', 'customMetrics' - /// - /// - /// Optional. The timespan over which to retrieve events. This is an ISO8601 - /// time period value. This timespan is applied in addition to any that are - /// specified in the Odata expression. - /// - /// - /// An expression used to filter the returned events - /// - /// - /// A free-text search expression to match for whether a particular event - /// should be returned - /// - /// - /// A comma-separated list of properties with \"asc\" (the default) or \"desc\" - /// to control the order of returned events - /// - /// - /// Limits the properties to just those requested on each returned event - /// - /// - /// The number of items to skip over before returning events - /// - /// - /// The number of events to return - /// - /// - /// Format for the returned events - /// - /// - /// Request a count of matching items included with the returned events - /// - /// - /// An expression used for aggregation over returned events - /// - /// - /// The cancellation token. - /// - public static async Task GetByTypeAsync(this IEvents operations, string appId, string eventType, string timespan = default(string), string filter = default(string), string search = default(string), string orderby = default(string), string select = default(string), int? skip = default(int?), int? top = default(int?), string format = default(string), bool? count = default(bool?), string apply = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetByTypeWithHttpMessagesAsync(appId, eventType, timespan, filter, search, orderby, select, skip, top, format, count, apply, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get an event - /// - /// - /// Gets the data for a single event - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The type of events to query; either a standard event type (`traces`, - /// `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, - /// `availabilityResults`) or `$all` to query across all event types. Possible - /// values include: '$all', 'traces', 'customEvents', 'pageViews', - /// 'browserTimings', 'requests', 'dependencies', 'exceptions', - /// 'availabilityResults', 'performanceCounters', 'customMetrics' - /// - /// - /// ID of event. - /// - /// - /// Optional. The timespan over which to retrieve events. This is an ISO8601 - /// time period value. This timespan is applied in addition to any that are - /// specified in the Odata expression. - /// - public static EventsResults Get(this IEvents operations, string appId, string eventType, string eventId, string timespan = default(string)) - { - return operations.GetAsync(appId, eventType, eventId, timespan).GetAwaiter().GetResult(); - } - - /// - /// Get an event - /// - /// - /// Gets the data for a single event - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The type of events to query; either a standard event type (`traces`, - /// `customEvents`, `pageViews`, `requests`, `dependencies`, `exceptions`, - /// `availabilityResults`) or `$all` to query across all event types. Possible - /// values include: '$all', 'traces', 'customEvents', 'pageViews', - /// 'browserTimings', 'requests', 'dependencies', 'exceptions', - /// 'availabilityResults', 'performanceCounters', 'customMetrics' - /// - /// - /// ID of event. - /// - /// - /// Optional. The timespan over which to retrieve events. This is an ISO8601 - /// time period value. This timespan is applied in addition to any that are - /// specified in the Odata expression. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IEvents operations, string appId, string eventType, string eventId, string timespan = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(appId, eventType, eventId, timespan, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get OData metadata - /// - /// - /// Gets OData EDMX metadata describing the event data model - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - public static object GetOdataMetadata(this IEvents operations, string appId) - { - return operations.GetOdataMetadataAsync(appId).GetAwaiter().GetResult(); - } - - /// - /// Get OData metadata - /// - /// - /// Gets OData EDMX metadata describing the event data model - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The cancellation token. - /// - public static async Task GetOdataMetadataAsync(this IEvents operations, string appId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetOdataMetadataWithHttpMessagesAsync(appId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ExportConfigurationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ExportConfigurationsOperations.cs new file mode 100644 index 000000000000..4098afb40040 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ExportConfigurationsOperations.cs @@ -0,0 +1,1242 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// ExportConfigurationsOperations operations. + /// + internal partial class ExportConfigurationsOperations : IServiceOperations, IExportConfigurationsOperations + { + /// + /// Initializes a new instance of the ExportConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ExportConfigurationsOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Create a Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a Continuous Export + /// configuration of a Application Insights component. + /// + /// + /// 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>> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ApplicationInsightsComponentExportRequest exportProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (exportProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "exportProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("exportProperties", exportProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(exportProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(exportProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Delete a Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + /// + /// 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> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string exportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (exportId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "exportId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("exportId", exportId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{exportId}", System.Uri.EscapeDataString(exportId)); + 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("DELETE"); + _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 Continuous Export configuration for this export id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string exportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (exportId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "exportId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("exportId", exportId); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{exportId}", System.Uri.EscapeDataString(exportId)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Update the Continuous Export configuration for this export id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + /// + /// Properties that need to be specified to update the Continuous Export + /// configuration. + /// + /// + /// 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(string resourceGroupName, string resourceName, string exportId, ApplicationInsightsComponentExportRequest exportProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (exportId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "exportId"); + } + if (exportProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "exportProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("exportId", exportId); + tracingParameters.Add("exportProperties", exportProperties); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{exportId}", System.Uri.EscapeDataString(exportId)); + 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(exportProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(exportProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ExportConfigurationsOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ExportConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..538a59ebb4bc --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ExportConfigurationsOperationsExtensions.cs @@ -0,0 +1,273 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ExportConfigurationsOperations. + /// + public static partial class ExportConfigurationsOperationsExtensions + { + /// + /// Gets a list of Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static IList List(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create a Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a Continuous Export + /// configuration of a Application Insights component. + /// + public static IList Create(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, ApplicationInsightsComponentExportRequest exportProperties) + { + return operations.CreateAsync(resourceGroupName, resourceName, exportProperties).GetAwaiter().GetResult(); + } + + /// + /// Create a Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a Continuous Export + /// configuration of a Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task> CreateAsync(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, ApplicationInsightsComponentExportRequest exportProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, resourceName, exportProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + public static ApplicationInsightsComponentExportConfiguration Delete(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, string exportId) + { + return operations.DeleteAsync(resourceGroupName, resourceName, exportId).GetAwaiter().GetResult(); + } + + /// + /// Delete a Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, string exportId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, exportId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the Continuous Export configuration for this export id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + public static ApplicationInsightsComponentExportConfiguration Get(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, string exportId) + { + return operations.GetAsync(resourceGroupName, resourceName, exportId).GetAwaiter().GetResult(); + } + + /// + /// Get the Continuous Export configuration for this export id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, string exportId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, exportId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the Continuous Export configuration for this export id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + /// + /// Properties that need to be specified to update the Continuous Export + /// configuration. + /// + public static ApplicationInsightsComponentExportConfiguration Update(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, string exportId, ApplicationInsightsComponentExportRequest exportProperties) + { + return operations.UpdateAsync(resourceGroupName, resourceName, exportId, exportProperties).GetAwaiter().GetResult(); + } + + /// + /// Update the Continuous Export configuration for this export id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a Application + /// Insights component. + /// + /// + /// Properties that need to be specified to update the Continuous Export + /// configuration. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IExportConfigurationsOperations operations, string resourceGroupName, string resourceName, string exportId, ApplicationInsightsComponentExportRequest exportProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, exportId, exportProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/FavoritesOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/FavoritesOperations.cs new file mode 100644 index 000000000000..7cf406d1a60d --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/FavoritesOperations.cs @@ -0,0 +1,1262 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// FavoritesOperations operations. + /// + internal partial class FavoritesOperations : IServiceOperations, IFavoritesOperations + { + /// + /// Initializes a new instance of the FavoritesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal FavoritesOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of favorites defined within an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The type of favorite. Value can be either shared or user. Possible values + /// include: 'shared', 'user' + /// + /// + /// Source type of favorite to return. When left out, the source type defaults + /// to 'other' (not present in this enum). Possible values include: + /// 'retention', 'notebook', 'sessions', 'events', 'userflows', 'funnel', + /// 'impact', 'segmentation' + /// + /// + /// Flag indicating whether or not to return the full content for each + /// applicable favorite. If false, only return summary content for favorites. + /// + /// + /// Tags that must be present on each favorite returned. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, FavoriteType? favoriteType = default(FavoriteType?), string sourceType = default(string), bool? canFetchContent = default(bool?), IList tags = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("favoriteType", favoriteType); + tracingParameters.Add("sourceType", sourceType); + tracingParameters.Add("canFetchContent", canFetchContent); + tracingParameters.Add("tags", tags); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (favoriteType != null) + { + _queryParameters.Add(string.Format("favoriteType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(favoriteType, Client.SerializationSettings).Trim('"')))); + } + if (sourceType != null) + { + _queryParameters.Add(string.Format("sourceType={0}", System.Uri.EscapeDataString(sourceType))); + } + if (canFetchContent != null) + { + _queryParameters.Add(string.Format("canFetchContent={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(canFetchContent, Client.SerializationSettings).Trim('"')))); + } + if (tags != null) + { + _queryParameters.Add(string.Format("tags={0}", System.Uri.EscapeDataString(string.Join(",", tags)))); + } + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 a single favorite by its FavoriteId, defined within an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string favoriteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (favoriteId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "favoriteId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("favoriteId", favoriteId); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{favoriteId}", System.Uri.EscapeDataString(favoriteId)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Adds a new favorites to an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// Properties that need to be specified to create a new favorite and add it to + /// an Application Insights component. + /// + /// + /// 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> AddWithHttpMessagesAsync(string resourceGroupName, string resourceName, string favoriteId, ApplicationInsightsComponentFavorite favoriteProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (favoriteId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "favoriteId"); + } + if (favoriteProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "favoriteProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("favoriteId", favoriteId); + tracingParameters.Add("favoriteProperties", favoriteProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Add", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{favoriteId}", System.Uri.EscapeDataString(favoriteId)); + 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(favoriteProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(favoriteProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Updates a favorite that has already been added to an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// Properties that need to be specified to update the existing favorite. + /// + /// + /// 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(string resourceGroupName, string resourceName, string favoriteId, ApplicationInsightsComponentFavorite favoriteProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (favoriteId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "favoriteId"); + } + if (favoriteProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "favoriteProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("favoriteId", favoriteId); + tracingParameters.Add("favoriteProperties", favoriteProperties); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{favoriteId}", System.Uri.EscapeDataString(favoriteId)); + 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(favoriteProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(favoriteProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Remove a favorite that is associated to an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string favoriteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (favoriteId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "favoriteId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("favoriteId", favoriteId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{favoriteId}", System.Uri.EscapeDataString(favoriteId)); + 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("DELETE"); + _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/FavoritesOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/FavoritesOperationsExtensions.cs new file mode 100644 index 000000000000..c4dd575d1884 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/FavoritesOperationsExtensions.cs @@ -0,0 +1,300 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for FavoritesOperations. + /// + public static partial class FavoritesOperationsExtensions + { + /// + /// Gets a list of favorites defined within an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The type of favorite. Value can be either shared or user. Possible values + /// include: 'shared', 'user' + /// + /// + /// Source type of favorite to return. When left out, the source type defaults + /// to 'other' (not present in this enum). Possible values include: + /// 'retention', 'notebook', 'sessions', 'events', 'userflows', 'funnel', + /// 'impact', 'segmentation' + /// + /// + /// Flag indicating whether or not to return the full content for each + /// applicable favorite. If false, only return summary content for favorites. + /// + /// + /// Tags that must be present on each favorite returned. + /// + public static IList List(this IFavoritesOperations operations, string resourceGroupName, string resourceName, FavoriteType? favoriteType = default(FavoriteType?), string sourceType = default(string), bool? canFetchContent = default(bool?), IList tags = default(IList)) + { + return operations.ListAsync(resourceGroupName, resourceName, favoriteType, sourceType, canFetchContent, tags).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of favorites defined within an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The type of favorite. Value can be either shared or user. Possible values + /// include: 'shared', 'user' + /// + /// + /// Source type of favorite to return. When left out, the source type defaults + /// to 'other' (not present in this enum). Possible values include: + /// 'retention', 'notebook', 'sessions', 'events', 'userflows', 'funnel', + /// 'impact', 'segmentation' + /// + /// + /// Flag indicating whether or not to return the full content for each + /// applicable favorite. If false, only return summary content for favorites. + /// + /// + /// Tags that must be present on each favorite returned. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IFavoritesOperations operations, string resourceGroupName, string resourceName, FavoriteType? favoriteType = default(FavoriteType?), string sourceType = default(string), bool? canFetchContent = default(bool?), IList tags = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, favoriteType, sourceType, canFetchContent, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a single favorite by its FavoriteId, defined within an Application + /// Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + public static ApplicationInsightsComponentFavorite Get(this IFavoritesOperations operations, string resourceGroupName, string resourceName, string favoriteId) + { + return operations.GetAsync(resourceGroupName, resourceName, favoriteId).GetAwaiter().GetResult(); + } + + /// + /// Get a single favorite by its FavoriteId, defined within an Application + /// Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IFavoritesOperations operations, string resourceGroupName, string resourceName, string favoriteId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, favoriteId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Adds a new favorites to an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// Properties that need to be specified to create a new favorite and add it to + /// an Application Insights component. + /// + public static ApplicationInsightsComponentFavorite Add(this IFavoritesOperations operations, string resourceGroupName, string resourceName, string favoriteId, ApplicationInsightsComponentFavorite favoriteProperties) + { + return operations.AddAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties).GetAwaiter().GetResult(); + } + + /// + /// Adds a new favorites to an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// Properties that need to be specified to create a new favorite and add it to + /// an Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task AddAsync(this IFavoritesOperations operations, string resourceGroupName, string resourceName, string favoriteId, ApplicationInsightsComponentFavorite favoriteProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.AddWithHttpMessagesAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a favorite that has already been added to an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// Properties that need to be specified to update the existing favorite. + /// + public static ApplicationInsightsComponentFavorite Update(this IFavoritesOperations operations, string resourceGroupName, string resourceName, string favoriteId, ApplicationInsightsComponentFavorite favoriteProperties) + { + return operations.UpdateAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties).GetAwaiter().GetResult(); + } + + /// + /// Updates a favorite that has already been added to an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// Properties that need to be specified to update the existing favorite. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IFavoritesOperations operations, string resourceGroupName, string resourceName, string favoriteId, ApplicationInsightsComponentFavorite favoriteProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, favoriteId, favoriteProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Remove a favorite that is associated to an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + public static void Delete(this IFavoritesOperations operations, string resourceGroupName, string resourceName, string favoriteId) + { + operations.DeleteAsync(resourceGroupName, resourceName, favoriteId).GetAwaiter().GetResult(); + } + + /// + /// Remove a favorite that is associated to an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights component + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IFavoritesOperations operations, string resourceGroupName, string resourceName, string favoriteId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, favoriteId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAPIKeysOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAPIKeysOperations.cs new file mode 100644 index 000000000000..203211c53916 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAPIKeysOperations.cs @@ -0,0 +1,139 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// APIKeysOperations operations. + /// + public partial interface IAPIKeysOperations + { + /// + /// Gets a list of API keys of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create an API Key of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an API key of a + /// Application Insights component. + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, APIKeyRequest aPIKeyProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete an API Key of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The API Key ID. This is unique within a Application Insights + /// component. + /// + /// + /// 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> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string keyId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the API Key for this key id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The API Key ID. This is unique within a Application Insights + /// component. + /// + /// + /// 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 resourceGroupName, string resourceName, string keyId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAnalyticsItemsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAnalyticsItemsOperations.cs new file mode 100644 index 000000000000..32f75acc4604 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAnalyticsItemsOperations.cs @@ -0,0 +1,189 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AnalyticsItemsOperations operations. + /// + public partial interface IAnalyticsItemsOperations + { + /// + /// Gets a list of Analytics Items defined within an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user + /// or is shared between all users with access to the Application + /// Insights component. Possible values include: 'analyticsItems', + /// 'myanalyticsItems' + /// + /// + /// Enum indicating if this item definition is owned by a specific user + /// or is shared between all users with access to the Application + /// Insights component. Possible values include: 'shared', 'user' + /// + /// + /// Enum indicating the type of the Analytics item. Possible values + /// include: 'none', 'query', 'function', 'folder', 'recent' + /// + /// + /// Flag indicating whether or not to return the content of each + /// applicable item. If false, only return the item information. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, string scopePath, string scope = default(string), string type = default(string), bool? includeContent = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a specific Analytics Items defined within an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user + /// or is shared between all users with access to the Application + /// Insights component. Possible values include: 'analyticsItems', + /// 'myanalyticsItems' + /// + /// + /// The Id of a specific item defined in the Application Insights + /// component + /// + /// + /// The name of a specific item defined in the Application Insights + /// component + /// + /// + /// 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 resourceGroupName, string resourceName, string scopePath, string id = default(string), string name = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Adds or Updates a specific Analytics Item within an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user + /// or is shared between all users with access to the Application + /// Insights component. Possible values include: 'analyticsItems', + /// 'myanalyticsItems' + /// + /// + /// Properties that need to be specified to create a new item and add + /// it to an Application Insights component. + /// + /// + /// Flag indicating whether or not to force save an item. This allows + /// overriding an item if it already exists. + /// + /// + /// 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> PutWithHttpMessagesAsync(string resourceGroupName, string resourceName, string scopePath, ApplicationInsightsComponentAnalyticsItem itemProperties, bool? overrideItem = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a specific Analytics Items defined within an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Enum indicating if this item definition is owned by a specific user + /// or is shared between all users with access to the Application + /// Insights component. Possible values include: 'analyticsItems', + /// 'myanalyticsItems' + /// + /// + /// The Id of a specific item defined in the Application Insights + /// component + /// + /// + /// The name of a specific item defined in the Application Insights + /// component + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string scopePath, string id = default(string), string name = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAnnotationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAnnotationsOperations.cs new file mode 100644 index 000000000000..39371bb14b50 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IAnnotationsOperations.cs @@ -0,0 +1,143 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AnnotationsOperations operations. + /// + public partial interface IAnnotationsOperations + { + /// + /// Gets the list of annotations for a component for given time range + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The start time to query from for annotations, cannot be older than + /// 90 days from current date. + /// + /// + /// The end time to query for annotations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, string start, string end, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create an Annotation of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an annotation of a + /// Application Insights component. + /// + /// + /// 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>> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, Annotation annotationProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete an Annotation of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique annotation ID. This is unique within a Application + /// Insights component. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string annotationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the annotation for given id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique annotation ID. This is unique within a Application + /// Insights component. + /// + /// + /// 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 resourceGroupName, string resourceName, string annotationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IApplicationInsightsDataClient.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IApplicationInsightsDataClient.cs deleted file mode 100644 index 319ec8bccd5f..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IApplicationInsightsDataClient.cs +++ /dev/null @@ -1,60 +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.ApplicationInsights.Query -{ - using Microsoft.Rest; - using Models; - using Newtonsoft.Json; - - /// - /// Composite Swagger for Application Insights Data Client - /// - public partial interface IApplicationInsightsDataClient : System.IDisposable - { - /// - /// The base URI of the service. - /// - System.Uri BaseUri { get; set; } - - /// - /// Gets or sets json serialization settings. - /// - JsonSerializerSettings SerializationSettings { get; } - - /// - /// Gets or sets json deserialization settings. - /// - JsonSerializerSettings DeserializationSettings { get; } - - /// - /// Subscription credentials which uniquely identify client - /// subscription. - /// - ServiceClientCredentials Credentials { get; } - - - /// - /// Gets the IMetrics. - /// - IMetrics Metrics { get; } - - /// - /// Gets the IEvents. - /// - IEvents Events { get; } - - /// - /// Gets the IQueryOperations. - /// - IQueryOperations Query { get; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IApplicationInsightsManagementClient.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IApplicationInsightsManagementClient.cs new file mode 100644 index 000000000000..70b2824b1e9c --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IApplicationInsightsManagementClient.cs @@ -0,0 +1,153 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// Composite Swagger for Application Insights Management Client + /// + public partial interface IApplicationInsightsManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The API version to use for this operation. + /// + string ApiVersion { get; } + + /// + /// The ID of the target subscription. + /// + string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IAnnotationsOperations. + /// + IAnnotationsOperations Annotations { get; } + + /// + /// Gets the IAPIKeysOperations. + /// + IAPIKeysOperations APIKeys { get; } + + /// + /// Gets the IExportConfigurationsOperations. + /// + IExportConfigurationsOperations ExportConfigurations { get; } + + /// + /// Gets the IComponentCurrentBillingFeaturesOperations. + /// + IComponentCurrentBillingFeaturesOperations ComponentCurrentBillingFeatures { get; } + + /// + /// Gets the IComponentQuotaStatusOperations. + /// + IComponentQuotaStatusOperations ComponentQuotaStatus { get; } + + /// + /// Gets the IComponentFeatureCapabilitiesOperations. + /// + IComponentFeatureCapabilitiesOperations ComponentFeatureCapabilities { get; } + + /// + /// Gets the IComponentAvailableFeaturesOperations. + /// + IComponentAvailableFeaturesOperations ComponentAvailableFeatures { get; } + + /// + /// Gets the IProactiveDetectionConfigurationsOperations. + /// + IProactiveDetectionConfigurationsOperations ProactiveDetectionConfigurations { get; } + + /// + /// Gets the IComponentsOperations. + /// + IComponentsOperations Components { get; } + + /// + /// Gets the IWorkItemConfigurationsOperations. + /// + IWorkItemConfigurationsOperations WorkItemConfigurations { get; } + + /// + /// Gets the IFavoritesOperations. + /// + IFavoritesOperations Favorites { get; } + + /// + /// Gets the IWebTestLocationsOperations. + /// + IWebTestLocationsOperations WebTestLocations { get; } + + /// + /// Gets the IWebTestsOperations. + /// + IWebTestsOperations WebTests { get; } + + /// + /// Gets the IAnalyticsItemsOperations. + /// + IAnalyticsItemsOperations AnalyticsItems { get; } + + /// + /// Gets the IWorkbooksOperations. + /// + IWorkbooksOperations Workbooks { get; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentAvailableFeaturesOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentAvailableFeaturesOperations.cs new file mode 100644 index 000000000000..6245ab851381 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentAvailableFeaturesOperations.cs @@ -0,0 +1,53 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ComponentAvailableFeaturesOperations operations. + /// + public partial interface IComponentAvailableFeaturesOperations + { + /// + /// Returns all available features of the application insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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 resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentCurrentBillingFeaturesOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentCurrentBillingFeaturesOperations.cs new file mode 100644 index 000000000000..b4b0790c370e --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentCurrentBillingFeaturesOperations.cs @@ -0,0 +1,83 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ComponentCurrentBillingFeaturesOperations operations. + /// + public partial interface IComponentCurrentBillingFeaturesOperations + { + /// + /// Returns current billing features for an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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 resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update current billing features for an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to update billing features for + /// an Application Insights component. + /// + /// + /// 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 resourceGroupName, string resourceName, ApplicationInsightsComponentBillingFeatures billingFeaturesProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentFeatureCapabilitiesOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentFeatureCapabilitiesOperations.cs new file mode 100644 index 000000000000..d0ab332eba9e --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentFeatureCapabilitiesOperations.cs @@ -0,0 +1,52 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ComponentFeatureCapabilitiesOperations operations. + /// + public partial interface IComponentFeatureCapabilitiesOperations + { + /// + /// Returns feature capabilities of the application insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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 resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentQuotaStatusOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentQuotaStatusOperations.cs new file mode 100644 index 000000000000..99f2abb19a76 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentQuotaStatusOperations.cs @@ -0,0 +1,53 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ComponentQuotaStatusOperations operations. + /// + public partial interface IComponentQuotaStatusOperations + { + /// + /// Returns daily data volume cap (quota) status for an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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 resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentsOperations.cs new file mode 100644 index 000000000000..c891562b9e69 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IComponentsOperations.cs @@ -0,0 +1,289 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ComponentsOperations operations. + /// + public partial interface IComponentsOperations + { + /// + /// Gets a list of all Application Insights components within a + /// subscription. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of Application Insights components within a resource + /// group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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 resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates (or updates) an Application Insights component. Note: You + /// cannot specify a different value for InstrumentationKey nor AppId + /// in the Put operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create an Application + /// Insights component. + /// + /// + /// 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 resourceGroupName, string resourceName, ApplicationInsightsComponent insightProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an existing component's tags. To update other fields use + /// the CreateOrUpdate method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Resource tags + /// + /// + /// 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string resourceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Purges data in an Application Insights component by a set of + /// user-defined filters. + /// + /// In order to manage system resources, purge requests are throttled + /// at 50 requests per hour. You should batch the execution of purge + /// requests by sending a single command whose predicate includes all + /// user identities that require purging. Use the in operator to + /// specify multiple identities. You should run the query prior to + /// using for a purge request to verify that the results are expected. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Describes the body of a request to purge data in a single table of + /// an Application Insights component + /// + /// + /// 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> PurgeWithHttpMessagesAsync(string resourceGroupName, string resourceName, ComponentPurgeBody body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get status for an ongoing purge operation. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// In a purge status request, this is the Id of the operation the + /// status of which is returned. + /// + /// + /// 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> GetPurgeStatusWithHttpMessagesAsync(string resourceGroupName, string resourceName, string purgeId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of all Application Insights components within a + /// subscription. + /// + /// + /// 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)); + /// + /// Gets a list of Application Insights components within a resource + /// group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IEvents.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IEvents.cs deleted file mode 100644 index b84886dd994f..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IEvents.cs +++ /dev/null @@ -1,165 +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.ApplicationInsights.Query -{ - using Microsoft.Rest; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Events operations. - /// - public partial interface IEvents - { - /// - /// Execute OData query - /// - /// - /// Executes an OData query for events - /// - /// - /// ID of the application. This is Application ID from the API Access - /// settings blade in the Azure portal. - /// - /// - /// The type of events to query; either a standard event type - /// (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, - /// `exceptions`, `availabilityResults`) or `$all` to query across all - /// event types. Possible values include: '$all', 'traces', - /// 'customEvents', 'pageViews', 'browserTimings', 'requests', - /// 'dependencies', 'exceptions', 'availabilityResults', - /// 'performanceCounters', 'customMetrics' - /// - /// - /// Optional. The timespan over which to retrieve events. This is an - /// ISO8601 time period value. This timespan is applied in addition to - /// any that are specified in the Odata expression. - /// - /// - /// An expression used to filter the returned events - /// - /// - /// A free-text search expression to match for whether a particular - /// event should be returned - /// - /// - /// A comma-separated list of properties with \"asc\" (the default) or - /// \"desc\" to control the order of returned events - /// - /// - /// Limits the properties to just those requested on each returned - /// event - /// - /// - /// The number of items to skip over before returning events - /// - /// - /// The number of events to return - /// - /// - /// Format for the returned events - /// - /// - /// Request a count of matching items included with the returned events - /// - /// - /// An expression used for aggregation over returned events - /// - /// - /// 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> GetByTypeWithHttpMessagesAsync(string appId, string eventType, string timespan = default(string), string filter = default(string), string search = default(string), string orderby = default(string), string select = default(string), int? skip = default(int?), int? top = default(int?), string format = default(string), bool? count = default(bool?), string apply = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get an event - /// - /// - /// Gets the data for a single event - /// - /// - /// ID of the application. This is Application ID from the API Access - /// settings blade in the Azure portal. - /// - /// - /// The type of events to query; either a standard event type - /// (`traces`, `customEvents`, `pageViews`, `requests`, `dependencies`, - /// `exceptions`, `availabilityResults`) or `$all` to query across all - /// event types. Possible values include: '$all', 'traces', - /// 'customEvents', 'pageViews', 'browserTimings', 'requests', - /// 'dependencies', 'exceptions', 'availabilityResults', - /// 'performanceCounters', 'customMetrics' - /// - /// - /// ID of event. - /// - /// - /// Optional. The timespan over which to retrieve events. This is an - /// ISO8601 time period value. This timespan is applied in addition to - /// any that are specified in the Odata expression. - /// - /// - /// 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 appId, string eventType, string eventId, string timespan = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get OData metadata - /// - /// - /// Gets OData EDMX metadata describing the event data model - /// - /// - /// ID of the application. This is Application ID from the API Access - /// settings blade in the Azure portal. - /// - /// - /// 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> GetOdataMetadataWithHttpMessagesAsync(string appId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IExportConfigurationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IExportConfigurationsOperations.cs new file mode 100644 index 000000000000..2c0937a7033e --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IExportConfigurationsOperations.cs @@ -0,0 +1,175 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ExportConfigurationsOperations operations. + /// + public partial interface IExportConfigurationsOperations + { + /// + /// Gets a list of Continuous Export configuration of an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a Continuous Export + /// configuration of a Application Insights component. + /// + /// + /// 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>> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, ApplicationInsightsComponentExportRequest exportProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a Continuous Export configuration of an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// 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> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string exportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the Continuous Export configuration for this export id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// 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 resourceGroupName, string resourceName, string exportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the Continuous Export configuration for this export id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Continuous Export configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// Properties that need to be specified to update the Continuous + /// Export configuration. + /// + /// + /// 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 resourceGroupName, string resourceName, string exportId, ApplicationInsightsComponentExportRequest exportProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IFavoritesOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IFavoritesOperations.cs new file mode 100644 index 000000000000..88410b28b122 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IFavoritesOperations.cs @@ -0,0 +1,195 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// FavoritesOperations operations. + /// + public partial interface IFavoritesOperations + { + /// + /// Gets a list of favorites defined within an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The type of favorite. Value can be either shared or user. Possible + /// values include: 'shared', 'user' + /// + /// + /// Source type of favorite to return. When left out, the source type + /// defaults to 'other' (not present in this enum). Possible values + /// include: 'retention', 'notebook', 'sessions', 'events', + /// 'userflows', 'funnel', 'impact', 'segmentation' + /// + /// + /// Flag indicating whether or not to return the full content for each + /// applicable favorite. If false, only return summary content for + /// favorites. + /// + /// + /// Tags that must be present on each favorite returned. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, FavoriteType? favoriteType = default(FavoriteType?), string sourceType = default(string), bool? canFetchContent = default(bool?), IList tags = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a single favorite by its FavoriteId, defined within an + /// Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights + /// component + /// + /// + /// 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 resourceGroupName, string resourceName, string favoriteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Adds a new favorites to an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights + /// component + /// + /// + /// Properties that need to be specified to create a new favorite and + /// add it to an Application Insights component. + /// + /// + /// 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> AddWithHttpMessagesAsync(string resourceGroupName, string resourceName, string favoriteId, ApplicationInsightsComponentFavorite favoriteProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a favorite that has already been added to an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights + /// component + /// + /// + /// Properties that need to be specified to update the existing + /// favorite. + /// + /// + /// 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 resourceGroupName, string resourceName, string favoriteId, ApplicationInsightsComponentFavorite favoriteProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Remove a favorite that is associated to an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The Id of a specific favorite defined in the Application Insights + /// component + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string favoriteId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IMetrics.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IMetrics.cs deleted file mode 100644 index 657018f66eea..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IMetrics.cs +++ /dev/null @@ -1,173 +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.ApplicationInsights.Query -{ - using Microsoft.Rest; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Metrics operations. - /// - public partial interface IMetrics - { - /// - /// Retrieve metric data - /// - /// - /// Gets metric values for a single metric - /// - /// - /// ID of the application. This is Application ID from the API Access - /// settings blade in the Azure portal. - /// - /// - /// ID of the metric. This is either a standard AI metric, or an - /// application-specific custom metric. Possible values include: - /// 'requests/count', 'requests/duration', 'requests/failed', - /// 'users/count', 'users/authenticated', 'pageViews/count', - /// 'pageViews/duration', 'client/processingDuration', - /// 'client/receiveDuration', 'client/networkDuration', - /// 'client/sendDuration', 'client/totalDuration', - /// 'dependencies/count', 'dependencies/failed', - /// 'dependencies/duration', 'exceptions/count', 'exceptions/browser', - /// 'exceptions/server', 'sessions/count', - /// 'performanceCounters/requestExecutionTime', - /// 'performanceCounters/requestsPerSecond', - /// 'performanceCounters/requestsInQueue', - /// 'performanceCounters/memoryAvailableBytes', - /// 'performanceCounters/exceptionsPerSecond', - /// 'performanceCounters/processCpuPercentage', - /// 'performanceCounters/processIOBytesPerSecond', - /// 'performanceCounters/processPrivateBytes', - /// 'performanceCounters/processorCpuPercentage', - /// 'availabilityResults/availabilityPercentage', - /// 'availabilityResults/duration', 'billing/telemetryCount', - /// 'customEvents/count' - /// - /// - /// The timespan over which to retrieve metric values. This is an - /// ISO8601 time period value. If timespan is omitted, a default time - /// range of `PT12H` ("last 12 hours") is used. The actual timespan - /// that is queried may be adjusted by the server based. In all cases, - /// the actual time span used for the query is included in the - /// response. - /// - /// - /// The time interval to use when retrieving metric values. This is an - /// ISO8601 duration. If interval is omitted, the metric value is - /// aggregated across the entire timespan. If interval is supplied, the - /// server may adjust the interval to a more appropriate size based on - /// the timespan used for the query. In all cases, the actual interval - /// used for the query is included in the response. - /// - /// - /// The aggregation to use when computing the metric values. To - /// retrieve more than one aggregation at a time, separate them with a - /// comma. If no aggregation is specified, then the default aggregation - /// for the metric is used. - /// - /// - /// The name of the dimension to segment the metric values by. This - /// dimension must be applicable to the metric you are retrieving. To - /// segment by more than one dimension at a time, separate them with a - /// comma (,). In this case, the metric data will be segmented in the - /// order the dimensions are listed in the parameter. - /// - /// - /// The number of segments to return. This value is only valid when - /// segment is specified. - /// - /// - /// The aggregation function and direction to sort the segments by. - /// This value is only valid when segment is specified. - /// - /// - /// An expression used to filter the results. This value should be a - /// valid OData filter expression where the keys of each clause should - /// be applicable dimensions for the metric you are retrieving. - /// - /// - /// 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 appId, string metricId, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), IList aggregation = default(IList), IList segment = default(IList), int? top = default(int?), string orderby = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieve metric data - /// - /// - /// Gets metric values for multiple metrics - /// - /// - /// ID of the application. This is Application ID from the API Access - /// settings blade in the Azure portal. - /// - /// - /// The batched metrics query. - /// - /// - /// 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>> GetMultipleWithHttpMessagesAsync(string appId, IList body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieve metric metatadata - /// - /// - /// Gets metadata describing the available metrics - /// - /// - /// ID of the application. This is Application ID from the API Access - /// settings blade in the Azure portal. - /// - /// - /// 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> GetMetadataWithHttpMessagesAsync(string appId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IOperations.cs new file mode 100644 index 000000000000..fc3ceb0ca2bd --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IOperations.cs @@ -0,0 +1,68 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// Lists all of the available insights REST API operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all of the available insights REST API operations. + /// + /// + /// 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)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IProactiveDetectionConfigurationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IProactiveDetectionConfigurationsOperations.cs new file mode 100644 index 000000000000..4c6798aa9fdf --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IProactiveDetectionConfigurationsOperations.cs @@ -0,0 +1,116 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ProactiveDetectionConfigurationsOperations operations. + /// + public partial interface IProactiveDetectionConfigurationsOperations + { + /// + /// Gets a list of ProactiveDetection configurations of an Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get the ProactiveDetection configuration for this configuration id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The ProactiveDetection configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// 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 resourceGroupName, string resourceName, string configurationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update the ProactiveDetection configuration for this configuration + /// id. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The ProactiveDetection configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// Properties that need to be specified to update the + /// ProactiveDetection configuration. + /// + /// + /// 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 resourceGroupName, string resourceName, string configurationId, ApplicationInsightsComponentProactiveDetectionConfiguration proactiveDetectionProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IQueryOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IQueryOperations.cs deleted file mode 100644 index fd2fbdd40d49..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IQueryOperations.cs +++ /dev/null @@ -1,65 +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.ApplicationInsights.Query -{ - using Microsoft.Rest; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// QueryOperations operations. - /// - public partial interface IQueryOperations - { - /// - /// Execute an Analytics query - /// - /// - /// Executes an Analytics query for data. - /// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) - /// is an example for using POST with an Analytics query. - /// - /// - /// ID of the application. This is Application ID from the API Access - /// settings blade in the Azure portal. - /// - /// - /// The query to execute. - /// - /// - /// Optional. The timespan over which to query data. This is an ISO8601 - /// time period value. This timespan is applied in addition to any - /// that are specified in the query expression. - /// - /// - /// A list of Application IDs for cross-application queries. - /// - /// - /// 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> ExecuteWithHttpMessagesAsync(string appId, string query, string timespan = default(string), IList applications = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWebTestLocationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWebTestLocationsOperations.cs new file mode 100644 index 000000000000..1f09ef7aef27 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWebTestLocationsOperations.cs @@ -0,0 +1,53 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WebTestLocationsOperations operations. + /// + public partial interface IWebTestLocationsOperations + { + /// + /// Gets a list of web test locations available to this Application + /// Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWebTestsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWebTestsOperations.cs new file mode 100644 index 000000000000..779cc1bbd500 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWebTestsOperations.cs @@ -0,0 +1,269 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WebTestsOperations operations. + /// + public partial interface IWebTestsOperations + { + /// + /// Get all Application Insights web tests defined within a specified + /// resource group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a specific Application Insights web test definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// 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 resourceGroupName, string webTestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an Application Insights web test definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Properties that need to be specified to create or update an + /// Application Insights web test definition. + /// + /// + /// 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 resourceGroupName, string webTestName, WebTest webTestDefinition, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an Application Insights web test definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Resource tags + /// + /// + /// 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string webTestName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an Application Insights web test. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string webTestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all Application Insights web test alerts definitions within a + /// subscription. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all Application Insights web tests defined for the specified + /// component. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListByComponentWithHttpMessagesAsync(string componentName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all Application Insights web tests defined within a specified + /// resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get all Application Insights web test alerts definitions within a + /// subscription. + /// + /// + /// 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)); + /// + /// Get all Application Insights web tests defined for the specified + /// component. + /// + /// + /// 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>> ListByComponentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWorkItemConfigurationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWorkItemConfigurationsOperations.cs new file mode 100644 index 000000000000..9df36927d135 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWorkItemConfigurationsOperations.cs @@ -0,0 +1,200 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkItemConfigurationsOperations operations. + /// + public partial interface IWorkItemConfigurationsOperations + { + /// + /// Gets the list work item configurations that exist for the + /// application + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a work item configuration for an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a work item + /// configuration of a Application Insights component. + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, WorkItemCreateConfiguration workItemConfigurationProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets default work item configurations that exist for the + /// application + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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> GetDefaultWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a work item configuration of an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly + /// name of connector as defined in connector configuration + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string workItemConfigId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets specified work item configuration for an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly + /// name of connector as defined in connector configuration + /// + /// + /// 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> GetItemWithHttpMessagesAsync(string resourceGroupName, string resourceName, string workItemConfigId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a work item configuration for an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly + /// name of connector as defined in connector configuration + /// + /// + /// Properties that need to be specified to update a work item + /// configuration for this Application Insights component. + /// + /// + /// 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> UpdateItemWithHttpMessagesAsync(string resourceGroupName, string resourceName, string workItemConfigId, WorkItemCreateConfiguration workItemConfigurationProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWorkbooksOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWorkbooksOperations.cs new file mode 100644 index 000000000000..57188f8ed4d5 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/IWorkbooksOperations.cs @@ -0,0 +1,165 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkbooksOperations operations. + /// + public partial interface IWorkbooksOperations + { + /// + /// Get all Workbooks defined within a specified resource group and + /// category. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Category of workbook to return. Possible values include: + /// 'workbook', 'TSG', 'performance', 'retention' + /// + /// + /// Tags presents on each workbook returned. + /// + /// + /// Flag indicating whether or not to return the full content for each + /// applicable workbook. If false, only return summary content for + /// workbooks. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string category, IList tags = default(IList), bool? canFetchContent = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a single workbook by its resourceName. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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 resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a workbook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a new workbook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a new workbook. + /// + /// + /// 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 resourceGroupName, string resourceName, Workbook workbookProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a workbook that has already been added. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a new workbook. + /// + /// + /// 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 resourceGroupName, string resourceName, Workbook workbookProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/MetricsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/MetricsExtensions.cs deleted file mode 100644 index 0046d58892c3..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/MetricsExtensions.cs +++ /dev/null @@ -1,283 +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.ApplicationInsights.Query -{ - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for Metrics. - /// - public static partial class MetricsExtensions - { - /// - /// Retrieve metric data - /// - /// - /// Gets metric values for a single metric - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// ID of the metric. This is either a standard AI metric, or an - /// application-specific custom metric. Possible values include: - /// 'requests/count', 'requests/duration', 'requests/failed', 'users/count', - /// 'users/authenticated', 'pageViews/count', 'pageViews/duration', - /// 'client/processingDuration', 'client/receiveDuration', - /// 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', - /// 'dependencies/count', 'dependencies/failed', 'dependencies/duration', - /// 'exceptions/count', 'exceptions/browser', 'exceptions/server', - /// 'sessions/count', 'performanceCounters/requestExecutionTime', - /// 'performanceCounters/requestsPerSecond', - /// 'performanceCounters/requestsInQueue', - /// 'performanceCounters/memoryAvailableBytes', - /// 'performanceCounters/exceptionsPerSecond', - /// 'performanceCounters/processCpuPercentage', - /// 'performanceCounters/processIOBytesPerSecond', - /// 'performanceCounters/processPrivateBytes', - /// 'performanceCounters/processorCpuPercentage', - /// 'availabilityResults/availabilityPercentage', - /// 'availabilityResults/duration', 'billing/telemetryCount', - /// 'customEvents/count' - /// - /// - /// The timespan over which to retrieve metric values. This is an ISO8601 time - /// period value. If timespan is omitted, a default time range of `PT12H` - /// ("last 12 hours") is used. The actual timespan that is queried may be - /// adjusted by the server based. In all cases, the actual time span used for - /// the query is included in the response. - /// - /// - /// The time interval to use when retrieving metric values. This is an ISO8601 - /// duration. If interval is omitted, the metric value is aggregated across the - /// entire timespan. If interval is supplied, the server may adjust the - /// interval to a more appropriate size based on the timespan used for the - /// query. In all cases, the actual interval used for the query is included in - /// the response. - /// - /// - /// The aggregation to use when computing the metric values. To retrieve more - /// than one aggregation at a time, separate them with a comma. If no - /// aggregation is specified, then the default aggregation for the metric is - /// used. - /// - /// - /// The name of the dimension to segment the metric values by. This dimension - /// must be applicable to the metric you are retrieving. To segment by more - /// than one dimension at a time, separate them with a comma (,). In this case, - /// the metric data will be segmented in the order the dimensions are listed in - /// the parameter. - /// - /// - /// The number of segments to return. This value is only valid when segment is - /// specified. - /// - /// - /// The aggregation function and direction to sort the segments by. This value - /// is only valid when segment is specified. - /// - /// - /// An expression used to filter the results. This value should be a valid - /// OData filter expression where the keys of each clause should be applicable - /// dimensions for the metric you are retrieving. - /// - public static MetricsResult Get(this IMetrics operations, string appId, string metricId, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), IList aggregation = default(IList), IList segment = default(IList), int? top = default(int?), string orderby = default(string), string filter = default(string)) - { - return operations.GetAsync(appId, metricId, timespan, interval, aggregation, segment, top, orderby, filter).GetAwaiter().GetResult(); - } - - /// - /// Retrieve metric data - /// - /// - /// Gets metric values for a single metric - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// ID of the metric. This is either a standard AI metric, or an - /// application-specific custom metric. Possible values include: - /// 'requests/count', 'requests/duration', 'requests/failed', 'users/count', - /// 'users/authenticated', 'pageViews/count', 'pageViews/duration', - /// 'client/processingDuration', 'client/receiveDuration', - /// 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', - /// 'dependencies/count', 'dependencies/failed', 'dependencies/duration', - /// 'exceptions/count', 'exceptions/browser', 'exceptions/server', - /// 'sessions/count', 'performanceCounters/requestExecutionTime', - /// 'performanceCounters/requestsPerSecond', - /// 'performanceCounters/requestsInQueue', - /// 'performanceCounters/memoryAvailableBytes', - /// 'performanceCounters/exceptionsPerSecond', - /// 'performanceCounters/processCpuPercentage', - /// 'performanceCounters/processIOBytesPerSecond', - /// 'performanceCounters/processPrivateBytes', - /// 'performanceCounters/processorCpuPercentage', - /// 'availabilityResults/availabilityPercentage', - /// 'availabilityResults/duration', 'billing/telemetryCount', - /// 'customEvents/count' - /// - /// - /// The timespan over which to retrieve metric values. This is an ISO8601 time - /// period value. If timespan is omitted, a default time range of `PT12H` - /// ("last 12 hours") is used. The actual timespan that is queried may be - /// adjusted by the server based. In all cases, the actual time span used for - /// the query is included in the response. - /// - /// - /// The time interval to use when retrieving metric values. This is an ISO8601 - /// duration. If interval is omitted, the metric value is aggregated across the - /// entire timespan. If interval is supplied, the server may adjust the - /// interval to a more appropriate size based on the timespan used for the - /// query. In all cases, the actual interval used for the query is included in - /// the response. - /// - /// - /// The aggregation to use when computing the metric values. To retrieve more - /// than one aggregation at a time, separate them with a comma. If no - /// aggregation is specified, then the default aggregation for the metric is - /// used. - /// - /// - /// The name of the dimension to segment the metric values by. This dimension - /// must be applicable to the metric you are retrieving. To segment by more - /// than one dimension at a time, separate them with a comma (,). In this case, - /// the metric data will be segmented in the order the dimensions are listed in - /// the parameter. - /// - /// - /// The number of segments to return. This value is only valid when segment is - /// specified. - /// - /// - /// The aggregation function and direction to sort the segments by. This value - /// is only valid when segment is specified. - /// - /// - /// An expression used to filter the results. This value should be a valid - /// OData filter expression where the keys of each clause should be applicable - /// dimensions for the metric you are retrieving. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IMetrics operations, string appId, string metricId, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), IList aggregation = default(IList), IList segment = default(IList), int? top = default(int?), string orderby = default(string), string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(appId, metricId, timespan, interval, aggregation, segment, top, orderby, filter, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieve metric data - /// - /// - /// Gets metric values for multiple metrics - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The batched metrics query. - /// - public static IList GetMultiple(this IMetrics operations, string appId, IList body) - { - return operations.GetMultipleAsync(appId, body).GetAwaiter().GetResult(); - } - - /// - /// Retrieve metric data - /// - /// - /// Gets metric values for multiple metrics - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The batched metrics query. - /// - /// - /// The cancellation token. - /// - public static async Task> GetMultipleAsync(this IMetrics operations, string appId, IList body, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetMultipleWithHttpMessagesAsync(appId, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieve metric metatadata - /// - /// - /// Gets metadata describing the available metrics - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - public static object GetMetadata(this IMetrics operations, string appId) - { - return operations.GetMetadataAsync(appId).GetAwaiter().GetResult(); - } - - /// - /// Retrieve metric metatadata - /// - /// - /// Gets metadata describing the available metrics - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The cancellation token. - /// - public static async Task GetMetadataAsync(this IMetrics operations, string appId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetMetadataWithHttpMessagesAsync(appId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/APIKeyRequest.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/APIKeyRequest.cs new file mode 100644 index 000000000000..f59d679ecb97 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/APIKeyRequest.cs @@ -0,0 +1,71 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Application Insights component API Key creation request definition. + /// + public partial class APIKeyRequest + { + /// + /// Initializes a new instance of the APIKeyRequest class. + /// + public APIKeyRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the APIKeyRequest class. + /// + /// The name of the API Key. + /// The read access rights of this + /// API Key. + /// The write access rights of this + /// API Key. + public APIKeyRequest(string name = default(string), IList linkedReadProperties = default(IList), IList linkedWriteProperties = default(IList)) + { + Name = name; + LinkedReadProperties = linkedReadProperties; + LinkedWriteProperties = linkedWriteProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the API Key. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the read access rights of this API Key. + /// + [JsonProperty(PropertyName = "linkedReadProperties")] + public IList LinkedReadProperties { get; set; } + + /// + /// Gets or sets the write access rights of this API Key. + /// + [JsonProperty(PropertyName = "linkedWriteProperties")] + public IList LinkedWriteProperties { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Annotation.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Annotation.cs new file mode 100644 index 000000000000..0f23f011b794 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Annotation.cs @@ -0,0 +1,93 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Annotation associated with an application insights resource. + /// + public partial class Annotation + { + /// + /// Initializes a new instance of the Annotation class. + /// + public Annotation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Annotation class. + /// + /// Name of annotation + /// Category of annotation, free form + /// Time when event occurred + /// Unique Id for annotation + /// Serialized JSON object for detailed + /// properties + /// Related parent annotation if + /// any + public Annotation(string annotationName = default(string), string category = default(string), System.DateTime? eventTime = default(System.DateTime?), string id = default(string), string properties = default(string), string relatedAnnotation = default(string)) + { + AnnotationName = annotationName; + Category = category; + EventTime = eventTime; + Id = id; + Properties = properties; + RelatedAnnotation = relatedAnnotation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of annotation + /// + [JsonProperty(PropertyName = "AnnotationName")] + public string AnnotationName { get; set; } + + /// + /// Gets or sets category of annotation, free form + /// + [JsonProperty(PropertyName = "Category")] + public string Category { get; set; } + + /// + /// Gets or sets time when event occurred + /// + [JsonProperty(PropertyName = "EventTime")] + public System.DateTime? EventTime { get; set; } + + /// + /// Gets or sets unique Id for annotation + /// + [JsonProperty(PropertyName = "Id")] + public string Id { get; set; } + + /// + /// Gets or sets serialized JSON object for detailed properties + /// + [JsonProperty(PropertyName = "Properties")] + public string Properties { get; set; } + + /// + /// Gets or sets related parent annotation if any + /// + [JsonProperty(PropertyName = "RelatedAnnotation")] + public string RelatedAnnotation { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsTraceInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/AnnotationError.cs similarity index 50% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsTraceInfo.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/AnnotationError.cs index 4f7f3c0774f0..6c19e30c6d96 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsTraceInfo.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/AnnotationError.cs @@ -8,33 +8,35 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { using Newtonsoft.Json; using System.Linq; /// - /// The trace information + /// Error associated with trying to create annotation with Id that already + /// exist /// - public partial class EventsTraceInfo + public partial class AnnotationError { /// - /// Initializes a new instance of the EventsTraceInfo class. + /// Initializes a new instance of the AnnotationError class. /// - public EventsTraceInfo() + public AnnotationError() { CustomInit(); } /// - /// Initializes a new instance of the EventsTraceInfo class. + /// Initializes a new instance of the AnnotationError class. /// - /// The trace message - /// The trace severity level - public EventsTraceInfo(string message = default(string), int? severityLevel = default(int?)) + /// Error detail code and explanation + /// Error message + public AnnotationError(string code = default(string), string message = default(string), InnerError innererror = default(InnerError)) { + Code = code; Message = message; - SeverityLevel = severityLevel; + Innererror = innererror; CustomInit(); } @@ -44,16 +46,21 @@ public EventsTraceInfo() partial void CustomInit(); /// - /// Gets or sets the trace message + /// Gets or sets error detail code and explanation + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets error message /// [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// - /// Gets or sets the trace severity level /// - [JsonProperty(PropertyName = "severityLevel")] - public int? SeverityLevel { get; set; } + [JsonProperty(PropertyName = "innererror")] + public InnerError Innererror { get; set; } } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/AnnotationErrorException.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/AnnotationErrorException.cs new file mode 100644 index 000000000000..fb6e93a77587 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/AnnotationErrorException.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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with AnnotationError + /// information. + /// + public partial class AnnotationErrorException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public AnnotationError Body { get; set; } + + /// + /// Initializes a new instance of the AnnotationErrorException class. + /// + public AnnotationErrorException() + { + } + + /// + /// Initializes a new instance of the AnnotationErrorException class. + /// + /// The exception message. + public AnnotationErrorException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the AnnotationErrorException class. + /// + /// The exception message. + /// Inner exception. + public AnnotationErrorException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponent.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponent.cs new file mode 100644 index 000000000000..1156ea830240 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponent.cs @@ -0,0 +1,227 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Application Insights component definition. + /// + [Rest.Serialization.JsonTransformation] + public partial class ApplicationInsightsComponent : ComponentsResource + { + /// + /// Initializes a new instance of the ApplicationInsightsComponent + /// class. + /// + public ApplicationInsightsComponent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationInsightsComponent + /// class. + /// + /// Resource location + /// The kind of application that this component + /// refers to, used to customize UI. This value is a freeform string, + /// values should typically be one of the following: web, ios, other, + /// store, java, phone. + /// Type of application being monitored. + /// Possible values include: 'web', 'other' + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + /// The unique ID of your application. This + /// field mirrors the 'Name' field and cannot be changed. + /// Application Insights Unique ID for your + /// Application. + /// Used by the Application Insights system to + /// determine what kind of flow this component was created by. This is + /// to be set to 'Bluefield' when creating/updating a component via the + /// REST API. Possible values include: 'Bluefield' + /// Describes what tool created this + /// Application Insights component. Customers using this API should set + /// this to the default 'rest'. Possible values include: 'rest' + /// Application Insights + /// Instrumentation key. A read-only value that applications can use to + /// identify the destination for all telemetry sent to Azure + /// Application Insights. This value will be supplied upon construction + /// of each new Application Insights component. + /// Creation Date for the Application + /// Insights component, in ISO 8601 format. + /// Azure Tenant Id. + /// The unique application ID created when a + /// new application is added to HockeyApp, used for communications with + /// HockeyApp. + /// Token used to authenticate + /// communications with between Application Insights and + /// HockeyApp. + /// Current state of this component: + /// whether or not is has been provisioned within the resource group it + /// is defined. Users cannot change this value but are able to read + /// from it. Values will include Succeeded, Deploying, Canceled, and + /// Failed. + /// Percentage of the data produced by + /// the application being monitored that is being sampled for + /// Application Insights telemetry. + public ApplicationInsightsComponent(string location, string kind, string applicationType, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string applicationId = default(string), string appId = default(string), string flowType = default(string), string requestSource = default(string), string instrumentationKey = default(string), System.DateTime? creationDate = default(System.DateTime?), string tenantId = default(string), string hockeyAppId = default(string), string hockeyAppToken = default(string), string provisioningState = default(string), double? samplingPercentage = default(double?)) + : base(location, id, name, type, tags) + { + Kind = kind; + ApplicationId = applicationId; + AppId = appId; + ApplicationType = applicationType; + FlowType = flowType; + RequestSource = requestSource; + InstrumentationKey = instrumentationKey; + CreationDate = creationDate; + TenantId = tenantId; + HockeyAppId = hockeyAppId; + HockeyAppToken = hockeyAppToken; + ProvisioningState = provisioningState; + SamplingPercentage = samplingPercentage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the kind of application that this component refers to, + /// used to customize UI. This value is a freeform string, values + /// should typically be one of the following: web, ios, other, store, + /// java, phone. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets the unique ID of your application. This field mirrors the + /// 'Name' field and cannot be changed. + /// + [JsonProperty(PropertyName = "properties.ApplicationId")] + public string ApplicationId { get; private set; } + + /// + /// Gets application Insights Unique ID for your Application. + /// + [JsonProperty(PropertyName = "properties.AppId")] + public string AppId { get; private set; } + + /// + /// Gets or sets type of application being monitored. Possible values + /// include: 'web', 'other' + /// + [JsonProperty(PropertyName = "properties.Application_Type")] + public string ApplicationType { get; set; } + + /// + /// Gets or sets used by the Application Insights system to determine + /// what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// Possible values include: 'Bluefield' + /// + [JsonProperty(PropertyName = "properties.Flow_Type")] + public string FlowType { get; set; } + + /// + /// Gets or sets describes what tool created this Application Insights + /// component. Customers using this API should set this to the default + /// 'rest'. Possible values include: 'rest' + /// + [JsonProperty(PropertyName = "properties.Request_Source")] + public string RequestSource { get; set; } + + /// + /// Gets application Insights Instrumentation key. A read-only value + /// that applications can use to identify the destination for all + /// telemetry sent to Azure Application Insights. This value will be + /// supplied upon construction of each new Application Insights + /// component. + /// + [JsonProperty(PropertyName = "properties.InstrumentationKey")] + public string InstrumentationKey { get; private set; } + + /// + /// Gets creation Date for the Application Insights component, in ISO + /// 8601 format. + /// + [JsonProperty(PropertyName = "properties.CreationDate")] + public System.DateTime? CreationDate { get; private set; } + + /// + /// Gets azure Tenant Id. + /// + [JsonProperty(PropertyName = "properties.TenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the unique application ID created when a new + /// application is added to HockeyApp, used for communications with + /// HockeyApp. + /// + [JsonProperty(PropertyName = "properties.HockeyAppId")] + public string HockeyAppId { get; set; } + + /// + /// Gets token used to authenticate communications with between + /// Application Insights and HockeyApp. + /// + [JsonProperty(PropertyName = "properties.HockeyAppToken")] + public string HockeyAppToken { get; private set; } + + /// + /// Gets current state of this component: whether or not is has been + /// provisioned within the resource group it is defined. Users cannot + /// change this value but are able to read from it. Values will include + /// Succeeded, Deploying, Canceled, and Failed. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets percentage of the data produced by the application + /// being monitored that is being sampled for Application Insights + /// telemetry. + /// + [JsonProperty(PropertyName = "properties.SamplingPercentage")] + public double? SamplingPercentage { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Kind == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Kind"); + } + if (ApplicationType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ApplicationType"); + } + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAPIKey.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAPIKey.cs new file mode 100644 index 000000000000..b898c2527e28 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAPIKey.cs @@ -0,0 +1,102 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties that define an API key of an Application Insights Component. + /// + public partial class ApplicationInsightsComponentAPIKey + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentAPIKey class. + /// + public ApplicationInsightsComponentAPIKey() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentAPIKey class. + /// + /// The unique ID of the API key inside an Application + /// Insights component. It is auto generated when the API key is + /// created. + /// The API key value. It will be only return once + /// when the API Key was created. + /// The create date of this API key. + /// The name of the API key. + /// The read access rights of this + /// API Key. + /// The write access rights of this + /// API Key. + public ApplicationInsightsComponentAPIKey(string id = default(string), string apiKey = default(string), string createdDate = default(string), string name = default(string), IList linkedReadProperties = default(IList), IList linkedWriteProperties = default(IList)) + { + Id = id; + ApiKey = apiKey; + CreatedDate = createdDate; + Name = name; + LinkedReadProperties = linkedReadProperties; + LinkedWriteProperties = linkedWriteProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the unique ID of the API key inside an Application Insights + /// component. It is auto generated when the API key is created. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the API key value. It will be only return once when the API + /// Key was created. + /// + [JsonProperty(PropertyName = "apiKey")] + public string ApiKey { get; private set; } + + /// + /// Gets or sets the create date of this API key. + /// + [JsonProperty(PropertyName = "createdDate")] + public string CreatedDate { get; set; } + + /// + /// Gets or sets the name of the API key. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the read access rights of this API Key. + /// + [JsonProperty(PropertyName = "linkedReadProperties")] + public IList LinkedReadProperties { get; set; } + + /// + /// Gets or sets the write access rights of this API Key. + /// + [JsonProperty(PropertyName = "linkedWriteProperties")] + public IList LinkedWriteProperties { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAnalyticsItem.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAnalyticsItem.cs new file mode 100644 index 000000000000..f4fe09df0b87 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAnalyticsItem.cs @@ -0,0 +1,131 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties that define an Analytics item that is associated to an + /// Application Insights component. + /// + public partial class ApplicationInsightsComponentAnalyticsItem + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentAnalyticsItem class. + /// + public ApplicationInsightsComponentAnalyticsItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentAnalyticsItem class. + /// + /// Internally assigned unique id of the item + /// definition. + /// The user-defined name of the item. + /// The content of this item + /// This instance's version of the data model. + /// This can change as new features are added. + /// Enum indicating if this item definition is + /// owned by a specific user or is shared between all users with access + /// to the Application Insights component. Possible values include: + /// 'shared', 'user' + /// Enum indicating the type of the Analytics item. + /// Possible values include: 'query', 'function', 'folder', + /// 'recent' + /// Date and time in UTC when this item was + /// created. + /// Date and time in UTC of the last + /// modification that was made to this item. + public ApplicationInsightsComponentAnalyticsItem(string id = default(string), string name = default(string), string content = default(string), string version = default(string), string scope = default(string), string type = default(string), string timeCreated = default(string), string timeModified = default(string), ApplicationInsightsComponentAnalyticsItemProperties properties = default(ApplicationInsightsComponentAnalyticsItemProperties)) + { + Id = id; + Name = name; + Content = content; + Version = version; + Scope = scope; + Type = type; + TimeCreated = timeCreated; + TimeModified = timeModified; + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets internally assigned unique id of the item definition. + /// + [JsonProperty(PropertyName = "Id")] + public string Id { get; set; } + + /// + /// Gets or sets the user-defined name of the item. + /// + [JsonProperty(PropertyName = "Name")] + public string Name { get; set; } + + /// + /// Gets or sets the content of this item + /// + [JsonProperty(PropertyName = "Content")] + public string Content { get; set; } + + /// + /// Gets this instance's version of the data model. This can change as + /// new features are added. + /// + [JsonProperty(PropertyName = "Version")] + public string Version { get; private set; } + + /// + /// Gets or sets enum indicating if this item definition is owned by a + /// specific user or is shared between all users with access to the + /// Application Insights component. Possible values include: 'shared', + /// 'user' + /// + [JsonProperty(PropertyName = "Scope")] + public string Scope { get; set; } + + /// + /// Gets or sets enum indicating the type of the Analytics item. + /// Possible values include: 'query', 'function', 'folder', 'recent' + /// + [JsonProperty(PropertyName = "Type")] + public string Type { get; set; } + + /// + /// Gets date and time in UTC when this item was created. + /// + [JsonProperty(PropertyName = "TimeCreated")] + public string TimeCreated { get; private set; } + + /// + /// Gets date and time in UTC of the last modification that was made to + /// this item. + /// + [JsonProperty(PropertyName = "TimeModified")] + public string TimeModified { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "Properties")] + public ApplicationInsightsComponentAnalyticsItemProperties Properties { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAnalyticsItemProperties.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAnalyticsItemProperties.cs new file mode 100644 index 000000000000..a9eb6b1a2063 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAnalyticsItemProperties.cs @@ -0,0 +1,56 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A set of properties that can be defined in the context of a specific + /// item type. Each type may have its own properties. + /// + public partial class ApplicationInsightsComponentAnalyticsItemProperties + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentAnalyticsItemProperties class. + /// + public ApplicationInsightsComponentAnalyticsItemProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentAnalyticsItemProperties class. + /// + /// A function alias, used when the type of + /// the item is Function + public ApplicationInsightsComponentAnalyticsItemProperties(string functionAlias = default(string)) + { + FunctionAlias = functionAlias; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a function alias, used when the type of the item is + /// Function + /// + [JsonProperty(PropertyName = "functionAlias")] + public string FunctionAlias { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAvailableFeatures.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAvailableFeatures.cs new file mode 100644 index 000000000000..2c0aa2d8411c --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentAvailableFeatures.cs @@ -0,0 +1,56 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Application Insights component available features. + /// + public partial class ApplicationInsightsComponentAvailableFeatures + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentAvailableFeatures class. + /// + public ApplicationInsightsComponentAvailableFeatures() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentAvailableFeatures class. + /// + /// A list of Application Insights component + /// feature. + public ApplicationInsightsComponentAvailableFeatures(IList result = default(IList)) + { + Result = result; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a list of Application Insights component feature. + /// + [JsonProperty(PropertyName = "Result")] + public IList Result { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentBillingFeatures.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentBillingFeatures.cs new file mode 100644 index 000000000000..27c4f3f8b9a0 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentBillingFeatures.cs @@ -0,0 +1,69 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Application Insights component billing features + /// + public partial class ApplicationInsightsComponentBillingFeatures + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentBillingFeatures class. + /// + public ApplicationInsightsComponentBillingFeatures() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentBillingFeatures class. + /// + /// An Application Insights component daily + /// data volume cap + /// Current enabled pricing plan. + /// When the component is in the Enterprise plan, this will list both + /// 'Basic' and 'Application Insights Enterprise'. + public ApplicationInsightsComponentBillingFeatures(ApplicationInsightsComponentDataVolumeCap dataVolumeCap = default(ApplicationInsightsComponentDataVolumeCap), IList currentBillingFeatures = default(IList)) + { + DataVolumeCap = dataVolumeCap; + CurrentBillingFeatures = currentBillingFeatures; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets an Application Insights component daily data volume + /// cap + /// + [JsonProperty(PropertyName = "DataVolumeCap")] + public ApplicationInsightsComponentDataVolumeCap DataVolumeCap { get; set; } + + /// + /// Gets or sets current enabled pricing plan. When the component is in + /// the Enterprise plan, this will list both 'Basic' and 'Application + /// Insights Enterprise'. + /// + [JsonProperty(PropertyName = "CurrentBillingFeatures")] + public IList CurrentBillingFeatures { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentDataVolumeCap.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentDataVolumeCap.cs new file mode 100644 index 000000000000..8492b7665344 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentDataVolumeCap.cs @@ -0,0 +1,99 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Application Insights component daily data volume cap + /// + public partial class ApplicationInsightsComponentDataVolumeCap + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentDataVolumeCap class. + /// + public ApplicationInsightsComponentDataVolumeCap() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentDataVolumeCap class. + /// + /// Daily data volume cap in GB. + /// Daily data volume cap UTC reset + /// hour. + /// Reserved, not used for now. + /// Reserved, not + /// used for now. + /// Do not send a + /// notification email when the daily data volume cap is met. + /// Maximum daily data volume cap that the + /// user can set for this component. + public ApplicationInsightsComponentDataVolumeCap(double? cap = default(double?), int? resetTime = default(int?), int? warningThreshold = default(int?), bool? stopSendNotificationWhenHitThreshold = default(bool?), bool? stopSendNotificationWhenHitCap = default(bool?), double? maxHistoryCap = default(double?)) + { + Cap = cap; + ResetTime = resetTime; + WarningThreshold = warningThreshold; + StopSendNotificationWhenHitThreshold = stopSendNotificationWhenHitThreshold; + StopSendNotificationWhenHitCap = stopSendNotificationWhenHitCap; + MaxHistoryCap = maxHistoryCap; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets daily data volume cap in GB. + /// + [JsonProperty(PropertyName = "Cap")] + public double? Cap { get; set; } + + /// + /// Gets daily data volume cap UTC reset hour. + /// + [JsonProperty(PropertyName = "ResetTime")] + public int? ResetTime { get; private set; } + + /// + /// Gets or sets reserved, not used for now. + /// + [JsonProperty(PropertyName = "WarningThreshold")] + public int? WarningThreshold { get; set; } + + /// + /// Gets or sets reserved, not used for now. + /// + [JsonProperty(PropertyName = "StopSendNotificationWhenHitThreshold")] + public bool? StopSendNotificationWhenHitThreshold { get; set; } + + /// + /// Gets or sets do not send a notification email when the daily data + /// volume cap is met. + /// + [JsonProperty(PropertyName = "StopSendNotificationWhenHitCap")] + public bool? StopSendNotificationWhenHitCap { get; set; } + + /// + /// Gets maximum daily data volume cap that the user can set for this + /// component. + /// + [JsonProperty(PropertyName = "MaxHistoryCap")] + public double? MaxHistoryCap { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentExportConfiguration.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentExportConfiguration.cs new file mode 100644 index 000000000000..f72147caec09 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentExportConfiguration.cs @@ -0,0 +1,234 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties that define a Continuous Export configuration. + /// + public partial class ApplicationInsightsComponentExportConfiguration + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentExportConfiguration class. + /// + public ApplicationInsightsComponentExportConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentExportConfiguration class. + /// + /// The unique ID of the export configuration + /// inside an Application Insights component. It is auto generated when + /// the Continuous Export configuration is created. + /// The instrumentation key of the + /// Application Insights component. + /// This comma separated list of document + /// types that will be exported. The possible values include + /// 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', + /// 'PageViewPerformance', 'Rdd', 'PerformanceCounters', + /// 'Availability', 'Messages'. + /// The name of the Application Insights + /// component. + /// The subscription of the Application + /// Insights component. + /// The resource group of the Application + /// Insights component. + /// The destination + /// storage account subscription ID. + /// The destination account + /// location ID. + /// The name of destination + /// account. + /// The destination type. + /// This will be 'true' if the Continuous + /// Export configuration is enabled, otherwise it will be + /// 'false'. + /// Last time the Continuous Export + /// configuration was updated. + /// Deprecated + /// This indicates current Continuous Export + /// configuration status. The possible values are 'Preparing', + /// 'Success', 'Failure'. + /// The last time data was successfully + /// delivered to the destination storage container for this Continuous + /// Export configuration. + /// The last time the Continuous Export + /// configuration started failing. + /// This is the reason the + /// Continuous Export configuration started failing. It can be + /// 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. + /// The name of the destination storage + /// account. + /// The name of the destination storage + /// container. + public ApplicationInsightsComponentExportConfiguration(string exportId = default(string), string instrumentationKey = default(string), string recordTypes = default(string), string applicationName = default(string), string subscriptionId = default(string), string resourceGroup = default(string), string destinationStorageSubscriptionId = default(string), string destinationStorageLocationId = default(string), string destinationAccountId = default(string), string destinationType = default(string), string isUserEnabled = default(string), string lastUserUpdate = default(string), string notificationQueueEnabled = default(string), string exportStatus = default(string), string lastSuccessTime = default(string), string lastGapTime = default(string), string permanentErrorReason = default(string), string storageName = default(string), string containerName = default(string)) + { + ExportId = exportId; + InstrumentationKey = instrumentationKey; + RecordTypes = recordTypes; + ApplicationName = applicationName; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + DestinationStorageSubscriptionId = destinationStorageSubscriptionId; + DestinationStorageLocationId = destinationStorageLocationId; + DestinationAccountId = destinationAccountId; + DestinationType = destinationType; + IsUserEnabled = isUserEnabled; + LastUserUpdate = lastUserUpdate; + NotificationQueueEnabled = notificationQueueEnabled; + ExportStatus = exportStatus; + LastSuccessTime = lastSuccessTime; + LastGapTime = lastGapTime; + PermanentErrorReason = permanentErrorReason; + StorageName = storageName; + ContainerName = containerName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the unique ID of the export configuration inside an + /// Application Insights component. It is auto generated when the + /// Continuous Export configuration is created. + /// + [JsonProperty(PropertyName = "ExportId")] + public string ExportId { get; private set; } + + /// + /// Gets the instrumentation key of the Application Insights component. + /// + [JsonProperty(PropertyName = "InstrumentationKey")] + public string InstrumentationKey { get; private set; } + + /// + /// Gets or sets this comma separated list of document types that will + /// be exported. The possible values include 'Requests', 'Event', + /// 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + /// 'PerformanceCounters', 'Availability', 'Messages'. + /// + [JsonProperty(PropertyName = "RecordTypes")] + public string RecordTypes { get; set; } + + /// + /// Gets the name of the Application Insights component. + /// + [JsonProperty(PropertyName = "ApplicationName")] + public string ApplicationName { get; private set; } + + /// + /// Gets the subscription of the Application Insights component. + /// + [JsonProperty(PropertyName = "SubscriptionId")] + public string SubscriptionId { get; private set; } + + /// + /// Gets the resource group of the Application Insights component. + /// + [JsonProperty(PropertyName = "ResourceGroup")] + public string ResourceGroup { get; private set; } + + /// + /// Gets the destination storage account subscription ID. + /// + [JsonProperty(PropertyName = "DestinationStorageSubscriptionId")] + public string DestinationStorageSubscriptionId { get; private set; } + + /// + /// Gets the destination account location ID. + /// + [JsonProperty(PropertyName = "DestinationStorageLocationId")] + public string DestinationStorageLocationId { get; private set; } + + /// + /// Gets the name of destination account. + /// + [JsonProperty(PropertyName = "DestinationAccountId")] + public string DestinationAccountId { get; private set; } + + /// + /// Gets the destination type. + /// + [JsonProperty(PropertyName = "DestinationType")] + public string DestinationType { get; private set; } + + /// + /// Gets this will be 'true' if the Continuous Export configuration is + /// enabled, otherwise it will be 'false'. + /// + [JsonProperty(PropertyName = "IsUserEnabled")] + public string IsUserEnabled { get; private set; } + + /// + /// Gets last time the Continuous Export configuration was updated. + /// + [JsonProperty(PropertyName = "LastUserUpdate")] + public string LastUserUpdate { get; private set; } + + /// + /// Gets or sets deprecated + /// + [JsonProperty(PropertyName = "NotificationQueueEnabled")] + public string NotificationQueueEnabled { get; set; } + + /// + /// Gets this indicates current Continuous Export configuration status. + /// The possible values are 'Preparing', 'Success', 'Failure'. + /// + [JsonProperty(PropertyName = "ExportStatus")] + public string ExportStatus { get; private set; } + + /// + /// Gets the last time data was successfully delivered to the + /// destination storage container for this Continuous Export + /// configuration. + /// + [JsonProperty(PropertyName = "LastSuccessTime")] + public string LastSuccessTime { get; private set; } + + /// + /// Gets the last time the Continuous Export configuration started + /// failing. + /// + [JsonProperty(PropertyName = "LastGapTime")] + public string LastGapTime { get; private set; } + + /// + /// Gets this is the reason the Continuous Export configuration started + /// failing. It can be 'AzureStorageNotFound' or + /// 'AzureStorageAccessDenied'. + /// + [JsonProperty(PropertyName = "PermanentErrorReason")] + public string PermanentErrorReason { get; private set; } + + /// + /// Gets the name of the destination storage account. + /// + [JsonProperty(PropertyName = "StorageName")] + public string StorageName { get; private set; } + + /// + /// Gets the name of the destination storage container. + /// + [JsonProperty(PropertyName = "ContainerName")] + public string ContainerName { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentExportRequest.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentExportRequest.cs new file mode 100644 index 000000000000..103e9334fde2 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentExportRequest.cs @@ -0,0 +1,134 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Application Insights component Continuous Export configuration + /// request definition. + /// + public partial class ApplicationInsightsComponentExportRequest + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentExportRequest class. + /// + public ApplicationInsightsComponentExportRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentExportRequest class. + /// + /// The document types to be exported, as + /// comma separated values. Allowed values include 'Requests', 'Event', + /// 'Exceptions', 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + /// 'PerformanceCounters', 'Availability', 'Messages'. + /// The Continuous Export destination + /// type. This has to be 'Blob'. + /// The SAS URL for the destination + /// storage container. It must grant write permission. + /// Set to 'true' to create a Continuous Export + /// configuration as enabled, otherwise set it to 'false'. + /// Deprecated + /// Deprecated + /// The subscription ID + /// of the destination storage container. + /// The location ID of the + /// destination storage container. + /// The name of destination storage + /// account. + public ApplicationInsightsComponentExportRequest(string recordTypes = default(string), string destinationType = default(string), string destinationAddress = default(string), string isEnabled = default(string), string notificationQueueEnabled = default(string), string notificationQueueUri = default(string), string destinationStorageSubscriptionId = default(string), string destinationStorageLocationId = default(string), string destinationAccountId = default(string)) + { + RecordTypes = recordTypes; + DestinationType = destinationType; + DestinationAddress = destinationAddress; + IsEnabled = isEnabled; + NotificationQueueEnabled = notificationQueueEnabled; + NotificationQueueUri = notificationQueueUri; + DestinationStorageSubscriptionId = destinationStorageSubscriptionId; + DestinationStorageLocationId = destinationStorageLocationId; + DestinationAccountId = destinationAccountId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the document types to be exported, as comma separated + /// values. Allowed values include 'Requests', 'Event', 'Exceptions', + /// 'Metrics', 'PageViews', 'PageViewPerformance', 'Rdd', + /// 'PerformanceCounters', 'Availability', 'Messages'. + /// + [JsonProperty(PropertyName = "RecordTypes")] + public string RecordTypes { get; set; } + + /// + /// Gets or sets the Continuous Export destination type. This has to be + /// 'Blob'. + /// + [JsonProperty(PropertyName = "DestinationType")] + public string DestinationType { get; set; } + + /// + /// Gets or sets the SAS URL for the destination storage container. It + /// must grant write permission. + /// + [JsonProperty(PropertyName = "DestinationAddress")] + public string DestinationAddress { get; set; } + + /// + /// Gets or sets set to 'true' to create a Continuous Export + /// configuration as enabled, otherwise set it to 'false'. + /// + [JsonProperty(PropertyName = "IsEnabled")] + public string IsEnabled { get; set; } + + /// + /// Gets or sets deprecated + /// + [JsonProperty(PropertyName = "NotificationQueueEnabled")] + public string NotificationQueueEnabled { get; set; } + + /// + /// Gets or sets deprecated + /// + [JsonProperty(PropertyName = "NotificationQueueUri")] + public string NotificationQueueUri { get; set; } + + /// + /// Gets or sets the subscription ID of the destination storage + /// container. + /// + [JsonProperty(PropertyName = "DestinationStorageSubscriptionId")] + public string DestinationStorageSubscriptionId { get; set; } + + /// + /// Gets or sets the location ID of the destination storage container. + /// + [JsonProperty(PropertyName = "DestinationStorageLocationId")] + public string DestinationStorageLocationId { get; set; } + + /// + /// Gets or sets the name of destination storage account. + /// + [JsonProperty(PropertyName = "DestinationAccountId")] + public string DestinationAccountId { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFavorite.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFavorite.cs new file mode 100644 index 000000000000..8356da1aa70d --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFavorite.cs @@ -0,0 +1,162 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties that define a favorite that is associated to an Application + /// Insights component. + /// + public partial class ApplicationInsightsComponentFavorite + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentFavorite class. + /// + public ApplicationInsightsComponentFavorite() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentFavorite class. + /// + /// The user-defined name of the favorite. + /// Configuration of this particular favorite, + /// which are driven by the Azure portal UX. Configuration data is a + /// string containing valid JSON + /// This instance's version of the data model. + /// This can change as new features are added that can be marked + /// favorite. Current examples include MetricsExplorer (ME) and + /// Search. + /// Internally assigned unique id of the + /// favorite definition. + /// Enum indicating if this favorite + /// definition is owned by a specific user or is shared between all + /// users with access to the Application Insights component. Possible + /// values include: 'shared', 'user' + /// The source of the favorite + /// definition. + /// Date and time in UTC of the last + /// modification that was made to this favorite definition. + /// A list of 0 or more tags that are associated + /// with this favorite definition + /// Favorite category, as defined by the user at + /// creation time. + /// Flag denoting wether or not + /// this favorite was generated from a template. + /// Unique user id of the specific user that owns + /// this favorite. + public ApplicationInsightsComponentFavorite(string name = default(string), string config = default(string), string version = default(string), string favoriteId = default(string), FavoriteType? favoriteType = default(FavoriteType?), string sourceType = default(string), string timeModified = default(string), IList tags = default(IList), string category = default(string), bool? isGeneratedFromTemplate = default(bool?), string userId = default(string)) + { + Name = name; + Config = config; + Version = version; + FavoriteId = favoriteId; + FavoriteType = favoriteType; + SourceType = sourceType; + TimeModified = timeModified; + Tags = tags; + Category = category; + IsGeneratedFromTemplate = isGeneratedFromTemplate; + UserId = userId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the user-defined name of the favorite. + /// + [JsonProperty(PropertyName = "Name")] + public string Name { get; set; } + + /// + /// Gets or sets configuration of this particular favorite, which are + /// driven by the Azure portal UX. Configuration data is a string + /// containing valid JSON + /// + [JsonProperty(PropertyName = "Config")] + public string Config { get; set; } + + /// + /// Gets or sets this instance's version of the data model. This can + /// change as new features are added that can be marked favorite. + /// Current examples include MetricsExplorer (ME) and Search. + /// + [JsonProperty(PropertyName = "Version")] + public string Version { get; set; } + + /// + /// Gets internally assigned unique id of the favorite definition. + /// + [JsonProperty(PropertyName = "FavoriteId")] + public string FavoriteId { get; private set; } + + /// + /// Gets or sets enum indicating if this favorite definition is owned + /// by a specific user or is shared between all users with access to + /// the Application Insights component. Possible values include: + /// 'shared', 'user' + /// + [JsonProperty(PropertyName = "FavoriteType")] + public FavoriteType? FavoriteType { get; set; } + + /// + /// Gets or sets the source of the favorite definition. + /// + [JsonProperty(PropertyName = "SourceType")] + public string SourceType { get; set; } + + /// + /// Gets date and time in UTC of the last modification that was made to + /// this favorite definition. + /// + [JsonProperty(PropertyName = "TimeModified")] + public string TimeModified { get; private set; } + + /// + /// Gets or sets a list of 0 or more tags that are associated with this + /// favorite definition + /// + [JsonProperty(PropertyName = "Tags")] + public IList Tags { get; set; } + + /// + /// Gets or sets favorite category, as defined by the user at creation + /// time. + /// + [JsonProperty(PropertyName = "Category")] + public string Category { get; set; } + + /// + /// Gets or sets flag denoting wether or not this favorite was + /// generated from a template. + /// + [JsonProperty(PropertyName = "IsGeneratedFromTemplate")] + public bool? IsGeneratedFromTemplate { get; set; } + + /// + /// Gets unique user id of the specific user that owns this favorite. + /// + [JsonProperty(PropertyName = "UserId")] + public string UserId { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeature.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeature.cs new file mode 100644 index 000000000000..7d779fdac849 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeature.cs @@ -0,0 +1,123 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Application Insights component daily data volume cap status + /// + public partial class ApplicationInsightsComponentFeature + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentFeature class. + /// + public ApplicationInsightsComponentFeature() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentFeature class. + /// + /// The pricing feature name. + /// The meter id used for the feature. + /// The meter rate for the feature's + /// meter. + /// Reserved, not used now. + /// Reserved, not used now. + /// A list of Application Insights component + /// feature capability. + /// Display name of the feature. + /// Whether can apply addon feature on to + /// it. + /// The add on features on main + /// feature. + public ApplicationInsightsComponentFeature(string featureName = default(string), string meterId = default(string), string meterRateFrequency = default(string), string resouceId = default(string), bool? isHidden = default(bool?), IList capabilities = default(IList), string title = default(string), bool? isMainFeature = default(bool?), string supportedAddonFeatures = default(string)) + { + FeatureName = featureName; + MeterId = meterId; + MeterRateFrequency = meterRateFrequency; + ResouceId = resouceId; + IsHidden = isHidden; + Capabilities = capabilities; + Title = title; + IsMainFeature = isMainFeature; + SupportedAddonFeatures = supportedAddonFeatures; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the pricing feature name. + /// + [JsonProperty(PropertyName = "FeatureName")] + public string FeatureName { get; private set; } + + /// + /// Gets the meter id used for the feature. + /// + [JsonProperty(PropertyName = "MeterId")] + public string MeterId { get; private set; } + + /// + /// Gets the meter rate for the feature's meter. + /// + [JsonProperty(PropertyName = "MeterRateFrequency")] + public string MeterRateFrequency { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "ResouceId")] + public string ResouceId { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "IsHidden")] + public bool? IsHidden { get; private set; } + + /// + /// Gets a list of Application Insights component feature capability. + /// + [JsonProperty(PropertyName = "Capabilities")] + public IList Capabilities { get; private set; } + + /// + /// Gets display name of the feature. + /// + [JsonProperty(PropertyName = "Title")] + public string Title { get; private set; } + + /// + /// Gets whether can apply addon feature on to it. + /// + [JsonProperty(PropertyName = "IsMainFeature")] + public bool? IsMainFeature { get; private set; } + + /// + /// Gets the add on features on main feature. + /// + [JsonProperty(PropertyName = "SupportedAddonFeatures")] + public string SupportedAddonFeatures { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeatureCapabilities.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeatureCapabilities.cs new file mode 100644 index 000000000000..5a7b1dcbf1f2 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeatureCapabilities.cs @@ -0,0 +1,178 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Application Insights component feature capabilities + /// + public partial class ApplicationInsightsComponentFeatureCapabilities + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentFeatureCapabilities class. + /// + public ApplicationInsightsComponentFeatureCapabilities() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentFeatureCapabilities class. + /// + /// Whether allow to use continuous + /// export feature. + /// Reserved, not used now. + /// Reserved, not used now. + /// Reserved, not used now. + /// Reserved, not used now. + /// Whether allow to use work item + /// integration feature. + /// Reserved, not used now. + /// Reserved, not used now. + /// Reserved, not used now. + /// Reserved, not used now. + /// Whether allow to use multiple + /// steps web test feature. + /// Reserved, not used now. + /// The application insights component used + /// tracking type. + /// Daily data volume cap in GB. + /// Daily data volume cap UTC reset + /// hour. + /// Reserved, not used now. + public ApplicationInsightsComponentFeatureCapabilities(bool? supportExportData = default(bool?), string burstThrottlePolicy = default(string), string metadataClass = default(string), bool? liveStreamMetrics = default(bool?), bool? applicationMap = default(bool?), bool? workItemIntegration = default(bool?), bool? powerBIIntegration = default(bool?), bool? openSchema = default(bool?), bool? proactiveDetection = default(bool?), bool? analyticsIntegration = default(bool?), bool? multipleStepWebTest = default(bool?), string apiAccessLevel = default(string), string trackingType = default(string), double? dailyCap = default(double?), double? dailyCapResetTime = default(double?), double? throttleRate = default(double?)) + { + SupportExportData = supportExportData; + BurstThrottlePolicy = burstThrottlePolicy; + MetadataClass = metadataClass; + LiveStreamMetrics = liveStreamMetrics; + ApplicationMap = applicationMap; + WorkItemIntegration = workItemIntegration; + PowerBIIntegration = powerBIIntegration; + OpenSchema = openSchema; + ProactiveDetection = proactiveDetection; + AnalyticsIntegration = analyticsIntegration; + MultipleStepWebTest = multipleStepWebTest; + ApiAccessLevel = apiAccessLevel; + TrackingType = trackingType; + DailyCap = dailyCap; + DailyCapResetTime = dailyCapResetTime; + ThrottleRate = throttleRate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets whether allow to use continuous export feature. + /// + [JsonProperty(PropertyName = "SupportExportData")] + public bool? SupportExportData { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "BurstThrottlePolicy")] + public string BurstThrottlePolicy { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "MetadataClass")] + public string MetadataClass { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "LiveStreamMetrics")] + public bool? LiveStreamMetrics { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "ApplicationMap")] + public bool? ApplicationMap { get; private set; } + + /// + /// Gets whether allow to use work item integration feature. + /// + [JsonProperty(PropertyName = "WorkItemIntegration")] + public bool? WorkItemIntegration { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "PowerBIIntegration")] + public bool? PowerBIIntegration { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "OpenSchema")] + public bool? OpenSchema { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "ProactiveDetection")] + public bool? ProactiveDetection { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "AnalyticsIntegration")] + public bool? AnalyticsIntegration { get; private set; } + + /// + /// Gets whether allow to use multiple steps web test feature. + /// + [JsonProperty(PropertyName = "MultipleStepWebTest")] + public bool? MultipleStepWebTest { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "ApiAccessLevel")] + public string ApiAccessLevel { get; private set; } + + /// + /// Gets the application insights component used tracking type. + /// + [JsonProperty(PropertyName = "TrackingType")] + public string TrackingType { get; private set; } + + /// + /// Gets daily data volume cap in GB. + /// + [JsonProperty(PropertyName = "DailyCap")] + public double? DailyCap { get; private set; } + + /// + /// Gets daily data volume cap UTC reset hour. + /// + [JsonProperty(PropertyName = "DailyCapResetTime")] + public double? DailyCapResetTime { get; private set; } + + /// + /// Gets reserved, not used now. + /// + [JsonProperty(PropertyName = "ThrottleRate")] + public double? ThrottleRate { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeatureCapability.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeatureCapability.cs new file mode 100644 index 000000000000..8725afb35bb5 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentFeatureCapability.cs @@ -0,0 +1,95 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Application Insights component feature capability + /// + public partial class ApplicationInsightsComponentFeatureCapability + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentFeatureCapability class. + /// + public ApplicationInsightsComponentFeatureCapability() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentFeatureCapability class. + /// + /// The name of the capability. + /// The description of the + /// capability. + /// The value of the capability. + /// The unit of the capability. + /// The meter used for the capability. + /// The meter rate of the + /// meter. + public ApplicationInsightsComponentFeatureCapability(string name = default(string), string description = default(string), string value = default(string), string unit = default(string), string meterId = default(string), string meterRateFrequency = default(string)) + { + Name = name; + Description = description; + Value = value; + Unit = unit; + MeterId = meterId; + MeterRateFrequency = meterRateFrequency; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of the capability. + /// + [JsonProperty(PropertyName = "Name")] + public string Name { get; private set; } + + /// + /// Gets the description of the capability. + /// + [JsonProperty(PropertyName = "Description")] + public string Description { get; private set; } + + /// + /// Gets the value of the capability. + /// + [JsonProperty(PropertyName = "Value")] + public string Value { get; private set; } + + /// + /// Gets the unit of the capability. + /// + [JsonProperty(PropertyName = "Unit")] + public string Unit { get; private set; } + + /// + /// Gets the meter used for the capability. + /// + [JsonProperty(PropertyName = "MeterId")] + public string MeterId { get; private set; } + + /// + /// Gets the meter rate of the meter. + /// + [JsonProperty(PropertyName = "MeterRateFrequency")] + public string MeterRateFrequency { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentProactiveDetectionConfiguration.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentProactiveDetectionConfiguration.cs new file mode 100644 index 000000000000..5b5eb49a6b8e --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentProactiveDetectionConfiguration.cs @@ -0,0 +1,107 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties that define a ProactiveDetection configuration. + /// + public partial class ApplicationInsightsComponentProactiveDetectionConfiguration : IResource + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentProactiveDetectionConfiguration class. + /// + public ApplicationInsightsComponentProactiveDetectionConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentProactiveDetectionConfiguration class. + /// + /// The rule name + /// A flag that indicates whether this rule is + /// enabled by the user + /// A flag that indicated + /// whether notifications on this rule should be sent to subscription + /// owners + /// Custom email addresses for this rule + /// notifications + /// The last time this rule was + /// updated + /// Static definitions of the + /// ProactiveDetection configuration rule (same values for all + /// components). + public ApplicationInsightsComponentProactiveDetectionConfiguration(string name = default(string), bool? enabled = default(bool?), bool? sendEmailsToSubscriptionOwners = default(bool?), IList customEmails = default(IList), string lastUpdatedTime = default(string), ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions ruleDefinitions = default(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions)) + { + Name = name; + Enabled = enabled; + SendEmailsToSubscriptionOwners = sendEmailsToSubscriptionOwners; + CustomEmails = customEmails; + LastUpdatedTime = lastUpdatedTime; + RuleDefinitions = ruleDefinitions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the rule name + /// + [JsonProperty(PropertyName = "Name")] + public string Name { get; set; } + + /// + /// Gets or sets a flag that indicates whether this rule is enabled by + /// the user + /// + [JsonProperty(PropertyName = "Enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets a flag that indicated whether notifications on this + /// rule should be sent to subscription owners + /// + [JsonProperty(PropertyName = "SendEmailsToSubscriptionOwners")] + public bool? SendEmailsToSubscriptionOwners { get; set; } + + /// + /// Gets or sets custom email addresses for this rule notifications + /// + [JsonProperty(PropertyName = "CustomEmails")] + public IList CustomEmails { get; set; } + + /// + /// Gets or sets the last time this rule was updated + /// + [JsonProperty(PropertyName = "LastUpdatedTime")] + public string LastUpdatedTime { get; set; } + + /// + /// Gets or sets static definitions of the ProactiveDetection + /// configuration rule (same values for all components). + /// + [JsonProperty(PropertyName = "RuleDefinitions")] + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions RuleDefinitions { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.cs new file mode 100644 index 000000000000..7fe4fe181470 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions.cs @@ -0,0 +1,123 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Static definitions of the ProactiveDetection configuration rule (same + /// values for all components). + /// + public partial class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + /// class. + /// + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions + /// class. + /// + /// The rule name + /// The rule name as it is displayed in + /// UI + /// The rule description + /// URL which displays additional info about the + /// proactive detection rule + /// A flag indicating whether the rule is hidden + /// (from the UI) + /// A flag indicating whether the rule + /// is enabled by default + /// A flag indicating whether the rule is in + /// preview + /// A flag indicating whether + /// email notifications are supported for detections for this + /// rule + public ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(string name = default(string), string displayName = default(string), string description = default(string), string helpUrl = default(string), bool? isHidden = default(bool?), bool? isEnabledByDefault = default(bool?), bool? isInPreview = default(bool?), bool? supportsEmailNotifications = default(bool?)) + { + Name = name; + DisplayName = displayName; + Description = description; + HelpUrl = helpUrl; + IsHidden = isHidden; + IsEnabledByDefault = isEnabledByDefault; + IsInPreview = isInPreview; + SupportsEmailNotifications = supportsEmailNotifications; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the rule name + /// + [JsonProperty(PropertyName = "Name")] + public string Name { get; set; } + + /// + /// Gets or sets the rule name as it is displayed in UI + /// + [JsonProperty(PropertyName = "DisplayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the rule description + /// + [JsonProperty(PropertyName = "Description")] + public string Description { get; set; } + + /// + /// Gets or sets URL which displays additional info about the proactive + /// detection rule + /// + [JsonProperty(PropertyName = "HelpUrl")] + public string HelpUrl { get; set; } + + /// + /// Gets or sets a flag indicating whether the rule is hidden (from the + /// UI) + /// + [JsonProperty(PropertyName = "IsHidden")] + public bool? IsHidden { get; set; } + + /// + /// Gets or sets a flag indicating whether the rule is enabled by + /// default + /// + [JsonProperty(PropertyName = "IsEnabledByDefault")] + public bool? IsEnabledByDefault { get; set; } + + /// + /// Gets or sets a flag indicating whether the rule is in preview + /// + [JsonProperty(PropertyName = "IsInPreview")] + public bool? IsInPreview { get; set; } + + /// + /// Gets or sets a flag indicating whether email notifications are + /// supported for detections for this rule + /// + [JsonProperty(PropertyName = "SupportsEmailNotifications")] + public bool? SupportsEmailNotifications { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentQuotaStatus.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentQuotaStatus.cs new file mode 100644 index 000000000000..8fe7951dc36e --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentQuotaStatus.cs @@ -0,0 +1,74 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An Application Insights component daily data volume cap status + /// + public partial class ApplicationInsightsComponentQuotaStatus + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentQuotaStatus class. + /// + public ApplicationInsightsComponentQuotaStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentQuotaStatus class. + /// + /// The Application ID for the Application Insights + /// component. + /// The daily data volume cap is met, + /// and data ingestion will be stopped. + /// Date and time when the daily data + /// volume cap will be reset, and data ingestion will resume. + public ApplicationInsightsComponentQuotaStatus(string appId = default(string), bool? shouldBeThrottled = default(bool?), string expirationTime = default(string)) + { + AppId = appId; + ShouldBeThrottled = shouldBeThrottled; + ExpirationTime = expirationTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the Application ID for the Application Insights component. + /// + [JsonProperty(PropertyName = "AppId")] + public string AppId { get; private set; } + + /// + /// Gets the daily data volume cap is met, and data ingestion will be + /// stopped. + /// + [JsonProperty(PropertyName = "ShouldBeThrottled")] + public bool? ShouldBeThrottled { get; private set; } + + /// + /// Gets date and time when the daily data volume cap will be reset, + /// and data ingestion will resume. + /// + [JsonProperty(PropertyName = "ExpirationTime")] + public string ExpirationTime { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentWebTestLocation.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentWebTestLocation.cs new file mode 100644 index 000000000000..896db3859aba --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationInsightsComponentWebTestLocation.cs @@ -0,0 +1,64 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties that define a web test location available to an Application + /// Insights Component. + /// + public partial class ApplicationInsightsComponentWebTestLocation + { + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentWebTestLocation class. + /// + public ApplicationInsightsComponentWebTestLocation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationInsightsComponentWebTestLocation class. + /// + /// The display name of the web test + /// location. + /// Internally defined geographic location + /// tag. + public ApplicationInsightsComponentWebTestLocation(string displayName = default(string), string tag = default(string)) + { + DisplayName = displayName; + Tag = tag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the display name of the web test location. + /// + [JsonProperty(PropertyName = "DisplayName")] + public string DisplayName { get; private set; } + + /// + /// Gets internally defined geographic location tag. + /// + [JsonProperty(PropertyName = "Tag")] + public string Tag { get; private set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsAggregation.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationType.cs similarity index 50% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsAggregation.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationType.cs index c667cc0575b3..d381307a1069 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsAggregation.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ApplicationType.cs @@ -8,19 +8,15 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { /// - /// Defines values for MetricsAggregation. + /// Defines values for ApplicationType. /// - public static class MetricsAggregation + public static class ApplicationType { - public const string Min = "min"; - public const string Max = "max"; - public const string Avg = "avg"; - public const string Sum = "sum"; - public const string Count = "count"; - public const string Unique = "unique"; + public const string Web = "web"; + public const string Other = "other"; } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/CategoryType.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/CategoryType.cs new file mode 100644 index 000000000000..9f20ace2fd37 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/CategoryType.cs @@ -0,0 +1,24 @@ +// +// 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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for CategoryType. + /// + public static class CategoryType + { + public const string Workbook = "workbook"; + public const string TSG = "TSG"; + public const string Performance = "performance"; + public const string Retention = "retention"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResultsItem.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeBody.cs similarity index 50% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResultsItem.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeBody.cs index 4854ca18c285..4d5d7af33f6f 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResultsItem.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeBody.cs @@ -8,34 +8,37 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; - public partial class MetricsResultsItem + /// + /// Describes the body of a purge request for an App Insights component + /// + public partial class ComponentPurgeBody { /// - /// Initializes a new instance of the MetricsResultsItem class. + /// Initializes a new instance of the ComponentPurgeBody class. /// - public MetricsResultsItem() + public ComponentPurgeBody() { CustomInit(); } /// - /// Initializes a new instance of the MetricsResultsItem class. + /// Initializes a new instance of the ComponentPurgeBody class. /// - /// The specified ID for this metric. - /// The HTTP status code of this metric - /// query. - /// The results of this metric query. - public MetricsResultsItem(string id, int status, MetricsResult body) + /// Table from which to purge data. + /// The set of columns and filters (queries) to + /// run over them to purge the resulting data. + public ComponentPurgeBody(string table, IList filters) { - Id = id; - Status = status; - Body = body; + Table = table; + Filters = filters; CustomInit(); } @@ -45,22 +48,17 @@ public MetricsResultsItem(string id, int status, MetricsResult body) partial void CustomInit(); /// - /// Gets or sets the specified ID for this metric. + /// Gets or sets table from which to purge data. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [JsonProperty(PropertyName = "table")] + public string Table { get; set; } /// - /// Gets or sets the HTTP status code of this metric query. + /// Gets or sets the set of columns and filters (queries) to run over + /// them to purge the resulting data. /// - [JsonProperty(PropertyName = "status")] - public int Status { get; set; } - - /// - /// Gets or sets the results of this metric query. - /// - [JsonProperty(PropertyName = "body")] - public MetricsResult Body { get; set; } + [JsonProperty(PropertyName = "filters")] + public IList Filters { get; set; } /// /// Validate the object. @@ -70,13 +68,13 @@ public MetricsResultsItem(string id, int status, MetricsResult body) /// public virtual void Validate() { - if (Id == null) + if (Table == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + throw new ValidationException(ValidationRules.CannotBeNull, "Table"); } - if (Body == null) + if (Filters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Body"); + throw new ValidationException(ValidationRules.CannotBeNull, "Filters"); } } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeBodyFilters.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeBodyFilters.cs new file mode 100644 index 000000000000..83c4c5781afa --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeBodyFilters.cs @@ -0,0 +1,90 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// User-defined filters to return data which will be purged from the + /// table. + /// + public partial class ComponentPurgeBodyFilters + { + /// + /// Initializes a new instance of the ComponentPurgeBodyFilters class. + /// + public ComponentPurgeBodyFilters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComponentPurgeBodyFilters class. + /// + /// The column of the table over which the given + /// query should run + /// A query operator to evaluate over + /// the provided column and value(s). Supported operators are ==, =~, + /// in, in~, >, >=, <, <=, between, and have the same + /// behavior as they would in a KQL query. + /// the value for the operator to function over. + /// This can be a number (e.g., > 100), a string (timestamp >= + /// '2017-09-01') or array of values. + /// When filtering over custom dimensions, this key + /// will be used as the name of the custom dimension. + public ComponentPurgeBodyFilters(string column = default(string), string operatorProperty = default(string), object value = default(object), string key = default(string)) + { + Column = column; + OperatorProperty = operatorProperty; + Value = value; + Key = key; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the column of the table over which the given query + /// should run + /// + [JsonProperty(PropertyName = "column")] + public string Column { get; set; } + + /// + /// Gets or sets a query operator to evaluate over the provided column + /// and value(s). Supported operators are ==, =~, in, in~, &gt;, + /// &gt;=, &lt;, &lt;=, between, and have the same behavior + /// as they would in a KQL query. + /// + [JsonProperty(PropertyName = "operator")] + public string OperatorProperty { get; set; } + + /// + /// Gets or sets the value for the operator to function over. This can + /// be a number (e.g., &gt; 100), a string (timestamp &gt;= + /// '2017-09-01') or array of values. + /// + [JsonProperty(PropertyName = "value")] + public object Value { get; set; } + + /// + /// Gets or sets when filtering over custom dimensions, this key will + /// be used as the name of the custom dimension. + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/QueryResults.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeResponse.cs similarity index 52% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/QueryResults.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeResponse.cs index 6499270222b3..1a73a04e91af 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/QueryResults.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeResponse.cs @@ -8,37 +8,33 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { using Microsoft.Rest; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// A query response. + /// Response containing operationId for a specific purge action. /// - /// - /// Contains the tables, columns & rows resulting from a query. - /// - public partial class QueryResults + public partial class ComponentPurgeResponse { /// - /// Initializes a new instance of the QueryResults class. + /// Initializes a new instance of the ComponentPurgeResponse class. /// - public QueryResults() + public ComponentPurgeResponse() { CustomInit(); } /// - /// Initializes a new instance of the QueryResults class. + /// Initializes a new instance of the ComponentPurgeResponse class. /// - /// The list of tables, columns and rows. - public QueryResults(IList tables) + /// Id to use when querying for status for a + /// particular purge operation. + public ComponentPurgeResponse(string operationId) { - Tables = tables; + OperationId = operationId; CustomInit(); } @@ -48,10 +44,11 @@ public QueryResults(IList
tables) partial void CustomInit(); /// - /// Gets or sets the list of tables, columns and rows. + /// Gets or sets id to use when querying for status for a particular + /// purge operation. /// - [JsonProperty(PropertyName = "tables")] - public IList
Tables { get; set; } + [JsonProperty(PropertyName = "operationId")] + public string OperationId { get; set; } /// /// Validate the object. @@ -61,19 +58,9 @@ public QueryResults(IList
tables) /// public virtual void Validate() { - if (Tables == null) + if (OperationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Tables"); - } - if (Tables != null) - { - foreach (var element in Tables) - { - if (element != null) - { - element.Validate(); - } - } + throw new ValidationException(ValidationRules.CannotBeNull, "OperationId"); } } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeStatusResponse.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeStatusResponse.cs new file mode 100644 index 000000000000..a5be50fb1bdd --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentPurgeStatusResponse.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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response containing status for a specific purge operation. + /// + public partial class ComponentPurgeStatusResponse + { + /// + /// Initializes a new instance of the ComponentPurgeStatusResponse + /// class. + /// + public ComponentPurgeStatusResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComponentPurgeStatusResponse + /// class. + /// + /// Status of the operation represented by the + /// requested Id. Possible values include: 'pending', + /// 'completed' + public ComponentPurgeStatusResponse(string status) + { + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of the operation represented by the requested + /// Id. Possible values include: 'pending', 'completed' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentsResource.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentsResource.cs new file mode 100644 index 000000000000..55614a169114 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ComponentsResource.cs @@ -0,0 +1,100 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An azure resource object + /// + public partial class ComponentsResource : IResource + { + /// + /// Initializes a new instance of the ComponentsResource class. + /// + public ComponentsResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ComponentsResource class. + /// + /// Resource location + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + public ComponentsResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets azure resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets azure resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets azure resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorDetail.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorDetail.cs deleted file mode 100644 index cae8a394487d..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorDetail.cs +++ /dev/null @@ -1,115 +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.ApplicationInsights.Query.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Error details. - /// - public partial class ErrorDetail - { - /// - /// Initializes a new instance of the ErrorDetail class. - /// - public ErrorDetail() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorDetail class. - /// - /// The error's code. - /// A human readable error message. - /// Indicates which property in the request is - /// responsible for the error. - /// Indicates which value in 'target' is - /// responsible for the error. - /// Indicates resources which were responsible - /// for the error. - public ErrorDetail(string code, string message, string target = default(string), string value = default(string), IList resources = default(IList), object additionalProperties = default(object)) - { - Code = code; - Message = message; - Target = target; - Value = value; - Resources = resources; - AdditionalProperties = additionalProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the error's code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets a human readable error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets indicates which property in the request is responsible - /// for the error. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - - /// - /// Gets or sets indicates which value in 'target' is responsible for - /// the error. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - /// - /// Gets or sets indicates resources which were responsible for the - /// error. - /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; set; } - - /// - /// - [JsonProperty(PropertyName = "additionalProperties")] - public object AdditionalProperties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Code == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Code"); - } - if (Message == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Message"); - } - } - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorFieldContract.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorFieldContract.cs new file mode 100644 index 000000000000..b17d0fb7ef8f --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorFieldContract.cs @@ -0,0 +1,68 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error Field contract. + /// + public partial class ErrorFieldContract + { + /// + /// Initializes a new instance of the ErrorFieldContract class. + /// + public ErrorFieldContract() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorFieldContract class. + /// + /// Property level error code. + /// Human-readable representation of + /// property-level error. + /// Property name. + public ErrorFieldContract(string code = default(string), string message = default(string), string target = default(string)) + { + Code = code; + Message = message; + Target = target; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets property level error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets human-readable representation of property-level error. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets property name. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorInfo.cs deleted file mode 100644 index d3b389d18f10..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorInfo.cs +++ /dev/null @@ -1,115 +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.ApplicationInsights.Query.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The code and message for an error. - /// - public partial class ErrorInfo - { - /// - /// Initializes a new instance of the ErrorInfo class. - /// - public ErrorInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorInfo class. - /// - /// A machine readable error code. - /// A human readable error message. - /// error details. - /// Inner error details if they exist. - public ErrorInfo(string code, string message, IList details = default(IList), ErrorInfo innererror = default(ErrorInfo), object additionalProperties = default(object)) - { - Code = code; - Message = message; - Details = details; - Innererror = innererror; - AdditionalProperties = additionalProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a machine readable error code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } - - /// - /// Gets or sets a human readable error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets error details. - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } - - /// - /// Gets or sets inner error details if they exist. - /// - [JsonProperty(PropertyName = "innererror")] - public ErrorInfo Innererror { get; set; } - - /// - /// - [JsonProperty(PropertyName = "additionalProperties")] - public object AdditionalProperties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Code == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Code"); - } - if (Message == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Message"); - } - if (Details != null) - { - foreach (var element in Details) - { - if (element != null) - { - element.Validate(); - } - } - } - if (Innererror != null) - { - Innererror.Validate(); - } - } - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorResponse.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorResponse.cs index 843ea17a4381..61da390886a7 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorResponse.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorResponse.cs @@ -8,18 +8,15 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// - /// Error details. + /// Error response indicates Insights service is not able to process the + /// incoming request. The reason is provided in the error message. /// - /// - /// Contains details when the response code indicates an error. - /// public partial class ErrorResponse { /// @@ -33,10 +30,13 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// The error details. - public ErrorResponse(ErrorInfo error) + /// Error code. + /// Error message indicating why the operation + /// failed. + public ErrorResponse(string code = default(string), string message = default(string)) { - Error = error; + Code = code; + Message = message; CustomInit(); } @@ -46,27 +46,16 @@ public ErrorResponse(ErrorInfo error) partial void CustomInit(); /// - /// Gets or sets the error details. + /// Gets or sets error code. /// - [JsonProperty(PropertyName = "error")] - public ErrorInfo Error { get; set; } + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } /// - /// Validate the object. + /// Gets or sets error message indicating why the operation failed. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Error == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Error"); - } - if (Error != null) - { - Error.Validate(); - } - } + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorResponseException.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorResponseException.cs index d4570b52c567..494ab6ae4f2c 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorResponseException.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ErrorResponseException.cs @@ -8,7 +8,7 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { using Microsoft.Rest; diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventType.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventType.cs deleted file mode 100644 index 1f52b80aa438..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventType.cs +++ /dev/null @@ -1,31 +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.ApplicationInsights.Query.Models -{ - - /// - /// Defines values for EventType. - /// - public static class EventType - { - public const string All = "$all"; - public const string Traces = "traces"; - public const string CustomEvents = "customEvents"; - public const string PageViews = "pageViews"; - public const string BrowserTimings = "browserTimings"; - public const string Requests = "requests"; - public const string Dependencies = "dependencies"; - public const string Exceptions = "exceptions"; - public const string AvailabilityResults = "availabilityResults"; - public const string PerformanceCounters = "performanceCounters"; - public const string CustomMetrics = "customMetrics"; - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAiInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAiInfo.cs deleted file mode 100644 index 5d871ba17974..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAiInfo.cs +++ /dev/null @@ -1,75 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// AI related application info for an event result - /// - public partial class EventsAiInfo - { - /// - /// Initializes a new instance of the EventsAiInfo class. - /// - public EventsAiInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsAiInfo class. - /// - /// iKey of the app - /// Name of the application - /// ID of the application - /// SDK version of the application - public EventsAiInfo(string iKey = default(string), string appName = default(string), string appId = default(string), string sdkVersion = default(string)) - { - IKey = iKey; - AppName = appName; - AppId = appId; - SdkVersion = sdkVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets iKey of the app - /// - [JsonProperty(PropertyName = "iKey")] - public string IKey { get; set; } - - /// - /// Gets or sets name of the application - /// - [JsonProperty(PropertyName = "appName")] - public string AppName { get; set; } - - /// - /// Gets or sets ID of the application - /// - [JsonProperty(PropertyName = "appId")] - public string AppId { get; set; } - - /// - /// Gets or sets SDK version of the application - /// - [JsonProperty(PropertyName = "sdkVersion")] - public string SdkVersion { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAvailabilityResultInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAvailabilityResultInfo.cs deleted file mode 100644 index 0aac297d7413..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAvailabilityResultInfo.cs +++ /dev/null @@ -1,114 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The availability result info - /// - public partial class EventsAvailabilityResultInfo - { - /// - /// Initializes a new instance of the EventsAvailabilityResultInfo - /// class. - /// - public EventsAvailabilityResultInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsAvailabilityResultInfo - /// class. - /// - /// The name of the availability result - /// Indicates if the availability result was - /// successful - /// The duration of the availability - /// result - /// The performance bucket of the - /// availability result - /// The message of the availability - /// result - /// The location of the availability - /// result - /// The ID of the availability result - /// The size of the availability result - public EventsAvailabilityResultInfo(string name = default(string), string success = default(string), long? duration = default(long?), string performanceBucket = default(string), string message = default(string), string location = default(string), string id = default(string), string size = default(string)) - { - Name = name; - Success = success; - Duration = duration; - PerformanceBucket = performanceBucket; - Message = message; - Location = location; - Id = id; - Size = size; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the availability result - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets indicates if the availability result was successful - /// - [JsonProperty(PropertyName = "success")] - public string Success { get; set; } - - /// - /// Gets or sets the duration of the availability result - /// - [JsonProperty(PropertyName = "duration")] - public long? Duration { get; set; } - - /// - /// Gets or sets the performance bucket of the availability result - /// - [JsonProperty(PropertyName = "performanceBucket")] - public string PerformanceBucket { get; set; } - - /// - /// Gets or sets the message of the availability result - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets the location of the availability result - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets the ID of the availability result - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets the size of the availability result - /// - [JsonProperty(PropertyName = "size")] - public string Size { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAvailabilityResultResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAvailabilityResultResult.cs deleted file mode 100644 index 0dc6ebc3ac6f..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsAvailabilityResultResult.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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// An availability result result - /// - [Newtonsoft.Json.JsonObject("availabilityResult")] - public partial class EventsAvailabilityResultResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsAvailabilityResultResult - /// class. - /// - public EventsAvailabilityResultResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsAvailabilityResultResult - /// class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsAvailabilityResultResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsAvailabilityResultInfo availabilityResult = default(EventsAvailabilityResultInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - AvailabilityResult = availabilityResult; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "availabilityResult")] - public EventsAvailabilityResultInfo AvailabilityResult { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsBrowserTimingInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsBrowserTimingInfo.cs deleted file mode 100644 index a0e771b11ddb..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsBrowserTimingInfo.cs +++ /dev/null @@ -1,127 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The browser timing information - /// - public partial class EventsBrowserTimingInfo - { - /// - /// Initializes a new instance of the EventsBrowserTimingInfo class. - /// - public EventsBrowserTimingInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsBrowserTimingInfo class. - /// - /// The path of the URL - /// The host of the URL - /// The name of the page - /// The url of the page - /// The total duration of the load - /// The performance bucket of the - /// load - /// The network duration of the - /// load - /// The send duration of the load - /// The receive duration of the - /// load - /// The processing duration of the - /// load - public EventsBrowserTimingInfo(string urlPath = default(string), string urlHost = default(string), string name = default(string), string url = default(string), long? totalDuration = default(long?), string performanceBucket = default(string), long? networkDuration = default(long?), long? sendDuration = default(long?), long? receiveDuration = default(long?), long? processingDuration = default(long?)) - { - UrlPath = urlPath; - UrlHost = urlHost; - Name = name; - Url = url; - TotalDuration = totalDuration; - PerformanceBucket = performanceBucket; - NetworkDuration = networkDuration; - SendDuration = sendDuration; - ReceiveDuration = receiveDuration; - ProcessingDuration = processingDuration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the path of the URL - /// - [JsonProperty(PropertyName = "urlPath")] - public string UrlPath { get; set; } - - /// - /// Gets or sets the host of the URL - /// - [JsonProperty(PropertyName = "urlHost")] - public string UrlHost { get; set; } - - /// - /// Gets or sets the name of the page - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the url of the page - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } - - /// - /// Gets or sets the total duration of the load - /// - [JsonProperty(PropertyName = "totalDuration")] - public long? TotalDuration { get; set; } - - /// - /// Gets or sets the performance bucket of the load - /// - [JsonProperty(PropertyName = "performanceBucket")] - public string PerformanceBucket { get; set; } - - /// - /// Gets or sets the network duration of the load - /// - [JsonProperty(PropertyName = "networkDuration")] - public long? NetworkDuration { get; set; } - - /// - /// Gets or sets the send duration of the load - /// - [JsonProperty(PropertyName = "sendDuration")] - public long? SendDuration { get; set; } - - /// - /// Gets or sets the receive duration of the load - /// - [JsonProperty(PropertyName = "receiveDuration")] - public long? ReceiveDuration { get; set; } - - /// - /// Gets or sets the processing duration of the load - /// - [JsonProperty(PropertyName = "processingDuration")] - public long? ProcessingDuration { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsBrowserTimingResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsBrowserTimingResult.cs deleted file mode 100644 index 4f1009a32542..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsBrowserTimingResult.cs +++ /dev/null @@ -1,71 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A browser timing result - /// - [Newtonsoft.Json.JsonObject("browserTiming")] - public partial class EventsBrowserTimingResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsBrowserTimingResult class. - /// - public EventsBrowserTimingResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsBrowserTimingResult class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsBrowserTimingResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsBrowserTimingInfo browserTiming = default(EventsBrowserTimingInfo), EventsClientPerformanceInfo clientPerformance = default(EventsClientPerformanceInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - BrowserTiming = browserTiming; - ClientPerformance = clientPerformance; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "browserTiming")] - public EventsBrowserTimingInfo BrowserTiming { get; set; } - - /// - /// - [JsonProperty(PropertyName = "clientPerformance")] - public EventsClientPerformanceInfo ClientPerformance { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsClientInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsClientInfo.cs deleted file mode 100644 index 6858451c96a8..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsClientInfo.cs +++ /dev/null @@ -1,109 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Client info for an event result - /// - public partial class EventsClientInfo - { - /// - /// Initializes a new instance of the EventsClientInfo class. - /// - public EventsClientInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsClientInfo class. - /// - /// Model of the client - /// Operating system of the client - /// Type of the client - /// Browser of the client - /// IP address of the client - /// City of the client - /// State or province of the - /// client - /// Country or region of the - /// client - public EventsClientInfo(string model = default(string), string os = default(string), string type = default(string), string browser = default(string), string ip = default(string), string city = default(string), string stateOrProvince = default(string), string countryOrRegion = default(string)) - { - Model = model; - Os = os; - Type = type; - Browser = browser; - Ip = ip; - City = city; - StateOrProvince = stateOrProvince; - CountryOrRegion = countryOrRegion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets model of the client - /// - [JsonProperty(PropertyName = "model")] - public string Model { get; set; } - - /// - /// Gets or sets operating system of the client - /// - [JsonProperty(PropertyName = "os")] - public string Os { get; set; } - - /// - /// Gets or sets type of the client - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets browser of the client - /// - [JsonProperty(PropertyName = "browser")] - public string Browser { get; set; } - - /// - /// Gets or sets IP address of the client - /// - [JsonProperty(PropertyName = "ip")] - public string Ip { get; set; } - - /// - /// Gets or sets city of the client - /// - [JsonProperty(PropertyName = "city")] - public string City { get; set; } - - /// - /// Gets or sets state or province of the client - /// - [JsonProperty(PropertyName = "stateOrProvince")] - public string StateOrProvince { get; set; } - - /// - /// Gets or sets country or region of the client - /// - [JsonProperty(PropertyName = "countryOrRegion")] - public string CountryOrRegion { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCloudInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCloudInfo.cs deleted file mode 100644 index da37f8475c6d..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCloudInfo.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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Cloud info for an event result - /// - public partial class EventsCloudInfo - { - /// - /// Initializes a new instance of the EventsCloudInfo class. - /// - public EventsCloudInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsCloudInfo class. - /// - /// Role name of the cloud - /// Role instance of the cloud - public EventsCloudInfo(string roleName = default(string), string roleInstance = default(string)) - { - RoleName = roleName; - RoleInstance = roleInstance; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets role name of the cloud - /// - [JsonProperty(PropertyName = "roleName")] - public string RoleName { get; set; } - - /// - /// Gets or sets role instance of the cloud - /// - [JsonProperty(PropertyName = "roleInstance")] - public string RoleInstance { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomEventInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomEventInfo.cs deleted file mode 100644 index 20a0297d31bb..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomEventInfo.cs +++ /dev/null @@ -1,51 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The custom event information - /// - public partial class EventsCustomEventInfo - { - /// - /// Initializes a new instance of the EventsCustomEventInfo class. - /// - public EventsCustomEventInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsCustomEventInfo class. - /// - /// The name of the custom event - public EventsCustomEventInfo(string name = default(string)) - { - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the custom event - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomEventResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomEventResult.cs deleted file mode 100644 index 5d8c33e7c31b..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomEventResult.cs +++ /dev/null @@ -1,65 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A custom event result - /// - [Newtonsoft.Json.JsonObject("customEvent")] - public partial class EventsCustomEventResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsCustomEventResult class. - /// - public EventsCustomEventResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsCustomEventResult class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsCustomEventResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsCustomEventInfo customEvent = default(EventsCustomEventInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - CustomEvent = customEvent; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "customEvent")] - public EventsCustomEventInfo CustomEvent { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomMetricInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomMetricInfo.cs deleted file mode 100644 index fc99acc002c0..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomMetricInfo.cs +++ /dev/null @@ -1,102 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The custom metric info - /// - public partial class EventsCustomMetricInfo - { - /// - /// Initializes a new instance of the EventsCustomMetricInfo class. - /// - public EventsCustomMetricInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsCustomMetricInfo class. - /// - /// The name of the custom metric - /// The value of the custom metric - /// The sum of the custom metric - /// The count of the custom metric - /// The minimum value of the custom - /// metric - /// The maximum value of the custom - /// metric - /// The standard deviation of the custom - /// metric - public EventsCustomMetricInfo(string name = default(string), double? value = default(double?), double? valueSum = default(double?), int? valueCount = default(int?), double? valueMin = default(double?), double? valueMax = default(double?), double? valueStdDev = default(double?)) - { - Name = name; - Value = value; - ValueSum = valueSum; - ValueCount = valueCount; - ValueMin = valueMin; - ValueMax = valueMax; - ValueStdDev = valueStdDev; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the custom metric - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the value of the custom metric - /// - [JsonProperty(PropertyName = "value")] - public double? Value { get; set; } - - /// - /// Gets or sets the sum of the custom metric - /// - [JsonProperty(PropertyName = "valueSum")] - public double? ValueSum { get; set; } - - /// - /// Gets or sets the count of the custom metric - /// - [JsonProperty(PropertyName = "valueCount")] - public int? ValueCount { get; set; } - - /// - /// Gets or sets the minimum value of the custom metric - /// - [JsonProperty(PropertyName = "valueMin")] - public double? ValueMin { get; set; } - - /// - /// Gets or sets the maximum value of the custom metric - /// - [JsonProperty(PropertyName = "valueMax")] - public double? ValueMax { get; set; } - - /// - /// Gets or sets the standard deviation of the custom metric - /// - [JsonProperty(PropertyName = "valueStdDev")] - public double? ValueStdDev { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomMetricResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomMetricResult.cs deleted file mode 100644 index 9d7379f5e15d..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsCustomMetricResult.cs +++ /dev/null @@ -1,65 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A custom metric result - /// - [Newtonsoft.Json.JsonObject("customMetric")] - public partial class EventsCustomMetricResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsCustomMetricResult class. - /// - public EventsCustomMetricResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsCustomMetricResult class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsCustomMetricResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsCustomMetricInfo customMetric = default(EventsCustomMetricInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - CustomMetric = customMetric; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "customMetric")] - public EventsCustomMetricInfo CustomMetric { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsDependencyInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsDependencyInfo.cs deleted file mode 100644 index 27fe20462c70..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsDependencyInfo.cs +++ /dev/null @@ -1,117 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The dependency info - /// - public partial class EventsDependencyInfo - { - /// - /// Initializes a new instance of the EventsDependencyInfo class. - /// - public EventsDependencyInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsDependencyInfo class. - /// - /// The target of the dependency - /// The data of the dependency - /// Indicates if the dependency was - /// successful - /// The duration of the dependency - /// The performance bucket of the - /// dependency - /// The result code of the dependency - /// The type of the dependency - /// The name of the dependency - /// The ID of the dependency - public EventsDependencyInfo(string target = default(string), string data = default(string), string success = default(string), long? duration = default(long?), string performanceBucket = default(string), string resultCode = default(string), string type = default(string), string name = default(string), string id = default(string)) - { - Target = target; - Data = data; - Success = success; - Duration = duration; - PerformanceBucket = performanceBucket; - ResultCode = resultCode; - Type = type; - Name = name; - Id = id; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the target of the dependency - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } - - /// - /// Gets or sets the data of the dependency - /// - [JsonProperty(PropertyName = "data")] - public string Data { get; set; } - - /// - /// Gets or sets indicates if the dependency was successful - /// - [JsonProperty(PropertyName = "success")] - public string Success { get; set; } - - /// - /// Gets or sets the duration of the dependency - /// - [JsonProperty(PropertyName = "duration")] - public long? Duration { get; set; } - - /// - /// Gets or sets the performance bucket of the dependency - /// - [JsonProperty(PropertyName = "performanceBucket")] - public string PerformanceBucket { get; set; } - - /// - /// Gets or sets the result code of the dependency - /// - [JsonProperty(PropertyName = "resultCode")] - public string ResultCode { get; set; } - - /// - /// Gets or sets the type of the dependency - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the name of the dependency - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the ID of the dependency - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsDependencyResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsDependencyResult.cs deleted file mode 100644 index d18cdef03e7a..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsDependencyResult.cs +++ /dev/null @@ -1,65 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A dependency result - /// - [Newtonsoft.Json.JsonObject("dependency")] - public partial class EventsDependencyResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsDependencyResult class. - /// - public EventsDependencyResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsDependencyResult class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsDependencyResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsDependencyInfo dependency = default(EventsDependencyInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - Dependency = dependency; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "dependency")] - public EventsDependencyInfo Dependency { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionDetail.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionDetail.cs deleted file mode 100644 index f86799dd812d..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionDetail.cs +++ /dev/null @@ -1,94 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Exception details - /// - public partial class EventsExceptionDetail - { - /// - /// Initializes a new instance of the EventsExceptionDetail class. - /// - public EventsExceptionDetail() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsExceptionDetail class. - /// - /// The severity level of the exception - /// detail - /// The outer ID of the exception detail - /// The message of the exception detail - /// The type of the exception detail - /// The ID of the exception detail - /// The parsed stack - public EventsExceptionDetail(string severityLevel = default(string), string outerId = default(string), string message = default(string), string type = default(string), string id = default(string), IList parsedStack = default(IList)) - { - SeverityLevel = severityLevel; - OuterId = outerId; - Message = message; - Type = type; - Id = id; - ParsedStack = parsedStack; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the severity level of the exception detail - /// - [JsonProperty(PropertyName = "severityLevel")] - public string SeverityLevel { get; set; } - - /// - /// Gets or sets the outer ID of the exception detail - /// - [JsonProperty(PropertyName = "outerId")] - public string OuterId { get; set; } - - /// - /// Gets or sets the message of the exception detail - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets the type of the exception detail - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the ID of the exception detail - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets the parsed stack - /// - [JsonProperty(PropertyName = "parsedStack")] - public IList ParsedStack { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionDetailsParsedStack.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionDetailsParsedStack.cs deleted file mode 100644 index 4a2d29bc027c..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionDetailsParsedStack.cs +++ /dev/null @@ -1,77 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A parsed stack entry - /// - public partial class EventsExceptionDetailsParsedStack - { - /// - /// Initializes a new instance of the EventsExceptionDetailsParsedStack - /// class. - /// - public EventsExceptionDetailsParsedStack() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsExceptionDetailsParsedStack - /// class. - /// - /// The assembly of the stack entry - /// The method of the stack entry - /// The level of the stack entry - /// The line of the stack entry - public EventsExceptionDetailsParsedStack(string assembly = default(string), string method = default(string), long? level = default(long?), long? line = default(long?)) - { - Assembly = assembly; - Method = method; - Level = level; - Line = line; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the assembly of the stack entry - /// - [JsonProperty(PropertyName = "assembly")] - public string Assembly { get; set; } - - /// - /// Gets or sets the method of the stack entry - /// - [JsonProperty(PropertyName = "method")] - public string Method { get; set; } - - /// - /// Gets or sets the level of the stack entry - /// - [JsonProperty(PropertyName = "level")] - public long? Level { get; set; } - - /// - /// Gets or sets the line of the stack entry - /// - [JsonProperty(PropertyName = "line")] - public long? Line { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionInfo.cs deleted file mode 100644 index 95e1131bd001..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionInfo.cs +++ /dev/null @@ -1,182 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The exception info - /// - public partial class EventsExceptionInfo - { - /// - /// Initializes a new instance of the EventsExceptionInfo class. - /// - public EventsExceptionInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsExceptionInfo class. - /// - /// The severity level of the - /// exception - /// The problem ID of the exception - /// Indicates where the exception was handled - /// at - /// The assembly which threw the - /// exception - /// The method that threw the exception - /// The message of the exception - /// The type of the exception - /// The outer type of the exception - /// The outer method of the exception - /// The outer assmebly of the - /// exception - /// The outer message of the - /// exception - /// The inner most type of the - /// exception - /// The inner most message of the - /// exception - /// The inner most method of the - /// exception - /// The inner most assembly of the - /// exception - /// The details of the exception - public EventsExceptionInfo(int? severityLevel = default(int?), string problemId = default(string), string handledAt = default(string), string assembly = default(string), string method = default(string), string message = default(string), string type = default(string), string outerType = default(string), string outerMethod = default(string), string outerAssembly = default(string), string outerMessage = default(string), string innermostType = default(string), string innermostMessage = default(string), string innermostMethod = default(string), string innermostAssembly = default(string), IList details = default(IList)) - { - SeverityLevel = severityLevel; - ProblemId = problemId; - HandledAt = handledAt; - Assembly = assembly; - Method = method; - Message = message; - Type = type; - OuterType = outerType; - OuterMethod = outerMethod; - OuterAssembly = outerAssembly; - OuterMessage = outerMessage; - InnermostType = innermostType; - InnermostMessage = innermostMessage; - InnermostMethod = innermostMethod; - InnermostAssembly = innermostAssembly; - Details = details; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the severity level of the exception - /// - [JsonProperty(PropertyName = "severityLevel")] - public int? SeverityLevel { get; set; } - - /// - /// Gets or sets the problem ID of the exception - /// - [JsonProperty(PropertyName = "problemId")] - public string ProblemId { get; set; } - - /// - /// Gets or sets indicates where the exception was handled at - /// - [JsonProperty(PropertyName = "handledAt")] - public string HandledAt { get; set; } - - /// - /// Gets or sets the assembly which threw the exception - /// - [JsonProperty(PropertyName = "assembly")] - public string Assembly { get; set; } - - /// - /// Gets or sets the method that threw the exception - /// - [JsonProperty(PropertyName = "method")] - public string Method { get; set; } - - /// - /// Gets or sets the message of the exception - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } - - /// - /// Gets or sets the type of the exception - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the outer type of the exception - /// - [JsonProperty(PropertyName = "outerType")] - public string OuterType { get; set; } - - /// - /// Gets or sets the outer method of the exception - /// - [JsonProperty(PropertyName = "outerMethod")] - public string OuterMethod { get; set; } - - /// - /// Gets or sets the outer assmebly of the exception - /// - [JsonProperty(PropertyName = "outerAssembly")] - public string OuterAssembly { get; set; } - - /// - /// Gets or sets the outer message of the exception - /// - [JsonProperty(PropertyName = "outerMessage")] - public string OuterMessage { get; set; } - - /// - /// Gets or sets the inner most type of the exception - /// - [JsonProperty(PropertyName = "innermostType")] - public string InnermostType { get; set; } - - /// - /// Gets or sets the inner most message of the exception - /// - [JsonProperty(PropertyName = "innermostMessage")] - public string InnermostMessage { get; set; } - - /// - /// Gets or sets the inner most method of the exception - /// - [JsonProperty(PropertyName = "innermostMethod")] - public string InnermostMethod { get; set; } - - /// - /// Gets or sets the inner most assembly of the exception - /// - [JsonProperty(PropertyName = "innermostAssembly")] - public string InnermostAssembly { get; set; } - - /// - /// Gets or sets the details of the exception - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionResult.cs deleted file mode 100644 index e4d5764de21c..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsExceptionResult.cs +++ /dev/null @@ -1,65 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// An exception result - /// - [Newtonsoft.Json.JsonObject("exception")] - public partial class EventsExceptionResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsExceptionResult class. - /// - public EventsExceptionResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsExceptionResult class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsExceptionResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsExceptionInfo exception = default(EventsExceptionInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - Exception = exception; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "exception")] - public EventsExceptionInfo Exception { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsOperationInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsOperationInfo.cs deleted file mode 100644 index 64928c4ea818..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsOperationInfo.cs +++ /dev/null @@ -1,76 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Operation info for an event result - /// - public partial class EventsOperationInfo - { - /// - /// Initializes a new instance of the EventsOperationInfo class. - /// - public EventsOperationInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsOperationInfo class. - /// - /// Name of the operation - /// ID of the operation - /// Parent ID of the operation - /// Synthetic source of the - /// operation - public EventsOperationInfo(string name = default(string), string id = default(string), string parentId = default(string), string syntheticSource = default(string)) - { - Name = name; - Id = id; - ParentId = parentId; - SyntheticSource = syntheticSource; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the operation - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets ID of the operation - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets parent ID of the operation - /// - [JsonProperty(PropertyName = "parentId")] - public string ParentId { get; set; } - - /// - /// Gets or sets synthetic source of the operation - /// - [JsonProperty(PropertyName = "syntheticSource")] - public string SyntheticSource { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPageViewInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPageViewInfo.cs deleted file mode 100644 index eadd40831e56..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPageViewInfo.cs +++ /dev/null @@ -1,76 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The page view information - /// - public partial class EventsPageViewInfo - { - /// - /// Initializes a new instance of the EventsPageViewInfo class. - /// - public EventsPageViewInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsPageViewInfo class. - /// - /// The name of the page - /// The URL of the page - /// The duration of the page view - /// The performance bucket of the page - /// view - public EventsPageViewInfo(string name = default(string), string url = default(string), string duration = default(string), string performanceBucket = default(string)) - { - Name = name; - Url = url; - Duration = duration; - PerformanceBucket = performanceBucket; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the page - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the URL of the page - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } - - /// - /// Gets or sets the duration of the page view - /// - [JsonProperty(PropertyName = "duration")] - public string Duration { get; set; } - - /// - /// Gets or sets the performance bucket of the page view - /// - [JsonProperty(PropertyName = "performanceBucket")] - public string PerformanceBucket { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPageViewResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPageViewResult.cs deleted file mode 100644 index 0ec11c2dbd6b..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPageViewResult.cs +++ /dev/null @@ -1,65 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A page view result - /// - [Newtonsoft.Json.JsonObject("pageView")] - public partial class EventsPageViewResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsPageViewResult class. - /// - public EventsPageViewResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsPageViewResult class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsPageViewResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsPageViewInfo pageView = default(EventsPageViewInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - PageView = pageView; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "pageView")] - public EventsPageViewInfo PageView { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPerformanceCounterInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPerformanceCounterInfo.cs deleted file mode 100644 index 9ed4ad144c40..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPerformanceCounterInfo.cs +++ /dev/null @@ -1,97 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The performance counter info - /// - public partial class EventsPerformanceCounterInfo - { - /// - /// Initializes a new instance of the EventsPerformanceCounterInfo - /// class. - /// - public EventsPerformanceCounterInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsPerformanceCounterInfo - /// class. - /// - /// The value of the performance counter - /// The name of the performance counter - /// The category of the performance - /// counter - /// The counter of the performance - /// counter - /// The instance name of the performance - /// counter - /// The instance of the performance - /// counter - public EventsPerformanceCounterInfo(double? value = default(double?), string name = default(string), string category = default(string), string counter = default(string), string instanceName = default(string), string instance = default(string)) - { - Value = value; - Name = name; - Category = category; - Counter = counter; - InstanceName = instanceName; - Instance = instance; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the value of the performance counter - /// - [JsonProperty(PropertyName = "value")] - public double? Value { get; set; } - - /// - /// Gets or sets the name of the performance counter - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the category of the performance counter - /// - [JsonProperty(PropertyName = "category")] - public string Category { get; set; } - - /// - /// Gets or sets the counter of the performance counter - /// - [JsonProperty(PropertyName = "counter")] - public string Counter { get; set; } - - /// - /// Gets or sets the instance name of the performance counter - /// - [JsonProperty(PropertyName = "instanceName")] - public string InstanceName { get; set; } - - /// - /// Gets or sets the instance of the performance counter - /// - [JsonProperty(PropertyName = "instance")] - public string Instance { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPerformanceCounterResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPerformanceCounterResult.cs deleted file mode 100644 index ff6c0e98fa1d..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsPerformanceCounterResult.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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A performance counter result - /// - [Newtonsoft.Json.JsonObject("performanceCounter")] - public partial class EventsPerformanceCounterResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsPerformanceCounterResult - /// class. - /// - public EventsPerformanceCounterResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsPerformanceCounterResult - /// class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsPerformanceCounterResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsPerformanceCounterInfo performanceCounter = default(EventsPerformanceCounterInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - PerformanceCounter = performanceCounter; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "performanceCounter")] - public EventsPerformanceCounterInfo PerformanceCounter { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsRequestInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsRequestInfo.cs deleted file mode 100644 index ca053cd89d3f..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsRequestInfo.cs +++ /dev/null @@ -1,109 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The request info - /// - public partial class EventsRequestInfo - { - /// - /// Initializes a new instance of the EventsRequestInfo class. - /// - public EventsRequestInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsRequestInfo class. - /// - /// The name of the request - /// The URL of the request - /// Indicates if the request was - /// successful - /// The duration of the request - /// The performance bucket of the - /// request - /// The result code of the request - /// The source of the request - /// The ID of the request - public EventsRequestInfo(string name = default(string), string url = default(string), string success = default(string), double? duration = default(double?), string performanceBucket = default(string), string resultCode = default(string), string source = default(string), string id = default(string)) - { - Name = name; - Url = url; - Success = success; - Duration = duration; - PerformanceBucket = performanceBucket; - ResultCode = resultCode; - Source = source; - Id = id; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the request - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the URL of the request - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } - - /// - /// Gets or sets indicates if the request was successful - /// - [JsonProperty(PropertyName = "success")] - public string Success { get; set; } - - /// - /// Gets or sets the duration of the request - /// - [JsonProperty(PropertyName = "duration")] - public double? Duration { get; set; } - - /// - /// Gets or sets the performance bucket of the request - /// - [JsonProperty(PropertyName = "performanceBucket")] - public string PerformanceBucket { get; set; } - - /// - /// Gets or sets the result code of the request - /// - [JsonProperty(PropertyName = "resultCode")] - public string ResultCode { get; set; } - - /// - /// Gets or sets the source of the request - /// - [JsonProperty(PropertyName = "source")] - public string Source { get; set; } - - /// - /// Gets or sets the ID of the request - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsRequestResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsRequestResult.cs deleted file mode 100644 index 822223ed9e90..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsRequestResult.cs +++ /dev/null @@ -1,65 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A request result - /// - [Newtonsoft.Json.JsonObject("request")] - public partial class EventsRequestResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsRequestResult class. - /// - public EventsRequestResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsRequestResult class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsRequestResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsRequestInfo request = default(EventsRequestInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - Request = request; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "request")] - public EventsRequestInfo Request { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResult.cs deleted file mode 100644 index 2f7b3ae2ade9..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResult.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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// An event query result. - /// - public partial class EventsResult - { - /// - /// Initializes a new instance of the EventsResult class. - /// - public EventsResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsResult class. - /// - /// OData messages for this response. - public EventsResult(IList aimessages = default(IList), EventsResultData value = default(EventsResultData)) - { - Aimessages = aimessages; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets oData messages for this response. - /// - [JsonProperty(PropertyName = "@ai.messages")] - public IList Aimessages { get; set; } - - /// - /// - [JsonProperty(PropertyName = "value")] - public EventsResultData Value { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultData.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultData.cs deleted file mode 100644 index 8df84051c7de..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultData.cs +++ /dev/null @@ -1,142 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Events query result data. - /// - [Newtonsoft.Json.JsonObject("eventsResultData")] - public partial class EventsResultData - { - /// - /// Initializes a new instance of the EventsResultData class. - /// - public EventsResultData() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsResultData class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsResultData(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo)) - { - Id = id; - Count = count; - Timestamp = timestamp; - CustomDimensions = customDimensions; - CustomMeasurements = customMeasurements; - Operation = operation; - Session = session; - User = user; - Cloud = cloud; - Ai = ai; - Application = application; - Client = client; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the unique ID for this event. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets count of the event - /// - [JsonProperty(PropertyName = "count")] - public long? Count { get; set; } - - /// - /// Gets or sets timestamp of the event - /// - [JsonProperty(PropertyName = "timestamp")] - public System.DateTime? Timestamp { get; set; } - - /// - /// Gets or sets custom dimensions of the event - /// - [JsonProperty(PropertyName = "customDimensions")] - public EventsResultDataCustomDimensions CustomDimensions { get; set; } - - /// - /// Gets or sets custom measurements of the event - /// - [JsonProperty(PropertyName = "customMeasurements")] - public EventsResultDataCustomMeasurements CustomMeasurements { get; set; } - - /// - /// Gets or sets operation info of the event - /// - [JsonProperty(PropertyName = "operation")] - public EventsOperationInfo Operation { get; set; } - - /// - /// Gets or sets session info of the event - /// - [JsonProperty(PropertyName = "session")] - public EventsSessionInfo Session { get; set; } - - /// - /// Gets or sets user info of the event - /// - [JsonProperty(PropertyName = "user")] - public EventsUserInfo User { get; set; } - - /// - /// Gets or sets cloud info of the event - /// - [JsonProperty(PropertyName = "cloud")] - public EventsCloudInfo Cloud { get; set; } - - /// - /// Gets or sets AI info of the event - /// - [JsonProperty(PropertyName = "ai")] - public EventsAiInfo Ai { get; set; } - - /// - /// Gets or sets application info of the event - /// - [JsonProperty(PropertyName = "application")] - public EventsApplicationInfo Application { get; set; } - - /// - /// Gets or sets client info of the event - /// - [JsonProperty(PropertyName = "client")] - public EventsClientInfo Client { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultDataCustomMeasurements.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultDataCustomMeasurements.cs deleted file mode 100644 index 9367b757121b..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultDataCustomMeasurements.cs +++ /dev/null @@ -1,51 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Custom measurements of the event - /// - public partial class EventsResultDataCustomMeasurements - { - /// - /// Initializes a new instance of the - /// EventsResultDataCustomMeasurements class. - /// - public EventsResultDataCustomMeasurements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// EventsResultDataCustomMeasurements class. - /// - public EventsResultDataCustomMeasurements(object additionalProperties = default(object)) - { - AdditionalProperties = additionalProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "additionalProperties")] - public object AdditionalProperties { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResults.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResults.cs deleted file mode 100644 index 4c3d89f90d69..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResults.cs +++ /dev/null @@ -1,70 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// An events query result. - /// - public partial class EventsResults - { - /// - /// Initializes a new instance of the EventsResults class. - /// - public EventsResults() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsResults class. - /// - /// OData context metadata endpoint for this - /// response - /// OData messages for this response. - /// Contents of the events query result. - public EventsResults(string odatacontext = default(string), IList aimessages = default(IList), IList value = default(IList)) - { - Odatacontext = odatacontext; - Aimessages = aimessages; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets oData context metadata endpoint for this response - /// - [JsonProperty(PropertyName = "@odata.context")] - public string Odatacontext { get; set; } - - /// - /// Gets or sets oData messages for this response. - /// - [JsonProperty(PropertyName = "@ai.messages")] - public IList Aimessages { get; set; } - - /// - /// Gets or sets contents of the events query result. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsSessionInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsSessionInfo.cs deleted file mode 100644 index 2ef24da78661..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsSessionInfo.cs +++ /dev/null @@ -1,51 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Session info for an event result - /// - public partial class EventsSessionInfo - { - /// - /// Initializes a new instance of the EventsSessionInfo class. - /// - public EventsSessionInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsSessionInfo class. - /// - /// ID of the session - public EventsSessionInfo(string id = default(string)) - { - Id = id; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets ID of the session - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsTraceResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsTraceResult.cs deleted file mode 100644 index 901cd594a5e9..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsTraceResult.cs +++ /dev/null @@ -1,65 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A trace result - /// - [Newtonsoft.Json.JsonObject("trace")] - public partial class EventsTraceResult : EventsResultData - { - /// - /// Initializes a new instance of the EventsTraceResult class. - /// - public EventsTraceResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsTraceResult class. - /// - /// The unique ID for this event. - /// Count of the event - /// Timestamp of the event - /// Custom dimensions of the - /// event - /// Custom measurements of the - /// event - /// Operation info of the event - /// Session info of the event - /// User info of the event - /// Cloud info of the event - /// AI info of the event - /// Application info of the event - /// Client info of the event - public EventsTraceResult(string id = default(string), long? count = default(long?), System.DateTime? timestamp = default(System.DateTime?), EventsResultDataCustomDimensions customDimensions = default(EventsResultDataCustomDimensions), EventsResultDataCustomMeasurements customMeasurements = default(EventsResultDataCustomMeasurements), EventsOperationInfo operation = default(EventsOperationInfo), EventsSessionInfo session = default(EventsSessionInfo), EventsUserInfo user = default(EventsUserInfo), EventsCloudInfo cloud = default(EventsCloudInfo), EventsAiInfo ai = default(EventsAiInfo), EventsApplicationInfo application = default(EventsApplicationInfo), EventsClientInfo client = default(EventsClientInfo), EventsTraceInfo trace = default(EventsTraceInfo)) - : base(id, count, timestamp, customDimensions, customMeasurements, operation, session, user, cloud, ai, application, client) - { - Trace = trace; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "trace")] - public EventsTraceInfo Trace { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsUserInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsUserInfo.cs deleted file mode 100644 index 2414f185dac9..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsUserInfo.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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// User info for an event result - /// - public partial class EventsUserInfo - { - /// - /// Initializes a new instance of the EventsUserInfo class. - /// - public EventsUserInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventsUserInfo class. - /// - /// ID of the user - /// Account ID of the user - /// Authenticated ID of the user - public EventsUserInfo(string id = default(string), string accountId = default(string), string authenticatedId = default(string)) - { - Id = id; - AccountId = accountId; - AuthenticatedId = authenticatedId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets ID of the user - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets account ID of the user - /// - [JsonProperty(PropertyName = "accountId")] - public string AccountId { get; set; } - - /// - /// Gets or sets authenticated ID of the user - /// - [JsonProperty(PropertyName = "authenticatedId")] - public string AuthenticatedId { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FavoriteSourceType.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FavoriteSourceType.cs new file mode 100644 index 000000000000..ebbba70acb19 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FavoriteSourceType.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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for FavoriteSourceType. + /// + public static class FavoriteSourceType + { + public const string Retention = "retention"; + public const string Notebook = "notebook"; + public const string Sessions = "sessions"; + public const string Events = "events"; + public const string Userflows = "userflows"; + public const string Funnel = "funnel"; + public const string Impact = "impact"; + public const string Segmentation = "segmentation"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FavoriteType.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FavoriteType.cs new file mode 100644 index 000000000000..3693183a0855 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FavoriteType.cs @@ -0,0 +1,60 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for FavoriteType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FavoriteType + { + [EnumMember(Value = "shared")] + Shared, + [EnumMember(Value = "user")] + User + } + internal static class FavoriteTypeEnumExtension + { + internal static string ToSerializedValue(this FavoriteType? value) + { + return value == null ? null : ((FavoriteType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this FavoriteType value) + { + switch( value ) + { + case FavoriteType.Shared: + return "shared"; + case FavoriteType.User: + return "user"; + } + return null; + } + + internal static FavoriteType? ParseFavoriteType(this string value) + { + switch( value ) + { + case "shared": + return FavoriteType.Shared; + case "user": + return FavoriteType.User; + } + return null; + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FlowType.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FlowType.cs new file mode 100644 index 000000000000..f16f6c5caf29 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/FlowType.cs @@ -0,0 +1,21 @@ +// +// 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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for FlowType. + /// + public static class FlowType + { + public const string Bluefield = "Bluefield"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/InnerError.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/InnerError.cs new file mode 100644 index 000000000000..cdf083b22996 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/InnerError.cs @@ -0,0 +1,60 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Inner error + /// + public partial class InnerError + { + /// + /// Initializes a new instance of the InnerError class. + /// + public InnerError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the InnerError class. + /// + /// Provides correlation for + /// request + /// Request time + public InnerError(string diagnosticcontext = default(string), System.DateTime? time = default(System.DateTime?)) + { + Diagnosticcontext = diagnosticcontext; + Time = time; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets provides correlation for request + /// + [JsonProperty(PropertyName = "diagnosticcontext")] + public string Diagnosticcontext { get; set; } + + /// + /// Gets or sets request time + /// + [JsonProperty(PropertyName = "time")] + public System.DateTime? Time { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemScope.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemScope.cs new file mode 100644 index 000000000000..d71e2c9644be --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemScope.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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for ItemScope. + /// + public static class ItemScope + { + public const string Shared = "shared"; + public const string User = "user"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemScopePath.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemScopePath.cs new file mode 100644 index 000000000000..ad0a1c470d92 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemScopePath.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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for ItemScopePath. + /// + public static class ItemScopePath + { + public const string AnalyticsItems = "analyticsItems"; + public const string MyanalyticsItems = "myanalyticsItems"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemType.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemType.cs new file mode 100644 index 000000000000..401e7582c5af --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemType.cs @@ -0,0 +1,24 @@ +// +// 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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for ItemType. + /// + public static class ItemType + { + public const string Query = "query"; + public const string Function = "function"; + public const string Folder = "folder"; + public const string Recent = "recent"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemTypeParameter.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemTypeParameter.cs new file mode 100644 index 000000000000..9e22126acc72 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/ItemTypeParameter.cs @@ -0,0 +1,25 @@ +// +// 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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for ItemTypeParameter. + /// + public static class ItemTypeParameter + { + public const string None = "none"; + public const string Query = "query"; + public const string Function = "function"; + public const string Folder = "folder"; + public const string Recent = "recent"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/LinkProperties.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/LinkProperties.cs new file mode 100644 index 000000000000..ed5c5d2cf6ad --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/LinkProperties.cs @@ -0,0 +1,67 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Contains a sourceId and workbook resource id to link two resources. + /// + public partial class LinkProperties + { + /// + /// Initializes a new instance of the LinkProperties class. + /// + public LinkProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LinkProperties class. + /// + /// The source Azure resource id + /// The workbook Azure resource id + /// The category of workbook + public LinkProperties(string sourceId = default(string), string targetId = default(string), string category = default(string)) + { + SourceId = sourceId; + TargetId = targetId; + Category = category; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the source Azure resource id + /// + [JsonProperty(PropertyName = "sourceId")] + public string SourceId { get; set; } + + /// + /// Gets or sets the workbook Azure resource id + /// + [JsonProperty(PropertyName = "targetId")] + public string TargetId { get; set; } + + /// + /// Gets or sets the category of workbook + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricId.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricId.cs deleted file mode 100644 index ff8f0db4fd0c..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricId.cs +++ /dev/null @@ -1,52 +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.ApplicationInsights.Query.Models -{ - - /// - /// Defines values for MetricId. - /// - public static class MetricId - { - public const string RequestsCount = "requests/count"; - public const string RequestsDuration = "requests/duration"; - public const string RequestsFailed = "requests/failed"; - public const string UsersCount = "users/count"; - public const string UsersAuthenticated = "users/authenticated"; - public const string PageViewsCount = "pageViews/count"; - public const string PageViewsDuration = "pageViews/duration"; - public const string ClientProcessingDuration = "client/processingDuration"; - public const string ClientReceiveDuration = "client/receiveDuration"; - public const string ClientNetworkDuration = "client/networkDuration"; - public const string ClientSendDuration = "client/sendDuration"; - public const string ClientTotalDuration = "client/totalDuration"; - public const string DependenciesCount = "dependencies/count"; - public const string DependenciesFailed = "dependencies/failed"; - public const string DependenciesDuration = "dependencies/duration"; - public const string ExceptionsCount = "exceptions/count"; - public const string ExceptionsBrowser = "exceptions/browser"; - public const string ExceptionsServer = "exceptions/server"; - public const string SessionsCount = "sessions/count"; - public const string PerformanceCountersRequestExecutionTime = "performanceCounters/requestExecutionTime"; - public const string PerformanceCountersRequestsPerSecond = "performanceCounters/requestsPerSecond"; - public const string PerformanceCountersRequestsInQueue = "performanceCounters/requestsInQueue"; - public const string PerformanceCountersMemoryAvailableBytes = "performanceCounters/memoryAvailableBytes"; - public const string PerformanceCountersExceptionsPerSecond = "performanceCounters/exceptionsPerSecond"; - public const string PerformanceCountersProcessCpuPercentage = "performanceCounters/processCpuPercentage"; - public const string PerformanceCountersProcessIOBytesPerSecond = "performanceCounters/processIOBytesPerSecond"; - public const string PerformanceCountersProcessPrivateBytes = "performanceCounters/processPrivateBytes"; - public const string PerformanceCountersProcessorCpuPercentage = "performanceCounters/processorCpuPercentage"; - public const string AvailabilityResultsAvailabilityPercentage = "availabilityResults/availabilityPercentage"; - public const string AvailabilityResultsDuration = "availabilityResults/duration"; - public const string BillingTelemetryCount = "billing/telemetryCount"; - public const string CustomEventsCount = "customEvents/count"; - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsPostBodySchema.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsPostBodySchema.cs deleted file mode 100644 index 7e069eb4ec04..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsPostBodySchema.cs +++ /dev/null @@ -1,87 +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.ApplicationInsights.Query.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// A metric request - /// - public partial class MetricsPostBodySchema - { - /// - /// Initializes a new instance of the MetricsPostBodySchema class. - /// - public MetricsPostBodySchema() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetricsPostBodySchema class. - /// - /// An identifier for this query. Must be unique - /// within the post body of the request. This identifier will be the - /// 'id' property of the response object representing this - /// query. - /// The parameters for a single metrics - /// query - public MetricsPostBodySchema(string id, MetricsPostBodySchemaParameters parameters) - { - Id = id; - Parameters = parameters; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets an identifier for this query. Must be unique within - /// the post body of the request. This identifier will be the 'id' - /// property of the response object representing this query. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets the parameters for a single metrics query - /// - [JsonProperty(PropertyName = "parameters")] - public MetricsPostBodySchemaParameters Parameters { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Id == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Id"); - } - if (Parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Parameters"); - } - if (Parameters != null) - { - Parameters.Validate(); - } - } - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsPostBodySchemaParameters.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsPostBodySchemaParameters.cs deleted file mode 100644 index 0d1b62589f4a..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsPostBodySchemaParameters.cs +++ /dev/null @@ -1,149 +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.ApplicationInsights.Query.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The parameters for a single metrics query - /// - public partial class MetricsPostBodySchemaParameters - { - /// - /// Initializes a new instance of the MetricsPostBodySchemaParameters - /// class. - /// - public MetricsPostBodySchemaParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetricsPostBodySchemaParameters - /// class. - /// - /// Possible values include: 'requests/count', - /// 'requests/duration', 'requests/failed', 'users/count', - /// 'users/authenticated', 'pageViews/count', 'pageViews/duration', - /// 'client/processingDuration', 'client/receiveDuration', - /// 'client/networkDuration', 'client/sendDuration', - /// 'client/totalDuration', 'dependencies/count', - /// 'dependencies/failed', 'dependencies/duration', 'exceptions/count', - /// 'exceptions/browser', 'exceptions/server', 'sessions/count', - /// 'performanceCounters/requestExecutionTime', - /// 'performanceCounters/requestsPerSecond', - /// 'performanceCounters/requestsInQueue', - /// 'performanceCounters/memoryAvailableBytes', - /// 'performanceCounters/exceptionsPerSecond', - /// 'performanceCounters/processCpuPercentage', - /// 'performanceCounters/processIOBytesPerSecond', - /// 'performanceCounters/processPrivateBytes', - /// 'performanceCounters/processorCpuPercentage', - /// 'availabilityResults/availabilityPercentage', - /// 'availabilityResults/duration', 'billing/telemetryCount', - /// 'customEvents/count' - public MetricsPostBodySchemaParameters(string metricId, string timespan = default(string), IList aggregation = default(IList), System.TimeSpan? interval = default(System.TimeSpan?), IList segment = default(IList), int? top = default(int?), string orderby = default(string), string filter = default(string)) - { - MetricId = metricId; - Timespan = timespan; - Aggregation = aggregation; - Interval = interval; - Segment = segment; - Top = top; - Orderby = orderby; - Filter = filter; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'requests/count', - /// 'requests/duration', 'requests/failed', 'users/count', - /// 'users/authenticated', 'pageViews/count', 'pageViews/duration', - /// 'client/processingDuration', 'client/receiveDuration', - /// 'client/networkDuration', 'client/sendDuration', - /// 'client/totalDuration', 'dependencies/count', - /// 'dependencies/failed', 'dependencies/duration', 'exceptions/count', - /// 'exceptions/browser', 'exceptions/server', 'sessions/count', - /// 'performanceCounters/requestExecutionTime', - /// 'performanceCounters/requestsPerSecond', - /// 'performanceCounters/requestsInQueue', - /// 'performanceCounters/memoryAvailableBytes', - /// 'performanceCounters/exceptionsPerSecond', - /// 'performanceCounters/processCpuPercentage', - /// 'performanceCounters/processIOBytesPerSecond', - /// 'performanceCounters/processPrivateBytes', - /// 'performanceCounters/processorCpuPercentage', - /// 'availabilityResults/availabilityPercentage', - /// 'availabilityResults/duration', 'billing/telemetryCount', - /// 'customEvents/count' - /// - [JsonProperty(PropertyName = "metricId")] - public string MetricId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "timespan")] - public string Timespan { get; set; } - - /// - /// - [JsonProperty(PropertyName = "aggregation")] - public IList Aggregation { get; set; } - - /// - /// - [JsonProperty(PropertyName = "interval")] - public System.TimeSpan? Interval { get; set; } - - /// - /// - [JsonProperty(PropertyName = "segment")] - public IList Segment { get; set; } - - /// - /// - [JsonProperty(PropertyName = "top")] - public int? Top { get; set; } - - /// - /// - [JsonProperty(PropertyName = "orderby")] - public string Orderby { get; set; } - - /// - /// - [JsonProperty(PropertyName = "filter")] - public string Filter { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (MetricId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "MetricId"); - } - } - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResult.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResult.cs deleted file mode 100644 index 5d2eca4c2bc6..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResult.cs +++ /dev/null @@ -1,49 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A metric result. - /// - public partial class MetricsResult - { - /// - /// Initializes a new instance of the MetricsResult class. - /// - public MetricsResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetricsResult class. - /// - public MetricsResult(MetricsResultInfo value = default(MetricsResultInfo)) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "value")] - public MetricsResultInfo Value { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResultInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResultInfo.cs deleted file mode 100644 index 1c05fcdb2b77..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsResultInfo.cs +++ /dev/null @@ -1,89 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A metric result data. - /// - public partial class MetricsResultInfo - { - /// - /// Initializes a new instance of the MetricsResultInfo class. - /// - public MetricsResultInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetricsResultInfo class. - /// - /// Unmatched properties from the - /// message are deserialized this collection - /// Start time of the metric. - /// Start time of the metric. - /// The interval used to segment the metric - /// data. - /// Segmented metric data (if - /// segmented). - public MetricsResultInfo(IDictionary additionalProperties = default(IDictionary), System.DateTime? start = default(System.DateTime?), System.DateTime? end = default(System.DateTime?), System.TimeSpan? interval = default(System.TimeSpan?), IList segments = default(IList)) - { - AdditionalProperties = additionalProperties; - Start = start; - End = end; - Interval = interval; - Segments = segments; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unmatched properties from the message are deserialized - /// this collection - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; set; } - - /// - /// Gets or sets start time of the metric. - /// - [JsonProperty(PropertyName = "start")] - public System.DateTime? Start { get; set; } - - /// - /// Gets or sets start time of the metric. - /// - [JsonProperty(PropertyName = "end")] - public System.DateTime? End { get; set; } - - /// - /// Gets or sets the interval used to segment the metric data. - /// - [JsonProperty(PropertyName = "interval")] - public System.TimeSpan? Interval { get; set; } - - /// - /// Gets or sets segmented metric data (if segmented). - /// - [JsonProperty(PropertyName = "segments")] - public IList Segments { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsSegment.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsSegment.cs deleted file mode 100644 index 873e368e9c45..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsSegment.cs +++ /dev/null @@ -1,36 +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.ApplicationInsights.Query.Models -{ - - /// - /// Defines values for MetricsSegment. - /// - public static class MetricsSegment - { - public const string ApplicationBuild = "applicationBuild"; - public const string ApplicationVersion = "applicationVersion"; - public const string AuthenticatedOrAnonymousTraffic = "authenticatedOrAnonymousTraffic"; - public const string Browser = "browser"; - public const string BrowserVersion = "browserVersion"; - public const string City = "city"; - public const string CloudRoleName = "cloudRoleName"; - public const string CloudServiceName = "cloudServiceName"; - public const string Continent = "continent"; - public const string CountryOrRegion = "countryOrRegion"; - public const string DeploymentId = "deploymentId"; - public const string DeploymentUnit = "deploymentUnit"; - public const string DeviceType = "deviceType"; - public const string Environment = "environment"; - public const string HostingLocation = "hostingLocation"; - public const string InstanceName = "instanceName"; - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsSegmentInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsSegmentInfo.cs deleted file mode 100644 index ee67de58eb8f..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/MetricsSegmentInfo.cs +++ /dev/null @@ -1,84 +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.ApplicationInsights.Query.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A metric segment - /// - public partial class MetricsSegmentInfo - { - /// - /// Initializes a new instance of the MetricsSegmentInfo class. - /// - public MetricsSegmentInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetricsSegmentInfo class. - /// - /// Unmatched properties from the - /// message are deserialized this collection - /// Start time of the metric segment (only when an - /// interval was specified). - /// Start time of the metric segment (only when an - /// interval was specified). - /// Segmented metric data (if further - /// segmented). - public MetricsSegmentInfo(IDictionary additionalProperties = default(IDictionary), System.DateTime? start = default(System.DateTime?), System.DateTime? end = default(System.DateTime?), IList segments = default(IList)) - { - AdditionalProperties = additionalProperties; - Start = start; - End = end; - Segments = segments; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets unmatched properties from the message are deserialized - /// this collection - /// - [JsonExtensionData] - public IDictionary AdditionalProperties { get; set; } - - /// - /// Gets or sets start time of the metric segment (only when an - /// interval was specified). - /// - [JsonProperty(PropertyName = "start")] - public System.DateTime? Start { get; set; } - - /// - /// Gets or sets start time of the metric segment (only when an - /// interval was specified). - /// - [JsonProperty(PropertyName = "end")] - public System.DateTime? End { get; set; } - - /// - /// Gets or sets segmented metric data (if further segmented). - /// - [JsonProperty(PropertyName = "segments")] - public IList Segments { get; set; } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Column.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Operation.cs similarity index 53% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Column.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Operation.cs index 6e64adf4efa7..4a28c2e8724a 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Column.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Operation.cs @@ -8,36 +8,35 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { using Newtonsoft.Json; using System.Linq; /// - /// A table column. + /// CDN REST API operation /// - /// - /// A column in a table. - /// - public partial class Column + public partial class Operation { /// - /// Initializes a new instance of the Column class. + /// Initializes a new instance of the Operation class. /// - public Column() + public Operation() { CustomInit(); } /// - /// Initializes a new instance of the Column class. + /// Initializes a new instance of the Operation class. /// - /// The name of this column. - /// The data type of this column. - public Column(string name = default(string), string type = default(string)) + /// Operation name: + /// {provider}/{resource}/{operation} + /// The object that represents the + /// operation. + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay)) { Name = name; - Type = type; + Display = display; CustomInit(); } @@ -47,16 +46,16 @@ public Column() partial void CustomInit(); /// - /// Gets or sets the name of this column. + /// Gets or sets operation name: {provider}/{resource}/{operation} /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets the data type of this column. + /// Gets or sets the object that represents the operation. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/OperationDisplay.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..60452c458c9f --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/OperationDisplay.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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The object that represents the operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Service provider: Microsoft.Cdn + /// Resource on which the operation is + /// performed: Profile, endpoint, etc. + /// Operation type: Read, write, delete, + /// etc. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets service provider: Microsoft.Cdn + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets resource on which the operation is performed: Profile, + /// endpoint, etc. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets operation type: Read, write, delete, etc. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Page.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Page.cs new file mode 100644 index 000000000000..b4a80108bd88 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Page.cs @@ -0,0 +1,53 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Page1.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Page1.cs new file mode 100644 index 000000000000..bfbe0bc45ecd --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Page1.cs @@ -0,0 +1,53 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/PurgeState.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/PurgeState.cs new file mode 100644 index 000000000000..0d19db6cc161 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/PurgeState.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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for PurgeState. + /// + public static class PurgeState + { + public const string Pending = "pending"; + public const string Completed = "completed"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/QueryBody.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/QueryBody.cs deleted file mode 100644 index 10fe2636ceee..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/QueryBody.cs +++ /dev/null @@ -1,91 +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.ApplicationInsights.Query.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The Analytics query. Learn more about the [Analytics query - /// syntax](https://azure.microsoft.com/documentation/articles/app-insights-analytics-reference/) - /// - public partial class QueryBody - { - /// - /// Initializes a new instance of the QueryBody class. - /// - public QueryBody() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the QueryBody class. - /// - /// The query to execute. - /// Optional. The timespan over which to query - /// data. This is an ISO8601 time period value. This timespan is - /// applied in addition to any that are specified in the query - /// expression. - /// A list of Application IDs for - /// cross-application queries. - public QueryBody(string query, string timespan = default(string), IList applications = default(IList)) - { - Query = query; - Timespan = timespan; - Applications = applications; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the query to execute. - /// - [JsonProperty(PropertyName = "query")] - public string Query { get; set; } - - /// - /// Gets or sets optional. The timespan over which to query data. This - /// is an ISO8601 time period value. This timespan is applied in - /// addition to any that are specified in the query expression. - /// - [JsonProperty(PropertyName = "timespan")] - public string Timespan { get; set; } - - /// - /// Gets or sets a list of Application IDs for cross-application - /// queries. - /// - [JsonProperty(PropertyName = "applications")] - public IList Applications { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Query == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Query"); - } - } - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/RequestSource.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/RequestSource.cs new file mode 100644 index 000000000000..f660747e7420 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/RequestSource.cs @@ -0,0 +1,21 @@ +// +// 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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for RequestSource. + /// + public static class RequestSource + { + public const string Rest = "rest"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/SharedTypeKind.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/SharedTypeKind.cs new file mode 100644 index 000000000000..aa9e3c156fcd --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/SharedTypeKind.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.ApplicationInsights.Management.Models +{ + + /// + /// Defines values for SharedTypeKind. + /// + public static class SharedTypeKind + { + public const string User = "user"; + public const string Shared = "shared"; + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Table.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Table.cs deleted file mode 100644 index b6f5f206255b..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Table.cs +++ /dev/null @@ -1,94 +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.ApplicationInsights.Query.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A query response table. - /// - /// - /// Contains the columns and rows for one table in a query response. - /// - public partial class Table - { - /// - /// Initializes a new instance of the Table class. - /// - public Table() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Table class. - /// - /// The name of the table. - /// The list of columns in this table. - /// The resulting rows from this query. - public Table(string name, IList columns, IList> rows) - { - Name = name; - Columns = columns; - Rows = rows; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the table. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the list of columns in this table. - /// - [JsonProperty(PropertyName = "columns")] - public IList Columns { get; set; } - - /// - /// Gets or sets the resulting rows from this query. - /// - [JsonProperty(PropertyName = "rows")] - public IList> Rows { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Columns == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Columns"); - } - if (Rows == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Rows"); - } - } - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsApplicationInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/TagsResource.cs similarity index 51% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsApplicationInfo.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/TagsResource.cs index 5319e14b6840..748400d45cc7 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsApplicationInfo.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/TagsResource.cs @@ -8,31 +8,34 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Application info for an event result + /// A container holding only the Tags for a resource, allowing the user to + /// update the tags on a WebTest instance. /// - public partial class EventsApplicationInfo + public partial class TagsResource { /// - /// Initializes a new instance of the EventsApplicationInfo class. + /// Initializes a new instance of the TagsResource class. /// - public EventsApplicationInfo() + public TagsResource() { CustomInit(); } /// - /// Initializes a new instance of the EventsApplicationInfo class. + /// Initializes a new instance of the TagsResource class. /// - /// Version of the application - public EventsApplicationInfo(string version = default(string)) + /// Resource tags + public TagsResource(IDictionary tags = default(IDictionary)) { - Version = version; + Tags = tags; CustomInit(); } @@ -42,10 +45,10 @@ public EventsApplicationInfo() partial void CustomInit(); /// - /// Gets or sets version of the application + /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTest.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTest.cs new file mode 100644 index 000000000000..79165da65619 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTest.cs @@ -0,0 +1,200 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Application Insights web test definition. + /// + [Rest.Serialization.JsonTransformation] + public partial class WebTest : WebtestsResource + { + /// + /// Initializes a new instance of the WebTest class. + /// + public WebTest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebTest class. + /// + /// Resource location + /// Unique ID of this WebTest. This is + /// typically the same value as the Name field. + /// User defined name if this + /// WebTest. + /// The kind of web test this is, valid + /// choices are ping and multistep. Possible values include: 'ping', + /// 'multistep' + /// A list of where to physically run the tests + /// from to give global coverage for accessibility of your + /// application. + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + /// The kind of web test that this web test watches. + /// Choices are ping and multistep. Possible values include: 'ping', + /// 'multistep' + /// Purpose/user defined descriptive test for + /// this WebTest. + /// Is the test actively being monitored. + /// Interval in seconds between test runs for + /// this WebTest. Default value is 300. + /// Seconds until this WebTest will timeout and + /// fail. Default value is 30. + /// Allow for retries should this WebTest + /// fail. + /// An XML configuration specification for + /// a WebTest. + /// Current state of this component, + /// whether or not is has been provisioned within the resource group it + /// is defined. Users cannot change this value but are able to read + /// from it. Values will include Succeeded, Deploying, Canceled, and + /// Failed. + public WebTest(string location, string syntheticMonitorId, string webTestName, WebTestKind webTestKind, IList locations, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), WebTestKind? kind = default(WebTestKind?), string description = default(string), bool? enabled = default(bool?), int? frequency = default(int?), int? timeout = default(int?), bool? retryEnabled = default(bool?), WebTestPropertiesConfiguration configuration = default(WebTestPropertiesConfiguration), string provisioningState = default(string)) + : base(location, id, name, type, tags) + { + Kind = kind; + SyntheticMonitorId = syntheticMonitorId; + WebTestName = webTestName; + Description = description; + Enabled = enabled; + Frequency = frequency; + Timeout = timeout; + WebTestKind = webTestKind; + RetryEnabled = retryEnabled; + Locations = locations; + Configuration = configuration; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the kind of web test that this web test watches. + /// Choices are ping and multistep. Possible values include: 'ping', + /// 'multistep' + /// + [JsonProperty(PropertyName = "kind")] + public WebTestKind? Kind { get; set; } + + /// + /// Gets or sets unique ID of this WebTest. This is typically the same + /// value as the Name field. + /// + [JsonProperty(PropertyName = "properties.SyntheticMonitorId")] + public string SyntheticMonitorId { get; set; } + + /// + /// Gets or sets user defined name if this WebTest. + /// + [JsonProperty(PropertyName = "properties.Name")] + public string WebTestName { get; set; } + + /// + /// Gets or sets purpose/user defined descriptive test for this + /// WebTest. + /// + [JsonProperty(PropertyName = "properties.Description")] + public string Description { get; set; } + + /// + /// Gets or sets is the test actively being monitored. + /// + [JsonProperty(PropertyName = "properties.Enabled")] + public bool? Enabled { get; set; } + + /// + /// Gets or sets interval in seconds between test runs for this + /// WebTest. Default value is 300. + /// + [JsonProperty(PropertyName = "properties.Frequency")] + public int? Frequency { get; set; } + + /// + /// Gets or sets seconds until this WebTest will timeout and fail. + /// Default value is 30. + /// + [JsonProperty(PropertyName = "properties.Timeout")] + public int? Timeout { get; set; } + + /// + /// Gets or sets the kind of web test this is, valid choices are ping + /// and multistep. Possible values include: 'ping', 'multistep' + /// + [JsonProperty(PropertyName = "properties.Kind")] + public WebTestKind WebTestKind { get; set; } + + /// + /// Gets or sets allow for retries should this WebTest fail. + /// + [JsonProperty(PropertyName = "properties.RetryEnabled")] + public bool? RetryEnabled { get; set; } + + /// + /// Gets or sets a list of where to physically run the tests from to + /// give global coverage for accessibility of your application. + /// + [JsonProperty(PropertyName = "properties.Locations")] + public IList Locations { get; set; } + + /// + /// Gets or sets an XML configuration specification for a WebTest. + /// + [JsonProperty(PropertyName = "properties.Configuration")] + public WebTestPropertiesConfiguration Configuration { get; set; } + + /// + /// Gets current state of this component, whether or not is has been + /// provisioned within the resource group it is defined. Users cannot + /// change this value but are able to read from it. Values will include + /// Succeeded, Deploying, Canceled, and Failed. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (SyntheticMonitorId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SyntheticMonitorId"); + } + if (WebTestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "WebTestName"); + } + if (Locations == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Locations"); + } + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsClientPerformanceInfo.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestGeolocation.cs similarity index 52% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsClientPerformanceInfo.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestGeolocation.cs index e3cb5c4a0740..62c4065a616d 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsClientPerformanceInfo.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestGeolocation.cs @@ -8,33 +8,33 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { using Newtonsoft.Json; using System.Linq; /// - /// Client performance information + /// Geo-physical location to run a web test from. You must specify one or + /// more locations for the test to run from. /// - public partial class EventsClientPerformanceInfo + public partial class WebTestGeolocation { /// - /// Initializes a new instance of the EventsClientPerformanceInfo - /// class. + /// Initializes a new instance of the WebTestGeolocation class. /// - public EventsClientPerformanceInfo() + public WebTestGeolocation() { CustomInit(); } /// - /// Initializes a new instance of the EventsClientPerformanceInfo - /// class. + /// Initializes a new instance of the WebTestGeolocation class. /// - /// The name of the client performance - public EventsClientPerformanceInfo(string name = default(string)) + /// Location ID for the webtest to run + /// from. + public WebTestGeolocation(string location = default(string)) { - Name = name; + Location = location; CustomInit(); } @@ -44,10 +44,10 @@ public EventsClientPerformanceInfo() partial void CustomInit(); /// - /// Gets or sets the name of the client performance + /// Gets or sets location ID for the webtest to run from. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [JsonProperty(PropertyName = "Id")] + public string Location { get; set; } } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestKind.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestKind.cs new file mode 100644 index 000000000000..07afe0084b30 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestKind.cs @@ -0,0 +1,60 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for WebTestKind. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum WebTestKind + { + [EnumMember(Value = "ping")] + Ping, + [EnumMember(Value = "multistep")] + Multistep + } + internal static class WebTestKindEnumExtension + { + internal static string ToSerializedValue(this WebTestKind? value) + { + return value == null ? null : ((WebTestKind)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this WebTestKind value) + { + switch( value ) + { + case WebTestKind.Ping: + return "ping"; + case WebTestKind.Multistep: + return "multistep"; + } + return null; + } + + internal static WebTestKind? ParseWebTestKind(this string value) + { + switch( value ) + { + case "ping": + return WebTestKind.Ping; + case "multistep": + return WebTestKind.Multistep; + } + return null; + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultDataCustomDimensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestPropertiesConfiguration.cs similarity index 52% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultDataCustomDimensions.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestPropertiesConfiguration.cs index f7f0cdffafc4..82adbd44dd34 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/EventsResultDataCustomDimensions.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebTestPropertiesConfiguration.cs @@ -8,32 +8,34 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query.Models +namespace Microsoft.Azure.Management.ApplicationInsights.Management.Models { using Newtonsoft.Json; using System.Linq; /// - /// Custom dimensions of the event + /// An XML configuration specification for a WebTest. /// - public partial class EventsResultDataCustomDimensions + public partial class WebTestPropertiesConfiguration { /// - /// Initializes a new instance of the EventsResultDataCustomDimensions + /// Initializes a new instance of the WebTestPropertiesConfiguration /// class. /// - public EventsResultDataCustomDimensions() + public WebTestPropertiesConfiguration() { CustomInit(); } /// - /// Initializes a new instance of the EventsResultDataCustomDimensions + /// Initializes a new instance of the WebTestPropertiesConfiguration /// class. /// - public EventsResultDataCustomDimensions(object additionalProperties = default(object)) + /// The XML specification of a WebTest to run + /// against an application. + public WebTestPropertiesConfiguration(string webTest = default(string)) { - AdditionalProperties = additionalProperties; + WebTest = webTest; CustomInit(); } @@ -43,9 +45,11 @@ public EventsResultDataCustomDimensions() partial void CustomInit(); /// + /// Gets or sets the XML specification of a WebTest to run against an + /// application. /// - [JsonProperty(PropertyName = "additionalProperties")] - public object AdditionalProperties { get; set; } + [JsonProperty(PropertyName = "WebTest")] + public string WebTest { get; set; } } } diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebtestsResource.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebtestsResource.cs new file mode 100644 index 000000000000..e7b5a24a74ed --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WebtestsResource.cs @@ -0,0 +1,100 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An azure resource object + /// + public partial class WebtestsResource : IResource + { + /// + /// Initializes a new instance of the WebtestsResource class. + /// + public WebtestsResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WebtestsResource class. + /// + /// Resource location + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource tags + public WebtestsResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets azure resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets azure resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets azure resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfiguration.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfiguration.cs new file mode 100644 index 000000000000..8e8a500cfd9d --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfiguration.cs @@ -0,0 +1,88 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Work item configuration associated with an application insights + /// resource. + /// + public partial class WorkItemConfiguration + { + /// + /// Initializes a new instance of the WorkItemConfiguration class. + /// + public WorkItemConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkItemConfiguration class. + /// + /// Connector identifier where work item is + /// created + /// Configuration friendly name + /// Boolean value indicating whether + /// configuration is default + /// Unique Id for work item + /// Serialized JSON object for detailed + /// properties + public WorkItemConfiguration(string connectorId = default(string), string configDisplayName = default(string), bool? isDefault = default(bool?), string id = default(string), string configProperties = default(string)) + { + ConnectorId = connectorId; + ConfigDisplayName = configDisplayName; + IsDefault = isDefault; + Id = id; + ConfigProperties = configProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets connector identifier where work item is created + /// + [JsonProperty(PropertyName = "ConnectorId")] + public string ConnectorId { get; set; } + + /// + /// Gets or sets configuration friendly name + /// + [JsonProperty(PropertyName = "ConfigDisplayName")] + public string ConfigDisplayName { get; set; } + + /// + /// Gets or sets boolean value indicating whether configuration is + /// default + /// + [JsonProperty(PropertyName = "IsDefault")] + public bool? IsDefault { get; set; } + + /// + /// Gets or sets unique Id for work item + /// + [JsonProperty(PropertyName = "Id")] + public string Id { get; set; } + + /// + /// Gets or sets serialized JSON object for detailed properties + /// + [JsonProperty(PropertyName = "ConfigProperties")] + public string ConfigProperties { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfigurationError.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfigurationError.cs new file mode 100644 index 000000000000..b20a34449024 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfigurationError.cs @@ -0,0 +1,66 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error associated with trying to get work item configuration or + /// configurations + /// + public partial class WorkItemConfigurationError + { + /// + /// Initializes a new instance of the WorkItemConfigurationError class. + /// + public WorkItemConfigurationError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkItemConfigurationError class. + /// + /// Error detail code and explanation + /// Error message + public WorkItemConfigurationError(string code = default(string), string message = default(string), InnerError innererror = default(InnerError)) + { + Code = code; + Message = message; + Innererror = innererror; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets error detail code and explanation + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets error message + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// + [JsonProperty(PropertyName = "innererror")] + public InnerError Innererror { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfigurationErrorException.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfigurationErrorException.cs new file mode 100644 index 000000000000..d804d471e0d7 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemConfigurationErrorException.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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with + /// WorkItemConfigurationError information. + /// + public partial class WorkItemConfigurationErrorException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public WorkItemConfigurationError Body { get; set; } + + /// + /// Initializes a new instance of the WorkItemConfigurationErrorException class. + /// + public WorkItemConfigurationErrorException() + { + } + + /// + /// Initializes a new instance of the WorkItemConfigurationErrorException class. + /// + /// The exception message. + public WorkItemConfigurationErrorException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the WorkItemConfigurationErrorException class. + /// + /// The exception message. + /// Inner exception. + public WorkItemConfigurationErrorException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemCreateConfiguration.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemCreateConfiguration.cs new file mode 100644 index 000000000000..c91b8774a5eb --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkItemCreateConfiguration.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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Work item configuration creation payload + /// + public partial class WorkItemCreateConfiguration + { + /// + /// Initializes a new instance of the WorkItemCreateConfiguration + /// class. + /// + public WorkItemCreateConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkItemCreateConfiguration + /// class. + /// + /// Unique connector id + /// Serialized JSON object for + /// detailed properties + /// Boolean indicating validate only + /// Custom work item + /// properties + public WorkItemCreateConfiguration(string connectorId = default(string), string connectorDataConfiguration = default(string), bool? validateOnly = default(bool?), IDictionary workItemProperties = default(IDictionary)) + { + ConnectorId = connectorId; + ConnectorDataConfiguration = connectorDataConfiguration; + ValidateOnly = validateOnly; + WorkItemProperties = workItemProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique connector id + /// + [JsonProperty(PropertyName = "ConnectorId")] + public string ConnectorId { get; set; } + + /// + /// Gets or sets serialized JSON object for detailed properties + /// + [JsonProperty(PropertyName = "ConnectorDataConfiguration")] + public string ConnectorDataConfiguration { get; set; } + + /// + /// Gets or sets boolean indicating validate only + /// + [JsonProperty(PropertyName = "ValidateOnly")] + public bool? ValidateOnly { get; set; } + + /// + /// Gets or sets custom work item properties + /// + [JsonProperty(PropertyName = "WorkItemProperties")] + public IDictionary WorkItemProperties { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Workbook.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Workbook.cs new file mode 100644 index 000000000000..d4a10828ffc5 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/Workbook.cs @@ -0,0 +1,201 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An Application Insights workbook definition. + /// + [Rest.Serialization.JsonTransformation] + public partial class Workbook : WorkbookResource + { + /// + /// Initializes a new instance of the Workbook class. + /// + public Workbook() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Workbook class. + /// + /// The user-defined name of the + /// workbook. + /// Configuration of this particular + /// workbook. Configuration data is a string containing valid + /// JSON + /// Internally assigned unique id of the + /// workbook definition. + /// Enum indicating if this workbook + /// definition is owned by a specific user or is shared between all + /// users with access to the Application Insights component. Possible + /// values include: 'user', 'shared' + /// Workbook category, as defined by the user at + /// creation time. + /// Unique user id of the specific user that owns + /// this workbook. + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource location + /// Resource tags + /// The kind of workbook. Choices are user and + /// shared. Possible values include: 'user', 'shared' + /// This instance's version of the data model. + /// This can change as new features are added that can be marked + /// workbook. + /// Date and time in UTC of the last + /// modification that was made to this workbook definition. + /// A list of 0 or more tags that are + /// associated with this workbook definition + /// Optional resourceId for a source + /// resource. + public Workbook(string workbookName, string serializedData, string workbookId, string sharedTypeKind, string category, string userId, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string version = default(string), string timeModified = default(string), IList workbookTags = default(IList), string sourceResourceId = default(string)) + : base(id, name, type, location, tags) + { + Kind = kind; + WorkbookName = workbookName; + SerializedData = serializedData; + Version = version; + WorkbookId = workbookId; + SharedTypeKind = sharedTypeKind; + TimeModified = timeModified; + Category = category; + WorkbookTags = workbookTags; + UserId = userId; + SourceResourceId = sourceResourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the kind of workbook. Choices are user and shared. + /// Possible values include: 'user', 'shared' + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets or sets the user-defined name of the workbook. + /// + [JsonProperty(PropertyName = "properties.name")] + public string WorkbookName { get; set; } + + /// + /// Gets or sets configuration of this particular workbook. + /// Configuration data is a string containing valid JSON + /// + [JsonProperty(PropertyName = "properties.serializedData")] + public string SerializedData { get; set; } + + /// + /// Gets or sets this instance's version of the data model. This can + /// change as new features are added that can be marked workbook. + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; set; } + + /// + /// Gets or sets internally assigned unique id of the workbook + /// definition. + /// + [JsonProperty(PropertyName = "properties.workbookId")] + public string WorkbookId { get; set; } + + /// + /// Gets or sets enum indicating if this workbook definition is owned + /// by a specific user or is shared between all users with access to + /// the Application Insights component. Possible values include: + /// 'user', 'shared' + /// + [JsonProperty(PropertyName = "properties.kind")] + public string SharedTypeKind { get; set; } + + /// + /// Gets date and time in UTC of the last modification that was made to + /// this workbook definition. + /// + [JsonProperty(PropertyName = "properties.timeModified")] + public string TimeModified { get; private set; } + + /// + /// Gets or sets workbook category, as defined by the user at creation + /// time. + /// + [JsonProperty(PropertyName = "properties.category")] + public string Category { get; set; } + + /// + /// Gets or sets a list of 0 or more tags that are associated with this + /// workbook definition + /// + [JsonProperty(PropertyName = "properties.tags")] + public IList WorkbookTags { get; set; } + + /// + /// Gets or sets unique user id of the specific user that owns this + /// workbook. + /// + [JsonProperty(PropertyName = "properties.userId")] + public string UserId { get; set; } + + /// + /// Gets or sets optional resourceId for a source resource. + /// + [JsonProperty(PropertyName = "properties.sourceResourceId")] + public string SourceResourceId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (WorkbookName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "WorkbookName"); + } + if (SerializedData == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SerializedData"); + } + if (WorkbookId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "WorkbookId"); + } + if (SharedTypeKind == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SharedTypeKind"); + } + if (Category == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Category"); + } + if (UserId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "UserId"); + } + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookError.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookError.cs new file mode 100644 index 000000000000..ee0478def290 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookError.cs @@ -0,0 +1,75 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Error message body that will indicate why the operation failed. + /// + public partial class WorkbookError + { + /// + /// Initializes a new instance of the WorkbookError class. + /// + public WorkbookError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkbookError class. + /// + /// Service-defined error code. This code serves as + /// a sub-status for the HTTP error code specified in the + /// response. + /// Human-readable representation of the + /// error. + /// The list of invalid fields send in request, + /// in case of validation error. + public WorkbookError(string code = default(string), string message = default(string), IList details = default(IList)) + { + Code = code; + Message = message; + Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets service-defined error code. This code serves as a + /// sub-status for the HTTP error code specified in the response. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; set; } + + /// + /// Gets or sets human-readable representation of the error. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; set; } + + /// + /// Gets or sets the list of invalid fields send in request, in case of + /// validation error. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookErrorException.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookErrorException.cs new file mode 100644 index 000000000000..5cc227dbc9e4 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookErrorException.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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with WorkbookError + /// information. + /// + public partial class WorkbookErrorException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public WorkbookError Body { get; set; } + + /// + /// Initializes a new instance of the WorkbookErrorException class. + /// + public WorkbookErrorException() + { + } + + /// + /// Initializes a new instance of the WorkbookErrorException class. + /// + /// The exception message. + public WorkbookErrorException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the WorkbookErrorException class. + /// + /// The exception message. + /// Inner exception. + public WorkbookErrorException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookResource.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookResource.cs new file mode 100644 index 000000000000..5cba7bcd9e3e --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Models/WorkbookResource.cs @@ -0,0 +1,87 @@ +// +// 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.ApplicationInsights.Management.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An azure resource object + /// + public partial class WorkbookResource : IResource + { + /// + /// Initializes a new instance of the WorkbookResource class. + /// + public WorkbookResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkbookResource class. + /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Resource location + /// Resource tags + public WorkbookResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Location = location; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets azure resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets azure resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets azure resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Operations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Operations.cs new file mode 100644 index 000000000000..2e469050f442 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Operations.cs @@ -0,0 +1,397 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Lists all of the available insights REST API operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Insights/operations").ToString(); + 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; + } + + /// + /// Lists all of the available insights REST API operations. + /// + /// + /// 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; + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/OperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..75d869166e9b --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/OperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// Lists all of the available insights REST API operations. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available insights REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all of the available insights REST API operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available insights REST API operations. + /// + /// + /// 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 IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Metrics.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ProactiveDetectionConfigurationsOperations.cs similarity index 51% rename from sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Metrics.cs rename to sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ProactiveDetectionConfigurationsOperations.cs index 74ceeca5567c..ed242de42dc2 100644 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/Metrics.cs +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ProactiveDetectionConfigurationsOperations.cs @@ -8,14 +8,14 @@ // regenerated. // -namespace Microsoft.Azure.ApplicationInsights.Query +namespace Microsoft.Azure.Management.ApplicationInsights.Management { using Microsoft.Rest; + using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -23,12 +23,12 @@ namespace Microsoft.Azure.ApplicationInsights.Query using System.Threading.Tasks; /// - /// Metrics operations. + /// ProactiveDetectionConfigurationsOperations operations. /// - public partial class Metrics : IServiceOperations, IMetrics + internal partial class ProactiveDetectionConfigurationsOperations : IServiceOperations, IProactiveDetectionConfigurationsOperations { /// - /// Initializes a new instance of the Metrics class. + /// Initializes a new instance of the ProactiveDetectionConfigurationsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ public partial class Metrics : IServiceOperations /// /// Thrown when a required parameter is null /// - public Metrics(ApplicationInsightsDataClient client) + internal ProactiveDetectionConfigurationsOperations(ApplicationInsightsManagementClient client) { if (client == null) { @@ -46,82 +46,19 @@ public Metrics(ApplicationInsightsDataClient client) } /// - /// Gets a reference to the ApplicationInsightsDataClient + /// Gets a reference to the ApplicationInsightsManagementClient /// - public ApplicationInsightsDataClient Client { get; private set; } + public ApplicationInsightsManagementClient Client { get; private set; } /// - /// Retrieve metric data + /// Gets a list of ProactiveDetection configurations of an Application Insights + /// component. /// - /// - /// Gets metric values for a single metric - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. + /// + /// The name of the resource group. The name is case insensitive. /// - /// - /// ID of the metric. This is either a standard AI metric, or an - /// application-specific custom metric. Possible values include: - /// 'requests/count', 'requests/duration', 'requests/failed', 'users/count', - /// 'users/authenticated', 'pageViews/count', 'pageViews/duration', - /// 'client/processingDuration', 'client/receiveDuration', - /// 'client/networkDuration', 'client/sendDuration', 'client/totalDuration', - /// 'dependencies/count', 'dependencies/failed', 'dependencies/duration', - /// 'exceptions/count', 'exceptions/browser', 'exceptions/server', - /// 'sessions/count', 'performanceCounters/requestExecutionTime', - /// 'performanceCounters/requestsPerSecond', - /// 'performanceCounters/requestsInQueue', - /// 'performanceCounters/memoryAvailableBytes', - /// 'performanceCounters/exceptionsPerSecond', - /// 'performanceCounters/processCpuPercentage', - /// 'performanceCounters/processIOBytesPerSecond', - /// 'performanceCounters/processPrivateBytes', - /// 'performanceCounters/processorCpuPercentage', - /// 'availabilityResults/availabilityPercentage', - /// 'availabilityResults/duration', 'billing/telemetryCount', - /// 'customEvents/count' - /// - /// - /// The timespan over which to retrieve metric values. This is an ISO8601 time - /// period value. If timespan is omitted, a default time range of `PT12H` - /// ("last 12 hours") is used. The actual timespan that is queried may be - /// adjusted by the server based. In all cases, the actual time span used for - /// the query is included in the response. - /// - /// - /// The time interval to use when retrieving metric values. This is an ISO8601 - /// duration. If interval is omitted, the metric value is aggregated across the - /// entire timespan. If interval is supplied, the server may adjust the - /// interval to a more appropriate size based on the timespan used for the - /// query. In all cases, the actual interval used for the query is included in - /// the response. - /// - /// - /// The aggregation to use when computing the metric values. To retrieve more - /// than one aggregation at a time, separate them with a comma. If no - /// aggregation is specified, then the default aggregation for the metric is - /// used. - /// - /// - /// The name of the dimension to segment the metric values by. This dimension - /// must be applicable to the metric you are retrieving. To segment by more - /// than one dimension at a time, separate them with a comma (,). In this case, - /// the metric data will be segmented in the order the dimensions are listed in - /// the parameter. - /// - /// - /// The number of segments to return. This value is only valid when segment is - /// specified. - /// - /// - /// The aggregation function and direction to sort the segments by. This value - /// is only valid when segment is specified. - /// - /// - /// An expression used to filter the results. This value should be a valid - /// OData filter expression where the keys of each clause should be applicable - /// dimensions for the metric you are retrieving. + /// + /// The name of the Application Insights component resource. /// /// /// Headers that will be added to request. @@ -129,7 +66,7 @@ public Metrics(ApplicationInsightsDataClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -144,30 +81,53 @@ public Metrics(ApplicationInsightsDataClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string appId, string metricId, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), IList aggregation = default(IList), IList segment = default(IList), int? top = default(int?), string orderby = default(string), string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (appId == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appId"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (metricId == null) + if (resourceGroupName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "metricId"); + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } - if (aggregation != null) + if (Client.ApiVersion == null) { - if (aggregation.Count < 1) + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) { - throw new ValidationException(ValidationRules.MinItems, "aggregation", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } - if (segment != null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) { - if (segment.Count < 1) + if (Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinItems, "segment", 1); + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -175,55 +135,25 @@ public Metrics(ApplicationInsightsDataClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appId", appId); - tracingParameters.Add("metricId", metricId); - tracingParameters.Add("timespan", timespan); - tracingParameters.Add("interval", interval); - tracingParameters.Add("aggregation", aggregation); - tracingParameters.Add("segment", segment); - tracingParameters.Add("top", top); - tracingParameters.Add("orderby", orderby); - tracingParameters.Add("filter", filter); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "apps/{appId}/metrics/{metricId}").ToString(); - _url = _url.Replace("{appId}", System.Uri.EscapeDataString(appId)); - _url = _url.Replace("{metricId}", System.Uri.EscapeDataString(metricId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); - if (timespan != null) - { - _queryParameters.Add(string.Format("timespan={0}", System.Uri.EscapeDataString(timespan))); - } - if (interval != null) - { - _queryParameters.Add(string.Format("interval={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(interval, Client.SerializationSettings).Trim('"')))); - } - if (aggregation != null) - { - _queryParameters.Add(string.Format("aggregation={0}", System.Uri.EscapeDataString(string.Join(",", aggregation)))); - } - if (segment != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("segment={0}", System.Uri.EscapeDataString(string.Join(",", segment)))); - } - if (top != null) - { - _queryParameters.Add(string.Format("top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); - } - if (orderby != null) - { - _queryParameters.Add(string.Format("orderby={0}", System.Uri.EscapeDataString(orderby))); - } - if (filter != null) - { - _queryParameters.Add(string.Format("filter={0}", System.Uri.EscapeDataString(filter))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); @@ -231,6 +161,18 @@ public Metrics(ApplicationInsightsDataClient client) _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) @@ -269,13 +211,14 @@ public Metrics(ApplicationInsightsDataClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(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); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -285,6 +228,10 @@ public Metrics(ApplicationInsightsDataClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -297,16 +244,20 @@ public Metrics(ApplicationInsightsDataClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + 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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -326,17 +277,17 @@ public Metrics(ApplicationInsightsDataClient client) } /// - /// Retrieve metric data + /// Get the ProactiveDetection configuration for this configuration id. /// - /// - /// Gets metric values for multiple metrics - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. /// - /// - /// The batched metrics query. + /// + /// The ProactiveDetection configuration ID. This is unique within a + /// Application Insights component. /// /// /// Headers that will be added to request. @@ -344,7 +295,7 @@ public Metrics(ApplicationInsightsDataClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -359,26 +310,57 @@ public Metrics(ApplicationInsightsDataClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetMultipleWithHttpMessagesAsync(string appId, IList body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, string configurationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (appId == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (body == null) + if (Client.ApiVersion != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } } - if (body != null) + if (Client.SubscriptionId == null) { - foreach (var element in body) + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) { - if (element != null) - { - element.Validate(); - } + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (configurationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationId"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -386,21 +368,46 @@ public Metrics(ApplicationInsightsDataClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appId", appId); - tracingParameters.Add("body", body); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("configurationId", configurationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMultiple", 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("/") ? "" : "/")), "apps/{appId}/metrics").ToString(); - _url = _url.Replace("{appId}", System.Uri.EscapeDataString(appId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{ConfigurationId}", System.Uri.EscapeDataString(configurationId)); + 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.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) @@ -417,12 +424,6 @@ public Metrics(ApplicationInsightsDataClient client) // Serialize Request string _requestContent = null; - if(body != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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) { @@ -445,13 +446,14 @@ public Metrics(ApplicationInsightsDataClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(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); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -461,6 +463,10 @@ public Metrics(ApplicationInsightsDataClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -473,16 +479,20 @@ public Metrics(ApplicationInsightsDataClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse>(); + 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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -502,14 +512,21 @@ public Metrics(ApplicationInsightsDataClient client) } /// - /// Retrieve metric metatadata + /// Update the ProactiveDetection configuration for this configuration id. /// - /// - /// Gets metadata describing the available metrics - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The ProactiveDetection configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// Properties that need to be specified to update the ProactiveDetection + /// configuration. /// /// /// Headers that will be added to request. @@ -517,7 +534,7 @@ public Metrics(ApplicationInsightsDataClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -532,11 +549,60 @@ public Metrics(ApplicationInsightsDataClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetMetadataWithHttpMessagesAsync(string appId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, string configurationId, ApplicationInsightsComponentProactiveDetectionConfiguration proactiveDetectionProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (appId == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "appId"); + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (configurationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationId"); + } + if (proactiveDetectionProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "proactiveDetectionProperties"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -545,20 +611,47 @@ public Metrics(ApplicationInsightsDataClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("appId", appId); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("configurationId", configurationId); + tracingParameters.Add("proactiveDetectionProperties", proactiveDetectionProperties); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetMetadata", 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("/") ? "" : "/")), "apps/{appId}/metrics/metadata").ToString(); - _url = _url.Replace("{appId}", System.Uri.EscapeDataString(appId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{ConfigurationId}", System.Uri.EscapeDataString(configurationId)); + 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.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) @@ -575,6 +668,12 @@ public Metrics(ApplicationInsightsDataClient client) // Serialize Request string _requestContent = null; + if(proactiveDetectionProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(proactiveDetectionProperties, 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) { @@ -597,13 +696,14 @@ public Metrics(ApplicationInsightsDataClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(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); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -613,6 +713,10 @@ public Metrics(ApplicationInsightsDataClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -625,16 +729,20 @@ public Metrics(ApplicationInsightsDataClient client) throw ex; } // Create Result - var _result = new HttpOperationResponse(); + 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); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ProactiveDetectionConfigurationsOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ProactiveDetectionConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..26a34263ada5 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/ProactiveDetectionConfigurationsOperationsExtensions.cs @@ -0,0 +1,173 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ProactiveDetectionConfigurationsOperations. + /// + public static partial class ProactiveDetectionConfigurationsOperationsExtensions + { + /// + /// Gets a list of ProactiveDetection configurations of an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static IList List(this IProactiveDetectionConfigurationsOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of ProactiveDetection configurations of an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IProactiveDetectionConfigurationsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the ProactiveDetection configuration for this configuration id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The ProactiveDetection configuration ID. This is unique within a + /// Application Insights component. + /// + public static ApplicationInsightsComponentProactiveDetectionConfiguration Get(this IProactiveDetectionConfigurationsOperations operations, string resourceGroupName, string resourceName, string configurationId) + { + return operations.GetAsync(resourceGroupName, resourceName, configurationId).GetAwaiter().GetResult(); + } + + /// + /// Get the ProactiveDetection configuration for this configuration id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The ProactiveDetection configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IProactiveDetectionConfigurationsOperations operations, string resourceGroupName, string resourceName, string configurationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, configurationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update the ProactiveDetection configuration for this configuration id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The ProactiveDetection configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// Properties that need to be specified to update the ProactiveDetection + /// configuration. + /// + public static ApplicationInsightsComponentProactiveDetectionConfiguration Update(this IProactiveDetectionConfigurationsOperations operations, string resourceGroupName, string resourceName, string configurationId, ApplicationInsightsComponentProactiveDetectionConfiguration proactiveDetectionProperties) + { + return operations.UpdateAsync(resourceGroupName, resourceName, configurationId, proactiveDetectionProperties).GetAwaiter().GetResult(); + } + + /// + /// Update the ProactiveDetection configuration for this configuration id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The ProactiveDetection configuration ID. This is unique within a + /// Application Insights component. + /// + /// + /// Properties that need to be specified to update the ProactiveDetection + /// configuration. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IProactiveDetectionConfigurationsOperations operations, string resourceGroupName, string resourceName, string configurationId, ApplicationInsightsComponentProactiveDetectionConfiguration proactiveDetectionProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, configurationId, proactiveDetectionProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/QueryOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/QueryOperationsExtensions.cs deleted file mode 100644 index b056b6b2d48c..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/QueryOperationsExtensions.cs +++ /dev/null @@ -1,93 +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.ApplicationInsights.Query -{ - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for QueryOperations. - /// - public static partial class QueryOperationsExtensions - { - /// - /// Execute an Analytics query - /// - /// - /// Executes an Analytics query for data. - /// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) - /// is an example for using POST with an Analytics query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The query to execute. - /// - /// - /// Optional. The timespan over which to query data. This is an ISO8601 time - /// period value. This timespan is applied in addition to any that are - /// specified in the query expression. - /// - /// - /// A list of Application IDs for cross-application queries. - /// - public static QueryResults Execute(this IQueryOperations operations, string appId, string query, string timespan = default(string), IList applications = default(IList)) - { - return operations.ExecuteAsync(appId, query, timespan, applications).GetAwaiter().GetResult(); - } - - /// - /// Execute an Analytics query - /// - /// - /// Executes an Analytics query for data. - /// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) - /// is an example for using POST with an Analytics query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// ID of the application. This is Application ID from the API Access settings - /// blade in the Azure portal. - /// - /// - /// The query to execute. - /// - /// - /// Optional. The timespan over which to query data. This is an ISO8601 time - /// period value. This timespan is applied in addition to any that are - /// specified in the query expression. - /// - /// - /// A list of Application IDs for cross-application queries. - /// - /// - /// The cancellation token. - /// - public static async Task ExecuteAsync(this IQueryOperations operations, string appId, string query, string timespan = default(string), IList applications = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExecuteWithHttpMessagesAsync(appId, query, timespan, applications, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/SdkInfo_ApplicationInsightsDataClient.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/SdkInfo_ApplicationInsightsDataClient.cs deleted file mode 100644 index 690be7cf7f1f..000000000000 --- a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/SdkInfo_ApplicationInsightsDataClient.cs +++ /dev/null @@ -1,29 +0,0 @@ - -// -// 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.ApplicationInsights.Query -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_ApplicationInsightsDataClient - { - get - { - return new Tuple[] - { - new Tuple("ApplicationInsightsDataClient", "Events", "v1"), - new Tuple("ApplicationInsightsDataClient", "Metrics", "v1"), - new Tuple("ApplicationInsightsDataClient", "Query", "v1"), - }.AsEnumerable(); - } - } - } -} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/SdkInfo_ApplicationInsightsManagementClient.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/SdkInfo_ApplicationInsightsManagementClient.cs new file mode 100644 index 000000000000..7913ef24174c --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/SdkInfo_ApplicationInsightsManagementClient.cs @@ -0,0 +1,42 @@ + +// +// 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.ApplicationInsights.Management +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_ApplicationInsightsManagementClient + { + get + { + return new Tuple[] + { + new Tuple("Insights", "APIKeys", "2015-05-01"), + new Tuple("Insights", "Annotations", "2015-05-01"), + new Tuple("Insights", "ComponentAvailableFeatures", "2015-05-01"), + new Tuple("Insights", "ComponentCurrentBillingFeatures", "2015-05-01"), + new Tuple("Insights", "ComponentFeatureCapabilities", "2015-05-01"), + new Tuple("Insights", "ComponentQuotaStatus", "2015-05-01"), + new Tuple("Insights", "Components", "2015-05-01"), + new Tuple("Insights", "ExportConfigurations", "2015-05-01"), + new Tuple("Insights", "Favorites", "2015-05-01"), + new Tuple("Insights", "Operations", "2015-05-01"), + new Tuple("Insights", "ProactiveDetectionConfigurations", "2015-05-01"), + new Tuple("Insights", "WebTests", "2015-05-01"), + new Tuple("Insights", "WorkItemConfigurations", "2015-05-01"), + new Tuple("Insights", "webTestLocations", "2015-05-01"), + new Tuple("insights", "AnalyticsItems", "2015-05-01"), + new Tuple("insights", "Workbooks", "2015-05-01"), + }.AsEnumerable(); + } + } + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestLocationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestLocationsOperations.cs new file mode 100644 index 000000000000..3e417f85e638 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestLocationsOperations.cs @@ -0,0 +1,280 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// WebTestLocationsOperations operations. + /// + internal partial class WebTestLocationsOperations : IServiceOperations, IWebTestLocationsOperations + { + /// + /// Initializes a new instance of the WebTestLocationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WebTestLocationsOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Gets a list of web test locations available to this Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/syntheticmonitorlocations").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestLocationsOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestLocationsOperationsExtensions.cs new file mode 100644 index 000000000000..ab7e4e9f97bc --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestLocationsOperationsExtensions.cs @@ -0,0 +1,69 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WebTestLocationsOperations. + /// + public static partial class WebTestLocationsOperationsExtensions + { + /// + /// Gets a list of web test locations available to this Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static IEnumerable List(this IWebTestLocationsOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of web test locations available to this Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWebTestLocationsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestsOperations.cs new file mode 100644 index 000000000000..ed5eededf6d6 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestsOperations.cs @@ -0,0 +1,2123 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// WebTestsOperations operations. + /// + internal partial class WebTestsOperations : IServiceOperations, IWebTestsOperations + { + /// + /// Initializes a new instance of the WebTestsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WebTestsOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Get all Application Insights web tests defined within a specified resource + /// group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 a specific Application Insights web test definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string webTestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (webTestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webTestName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("webTestName", webTestName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{webTestName}", System.Uri.EscapeDataString(webTestName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates or updates an Application Insights web test definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Properties that need to be specified to create or update an Application + /// Insights web test definition. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string webTestName, WebTest webTestDefinition, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (webTestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webTestName"); + } + if (webTestDefinition == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webTestDefinition"); + } + if (webTestDefinition != null) + { + webTestDefinition.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("webTestName", webTestName); + tracingParameters.Add("webTestDefinition", webTestDefinition); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{webTestName}", System.Uri.EscapeDataString(webTestName)); + 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(webTestDefinition != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(webTestDefinition, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates or updates an Application Insights web test definition. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Resource tags + /// + /// + /// 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string webTestName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (webTestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webTestName"); + } + TagsResource webTestTags = new TagsResource(); + if (tags != null) + { + webTestTags.Tags = tags; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("webTestName", webTestName); + tracingParameters.Add("webTestTags", webTestTags); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateTags", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{webTestName}", System.Uri.EscapeDataString(webTestName)); + 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(webTestTags != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(webTestTags, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Deletes an Application Insights web test. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string webTestName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (webTestName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "webTestName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("webTestName", webTestName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{webTestName}", System.Uri.EscapeDataString(webTestName)); + 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("DELETE"); + _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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get all Application Insights web test alerts definitions within a + /// subscription. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests").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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 all Application Insights web tests defined for the specified component. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// 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>> ListByComponentWithHttpMessagesAsync(string componentName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (componentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "componentName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("componentName", componentName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByComponent", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{componentName}/webtests").ToString(); + _url = _url.Replace("{componentName}", System.Uri.EscapeDataString(componentName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _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("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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 all Application Insights web tests defined within a specified resource + /// group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 all Application Insights web test alerts definitions within a + /// subscription. + /// + /// + /// 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 all Application Insights web tests defined for the specified component. + /// + /// + /// 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>> ListByComponentNextWithHttpMessagesAsync(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, "ListByComponentNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestsOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestsOperationsExtensions.cs new file mode 100644 index 000000000000..8bb6c1710157 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WebTestsOperationsExtensions.cs @@ -0,0 +1,410 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WebTestsOperations. + /// + public static partial class WebTestsOperationsExtensions + { + /// + /// Get all Application Insights web tests defined within a specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IPage ListByResourceGroup(this IWebTestsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get all Application Insights web tests defined within a specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWebTestsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a specific Application Insights web test definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + public static WebTest Get(this IWebTestsOperations operations, string resourceGroupName, string webTestName) + { + return operations.GetAsync(resourceGroupName, webTestName).GetAwaiter().GetResult(); + } + + /// + /// Get a specific Application Insights web test definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWebTestsOperations operations, string resourceGroupName, string webTestName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, webTestName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an Application Insights web test definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Properties that need to be specified to create or update an Application + /// Insights web test definition. + /// + public static WebTest CreateOrUpdate(this IWebTestsOperations operations, string resourceGroupName, string webTestName, WebTest webTestDefinition) + { + return operations.CreateOrUpdateAsync(resourceGroupName, webTestName, webTestDefinition).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Application Insights web test definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Properties that need to be specified to create or update an Application + /// Insights web test definition. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IWebTestsOperations operations, string resourceGroupName, string webTestName, WebTest webTestDefinition, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, webTestName, webTestDefinition, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an Application Insights web test definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Resource tags + /// + public static WebTest UpdateTags(this IWebTestsOperations operations, string resourceGroupName, string webTestName, IDictionary tags = default(IDictionary)) + { + return operations.UpdateTagsAsync(resourceGroupName, webTestName, tags).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an Application Insights web test definition. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// Resource tags + /// + /// + /// The cancellation token. + /// + public static async Task UpdateTagsAsync(this IWebTestsOperations operations, string resourceGroupName, string webTestName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateTagsWithHttpMessagesAsync(resourceGroupName, webTestName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an Application Insights web test. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + public static void Delete(this IWebTestsOperations operations, string resourceGroupName, string webTestName) + { + operations.DeleteAsync(resourceGroupName, webTestName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an Application Insights web test. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights webtest resource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWebTestsOperations operations, string resourceGroupName, string webTestName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, webTestName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Get all Application Insights web test alerts definitions within a + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IWebTestsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Get all Application Insights web test alerts definitions within a + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWebTestsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all Application Insights web tests defined for the specified component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + public static IPage ListByComponent(this IWebTestsOperations operations, string componentName, string resourceGroupName) + { + return operations.ListByComponentAsync(componentName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get all Application Insights web tests defined for the specified component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByComponentAsync(this IWebTestsOperations operations, string componentName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByComponentWithHttpMessagesAsync(componentName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all Application Insights web tests defined within a specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IWebTestsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all Application Insights web tests defined within a specified resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IWebTestsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all Application Insights web test alerts definitions within a + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IWebTestsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all Application Insights web test alerts definitions within a + /// subscription. + /// + /// + /// 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 IWebTestsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get all Application Insights web tests defined for the specified component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByComponentNext(this IWebTestsOperations operations, string nextPageLink) + { + return operations.ListByComponentNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get all Application Insights web tests defined for the specified component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByComponentNextAsync(this IWebTestsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByComponentNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkItemConfigurationsOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkItemConfigurationsOperations.cs new file mode 100644 index 000000000000..71caa7caf5e3 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkItemConfigurationsOperations.cs @@ -0,0 +1,1439 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// WorkItemConfigurationsOperations operations. + /// + internal partial class WorkItemConfigurationsOperations : IServiceOperations, IWorkItemConfigurationsOperations + { + /// + /// Initializes a new instance of the WorkItemConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkItemConfigurationsOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Gets the list work item configurations that exist for the application + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 WorkItemConfigurationErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + WorkItemConfigurationError _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; + } + + /// + /// Create a work item configuration for an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a work item configuration of + /// a Application Insights component. + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string resourceName, WorkItemCreateConfiguration workItemConfigurationProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (workItemConfigurationProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workItemConfigurationProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("workItemConfigurationProperties", workItemConfigurationProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(workItemConfigurationProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workItemConfigurationProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 default work item configurations that exist for the application + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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> GetDefaultWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetDefault", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Delete a work item configuration of an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string workItemConfigId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (workItemConfigId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workItemConfigId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("workItemConfigId", workItemConfigId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{workItemConfigId}", System.Uri.EscapeDataString(workItemConfigId)); + 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("DELETE"); + _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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets specified work item configuration for an Application Insights + /// component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + /// + /// 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> GetItemWithHttpMessagesAsync(string resourceGroupName, string resourceName, string workItemConfigId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (workItemConfigId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workItemConfigId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("workItemConfigId", workItemConfigId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetItem", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{workItemConfigId}", System.Uri.EscapeDataString(workItemConfigId)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Update a work item configuration for an Application Insights component. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + /// + /// Properties that need to be specified to update a work item configuration + /// for this Application Insights component. + /// + /// + /// 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> UpdateItemWithHttpMessagesAsync(string resourceGroupName, string resourceName, string workItemConfigId, WorkItemCreateConfiguration workItemConfigurationProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (workItemConfigId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workItemConfigId"); + } + if (workItemConfigurationProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workItemConfigurationProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("workItemConfigId", workItemConfigId); + tracingParameters.Add("workItemConfigurationProperties", workItemConfigurationProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateItem", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{workItemConfigId}", System.Uri.EscapeDataString(workItemConfigId)); + 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(workItemConfigurationProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workItemConfigurationProperties, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkItemConfigurationsOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkItemConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..9e27b35b09e1 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkItemConfigurationsOperationsExtensions.cs @@ -0,0 +1,306 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkItemConfigurationsOperations. + /// + public static partial class WorkItemConfigurationsOperationsExtensions + { + /// + /// Gets the list work item configurations that exist for the application + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static IEnumerable List(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName) + { + return operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the list work item configurations that exist for the application + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create a work item configuration for an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a work item configuration of + /// a Application Insights component. + /// + public static WorkItemConfiguration Create(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, WorkItemCreateConfiguration workItemConfigurationProperties) + { + return operations.CreateAsync(resourceGroupName, resourceName, workItemConfigurationProperties).GetAwaiter().GetResult(); + } + + /// + /// Create a work item configuration for an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a work item configuration of + /// a Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, WorkItemCreateConfiguration workItemConfigurationProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, resourceName, workItemConfigurationProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets default work item configurations that exist for the application + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static WorkItemConfiguration GetDefault(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetDefaultAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets default work item configurations that exist for the application + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetDefaultAsync(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetDefaultWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a work item configuration of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + public static void Delete(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, string workItemConfigId) + { + operations.DeleteAsync(resourceGroupName, resourceName, workItemConfigId).GetAwaiter().GetResult(); + } + + /// + /// Delete a work item configuration of an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, string workItemConfigId, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, workItemConfigId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets specified work item configuration for an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + public static WorkItemConfiguration GetItem(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, string workItemConfigId) + { + return operations.GetItemAsync(resourceGroupName, resourceName, workItemConfigId).GetAwaiter().GetResult(); + } + + /// + /// Gets specified work item configuration for an Application Insights + /// component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + /// + /// The cancellation token. + /// + public static async Task GetItemAsync(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, string workItemConfigId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetItemWithHttpMessagesAsync(resourceGroupName, resourceName, workItemConfigId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a work item configuration for an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + /// + /// Properties that need to be specified to update a work item configuration + /// for this Application Insights component. + /// + public static WorkItemConfiguration UpdateItem(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, string workItemConfigId, WorkItemCreateConfiguration workItemConfigurationProperties) + { + return operations.UpdateItemAsync(resourceGroupName, resourceName, workItemConfigId, workItemConfigurationProperties).GetAwaiter().GetResult(); + } + + /// + /// Update a work item configuration for an Application Insights component. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The unique work item configuration Id. This can be either friendly name of + /// connector as defined in connector configuration + /// + /// + /// Properties that need to be specified to update a work item configuration + /// for this Application Insights component. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateItemAsync(this IWorkItemConfigurationsOperations operations, string resourceGroupName, string resourceName, string workItemConfigId, WorkItemCreateConfiguration workItemConfigurationProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateItemWithHttpMessagesAsync(resourceGroupName, resourceName, workItemConfigId, workItemConfigurationProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkbooksOperations.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkbooksOperations.cs new file mode 100644 index 000000000000..05f28e66b81a --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkbooksOperations.cs @@ -0,0 +1,1204 @@ +// +// 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.ApplicationInsights.Management +{ + 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; + + /// + /// WorkbooksOperations operations. + /// + internal partial class WorkbooksOperations : IServiceOperations, IWorkbooksOperations + { + /// + /// Initializes a new instance of the WorkbooksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkbooksOperations(ApplicationInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ApplicationInsightsManagementClient + /// + public ApplicationInsightsManagementClient Client { get; private set; } + + /// + /// Get all Workbooks defined within a specified resource group and category. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Category of workbook to return. Possible values include: 'workbook', 'TSG', + /// 'performance', 'retention' + /// + /// + /// Tags presents on each workbook returned. + /// + /// + /// Flag indicating whether or not to return the full content for each + /// applicable workbook. If false, only return summary content for workbooks. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string category, IList tags = default(IList), bool? canFetchContent = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (category == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "category"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("category", category); + tracingParameters.Add("tags", tags); + tracingParameters.Add("canFetchContent", canFetchContent); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (category != null) + { + _queryParameters.Add(string.Format("category={0}", System.Uri.EscapeDataString(category))); + } + if (tags != null) + { + _queryParameters.Add(string.Format("tags={0}", System.Uri.EscapeDataString(string.Join(",", tags)))); + } + if (canFetchContent != null) + { + _queryParameters.Add(string.Format("canFetchContent={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(canFetchContent, Client.SerializationSettings).Trim('"')))); + } + 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 WorkbookErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + WorkbookError _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 a single workbook by its resourceName. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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 WorkbookErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + WorkbookError _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; + } + + /// + /// Delete a workbook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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("DELETE"); + _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 != 201 && (int)_statusCode != 204) + { + var ex = new WorkbookErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + WorkbookError _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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create a new workbook. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a new workbook. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, Workbook workbookProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (workbookProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workbookProperties"); + } + if (workbookProperties != null) + { + workbookProperties.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("workbookProperties", workbookProperties); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(workbookProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workbookProperties, 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 != 201) + { + var ex = new WorkbookErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + WorkbookError _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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _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; + } + + /// + /// Updates a workbook that has already been added. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a new workbook. + /// + /// + /// 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(string resourceGroupName, string resourceName, Workbook workbookProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (workbookProperties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workbookProperties"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("workbookProperties", workbookProperties); + 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}/resourceGroup/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + 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(workbookProperties != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workbookProperties, 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 WorkbookErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + WorkbookError _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/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkbooksOperationsExtensions.cs b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkbooksOperationsExtensions.cs new file mode 100644 index 000000000000..d249300d42f0 --- /dev/null +++ b/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights/src/Generated/WorkbooksOperationsExtensions.cs @@ -0,0 +1,252 @@ +// +// 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.ApplicationInsights.Management +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkbooksOperations. + /// + public static partial class WorkbooksOperationsExtensions + { + /// + /// Get all Workbooks defined within a specified resource group and category. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Category of workbook to return. Possible values include: 'workbook', 'TSG', + /// 'performance', 'retention' + /// + /// + /// Tags presents on each workbook returned. + /// + /// + /// Flag indicating whether or not to return the full content for each + /// applicable workbook. If false, only return summary content for workbooks. + /// + public static IEnumerable ListByResourceGroup(this IWorkbooksOperations operations, string resourceGroupName, string category, IList tags = default(IList), bool? canFetchContent = default(bool?)) + { + return operations.ListByResourceGroupAsync(resourceGroupName, category, tags, canFetchContent).GetAwaiter().GetResult(); + } + + /// + /// Get all Workbooks defined within a specified resource group and category. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Category of workbook to return. Possible values include: 'workbook', 'TSG', + /// 'performance', 'retention' + /// + /// + /// Tags presents on each workbook returned. + /// + /// + /// Flag indicating whether or not to return the full content for each + /// applicable workbook. If false, only return summary content for workbooks. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IWorkbooksOperations operations, string resourceGroupName, string category, IList tags = default(IList), bool? canFetchContent = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, category, tags, canFetchContent, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a single workbook by its resourceName. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static Workbook Get(this IWorkbooksOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Get a single workbook by its resourceName. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkbooksOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a workbook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + public static void Delete(this IWorkbooksOperations operations, string resourceGroupName, string resourceName) + { + operations.DeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Delete a workbook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkbooksOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create a new workbook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a new workbook. + /// + public static Workbook CreateOrUpdate(this IWorkbooksOperations operations, string resourceGroupName, string resourceName, Workbook workbookProperties) + { + return operations.CreateOrUpdateAsync(resourceGroupName, resourceName, workbookProperties).GetAwaiter().GetResult(); + } + + /// + /// Create a new workbook. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a new workbook. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IWorkbooksOperations operations, string resourceGroupName, string resourceName, Workbook workbookProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, resourceName, workbookProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a workbook that has already been added. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a new workbook. + /// + public static Workbook Update(this IWorkbooksOperations operations, string resourceGroupName, string resourceName, Workbook workbookProperties) + { + return operations.UpdateAsync(resourceGroupName, resourceName, workbookProperties).GetAwaiter().GetResult(); + } + + /// + /// Updates a workbook that has already been added. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the Application Insights component resource. + /// + /// + /// Properties that need to be specified to create a new workbook. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IWorkbooksOperations operations, string resourceGroupName, string resourceName, Workbook workbookProperties, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, workbookProperties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} From b41507f40cc0138cd0a7a5d627c1cff6f0b07e1c Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2019 23:32:21 +0000 Subject: [PATCH 06/23] [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks --- .../src/Generated/AddressOperations.cs | 235 ++++ .../Generated/AddressOperationsExtensions.cs | 57 + .../src/Generated/AgreementsOperations.cs | 4 +- .../AgreementsOperationsExtensions.cs | 8 +- .../Generated/BillingAccountsOperations.cs | 562 ++++++++- .../BillingAccountsOperationsExtensions.cs | 156 ++- .../src/Generated/BillingManagementClient.cs | 80 +- .../Generated/BillingPermissionsOperations.cs | 205 +++- .../BillingPermissionsOperationsExtensions.cs | 58 +- .../Generated/BillingProfilesOperations.cs | 248 +++- .../BillingProfilesOperationsExtensions.cs | 108 +- .../Generated/BillingPropertyOperations.cs | 4 +- .../BillingPropertyOperationsExtensions.cs | 4 +- .../BillingRoleAssignmentsOperations.cs | 128 +- ...lingRoleAssignmentsOperationsExtensions.cs | 130 +- .../BillingRoleDefinitionsOperations.cs | 54 +- ...lingRoleDefinitionsOperationsExtensions.cs | 60 +- .../BillingSubscriptionsOperations.cs | 1058 ++++++++++++++--- ...illingSubscriptionsOperationsExtensions.cs | 290 ++++- .../src/Generated/CustomersOperations.cs | 989 +++++++++++++++ .../CustomersOperationsExtensions.cs | 257 ++++ .../src/Generated/IAddressOperations.cs | 48 + .../src/Generated/IAgreementsOperations.cs | 2 +- .../Generated/IBillingAccountsOperations.cs | 104 +- .../src/Generated/IBillingManagementClient.cs | 65 +- .../IBillingPermissionsOperations.cs | 33 +- .../Generated/IBillingProfilesOperations.cs | 64 +- .../Generated/IBillingPropertyOperations.cs | 2 +- .../IBillingRoleAssignmentsOperations.cs | 43 +- .../IBillingRoleDefinitionsOperations.cs | 18 +- .../IBillingSubscriptionsOperations.cs | 153 ++- .../src/Generated/ICustomersOperations.cs | 168 +++ .../Generated/IInvoiceSectionsOperations.cs | 105 +- .../src/Generated/IInvoicesOperations.cs | 4 +- .../src/Generated/ILineOfCreditsOperations.cs | 90 ++ .../Generated/IPartnerTransfersOperations.cs | 120 ++ .../IPartnerTransfersTransfersOperations.cs | 77 ++ .../Generated/IPaymentMethodsOperations.cs | 16 +- .../src/Generated/IPoliciesOperations.cs | 65 +- .../src/Generated/IPriceSheetOperations.cs | 68 +- .../src/Generated/IProductsOperations.cs | 108 +- .../IRecipientTransfersOperations.cs | 32 +- .../src/Generated/ITransactionsOperations.cs | 117 +- .../src/Generated/ITransfersOperations.cs | 24 +- .../Generated/InvoiceSectionsOperations.cs | 501 ++------ .../InvoiceSectionsOperationsExtensions.cs | 218 ++-- .../src/Generated/InvoicesOperations.cs | 10 +- .../Generated/InvoicesOperationsExtensions.cs | 12 +- .../src/Generated/LineOfCreditsOperations.cs | 446 +++++++ .../LineOfCreditsOperationsExtensions.cs | 121 ++ .../Models/{Address.cs => AddressDetails.cs} | 10 +- .../Models/AddressValidationStatus.cs | 22 + .../src/Generated/Models/AgreementType.cs | 23 + .../src/Generated/Models/Amount.cs | 4 +- .../{EnabledAzureSKUs.cs => AzurePlan.cs} | 16 +- .../src/Generated/Models/BillingAccount.cs | 63 +- .../Models/BillingAccountUpdateRequest.cs | 138 +++ .../Models/BillingPermissionsListResult.cs | 4 +- .../src/Generated/Models/BillingProfile.cs | 25 +- .../Models/BillingProfileCreationRequest.cs | 90 ++ .../Models/BillingProfilesCreateHeaders.cs | 62 + .../src/Generated/Models/BillingProperty.cs | 35 +- .../Models/BillingRoleAssignmentPayload.cs | 16 +- .../Generated/Models/BillingRoleDefinition.cs | 4 +- ...ptionSummary.cs => BillingSubscription.cs} | 62 +- .../Models/BillingSubscriptionsListResult.cs | 11 +- .../BillingSubscriptionsTransferHeaders.cs | 11 +- .../src/Generated/Models/Customer.cs | 79 ++ .../src/Generated/Models/CustomerPolicy.cs | 60 + .../src/Generated/Models/CustomerType.cs | 23 + .../{DownloadProperties.cs => Document.cs} | 10 +- .../src/Generated/Models/DocumentType.cs | 24 + .../Models/InitiateTransferRequest.cs | 19 +- .../Models/{InvoiceSummary.cs => Invoice.cs} | 36 +- .../src/Generated/Models/InvoiceListResult.cs | 4 +- .../src/Generated/Models/InvoiceSection.cs | 14 +- ...es.cs => InvoiceSectionCreationRequest.cs} | 24 +- .../InvoiceSectionWithCreateSubPermission.cs | 91 ++ .../Models/InvoiceSectionsCreateHeaders.cs | 11 +- .../src/Generated/Models/InvoiceStatus.cs | 24 + .../src/Generated/Models/LineOfCredit.cs | 85 ++ .../Models/LineOfCreditsUpdateHeaders.cs | 60 + .../Models/MarketplacePurchasesPolicy.cs | 23 + .../src/Generated/Models/OperationStatus.cs | 68 -- .../src/Generated/Models/PaymentMethod.cs | 8 +- .../src/Generated/Models/Policy.cs | 44 +- ...iceSheetDownloadByBillingProfileHeaders.cs | 74 ++ .../Models/PriceSheetDownloadHeaders.cs | 13 +- .../Models/{ProductSummary.cs => Product.cs} | 62 +- .../ProductTransferValidationErrorCode.cs | 29 + .../Generated/Models/ProductsListResult.cs | 12 +- .../Models/ProductsTransferHeaders.cs | 11 +- .../Models/RecipientTransferDetails.cs | 27 +- .../src/Generated/Models/Reseller.cs | 59 + .../Models/ReservationPurchasesPolicy.cs | 22 + .../src/Generated/Models/Status.cs | 22 + ...SubscriptionTransferValidationErrorCode.cs | 28 + ...{TransactionsSummary.cs => Transaction.cs} | 54 +- ...ListResult.cs => TransactionListResult.cs} | 19 +- .../TransferBillingSubscriptionRequest.cs | 11 +- ...ferBillingSubscriptionRequestProperties.cs | 11 +- .../src/Generated/Models/TransferDetails.cs | 35 +- .../TransferProductRequestProperties.cs | 15 +- ...Summary.cs => UpdateAutoRenewOperation.cs} | 12 +- .../Models/ValidateAddressResponse.cs | 72 ++ ...ValidateProductTransferEligibilityError.cs | 84 ++ ...alidateProductTransferEligibilityResult.cs | 62 + ...ateSubscriptionTransferEligibilityError.cs | 81 ++ ...teSubscriptionTransferEligibilityResult.cs | 62 + .../Models/ValidateTransferListResponse.cs | 56 + .../Models/ValidateTransferResponse.cs | 73 ++ .../Models/ValidationResultProperties.cs | 67 ++ .../src/Generated/Models/ViewCharges.cs | 22 + .../src/Generated/Models/ViewChargesPolicy.cs | 22 + .../Generated/PartnerTransfersOperations.cs | 647 ++++++++++ .../PartnerTransfersOperationsExtensions.cs | 181 +++ .../PartnerTransfersTransfersOperations.cs | 409 +++++++ ...rTransfersTransfersOperationsExtensions.cs | 105 ++ .../src/Generated/PaymentMethodsOperations.cs | 24 +- .../PaymentMethodsOperationsExtensions.cs | 48 +- .../src/Generated/PoliciesOperations.cs | 412 ++++++- .../Generated/PoliciesOperationsExtensions.cs | 114 +- .../src/Generated/PriceSheetOperations.cs | 249 +++- .../PriceSheetOperationsExtensions.cs | 124 +- .../src/Generated/ProductsOperations.cs | 538 ++++++++- .../Generated/ProductsOperationsExtensions.cs | 222 +++- .../Generated/RecipientTransfersOperations.cs | 202 +++- .../RecipientTransfersOperationsExtensions.cs | 58 +- .../SdkInfo_BillingManagementClient.cs | 47 +- .../src/Generated/TransactionsOperations.cs | 666 ++++++++++- .../TransactionsOperationsExtensions.cs | 216 +++- .../src/Generated/TransfersOperations.cs | 66 +- .../TransfersOperationsExtensions.cs | 64 +- 133 files changed, 12580 insertions(+), 1761 deletions(-) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ILineOfCreditsOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersTransfersOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperationsExtensions.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{Address.cs => AddressDetails.cs} (86%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressValidationStatus.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementType.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{EnabledAzureSKUs.cs => AzurePlan.cs} (75%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateHeaders.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{BillingSubscriptionSummary.cs => BillingSubscription.cs} (62%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerPolicy.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{DownloadProperties.cs => Document.cs} (83%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{InvoiceSummary.cs => Invoice.cs} (73%) rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{InvoiceSectionProperties.cs => InvoiceSectionCreationRequest.cs} (57%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionWithCreateSubPermission.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/MarketplacePurchasesPolicy.cs delete mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationStatus.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{ProductSummary.cs => Product.cs} (68%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferValidationErrorCode.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPurchasesPolicy.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SubscriptionTransferValidationErrorCode.cs rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{TransactionsSummary.cs => Transaction.cs} (70%) rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{TransactionsListResult.cs => TransactionListResult.cs} (70%) rename sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/{UpdateAutoRenewOperationSummary.cs => UpdateAutoRenewOperation.cs} (84%) create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateAddressResponse.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityError.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewCharges.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewChargesPolicy.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperationsExtensions.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperations.cs create mode 100644 sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperationsExtensions.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 new file mode 100644 index 000000000000..39dd36a238d1 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperations.cs @@ -0,0 +1,235 @@ +// +// 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; + + /// + /// AddressOperations operations. + /// + internal partial class AddressOperations : IServiceOperations, IAddressOperations + { + /// + /// Initializes a new instance of the AddressOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AddressOperations(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. + /// + /// + /// + /// + /// 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> ValidateWithHttpMessagesAsync(AddressDetails address, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + 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("address", address); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Validate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/validateAddress").ToString(); + 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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs new file mode 100644 index 000000000000..c0e8399bdcc2 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AddressOperationsExtensions.cs @@ -0,0 +1,57 @@ +// +// 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 AddressOperations. + /// + public static partial class AddressOperationsExtensions + { + /// + /// Validates the address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + public static ValidateAddressResponse Validate(this IAddressOperations operations, AddressDetails address) + { + return operations.ValidateAsync(address).GetAwaiter().GetResult(); + } + + /// + /// Validates the address. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this IAddressOperations operations, AddressDetails address, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(address, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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 b7bfd8dccd11..355ab9591a9b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperations.cs @@ -80,7 +80,7 @@ internal AgreementsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(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) { @@ -100,7 +100,7 @@ internal AgreementsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; 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 2657b2b3af17..459d37367761 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/AgreementsOperationsExtensions.cs @@ -33,9 +33,9 @@ public static partial class AgreementsOperationsExtensions /// /// May be used to expand the participants. /// - public static AgreementListResult ListByBillingAccountName(this IAgreementsOperations operations, string billingAccountName, string expand = default(string)) + public static AgreementListResult ListByBillingAccount(this IAgreementsOperations operations, string billingAccountName, string expand = default(string)) { - return operations.ListByBillingAccountNameAsync(billingAccountName, expand).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, expand).GetAwaiter().GetResult(); } /// @@ -53,9 +53,9 @@ public static partial class AgreementsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(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.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, expand, 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 1d076d68748b..4333fa823eca 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperations.cs @@ -54,7 +54,7 @@ internal BillingAccountsOperations(BillingManagementClient client) /// Lists all billing accounts for a user which he has access to. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// /// /// Headers that will be added to request. @@ -233,7 +233,7 @@ internal BillingAccountsOperations(BillingManagementClient client) /// billing Account Id. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// /// /// Headers that will be added to request. @@ -411,5 +411,563 @@ internal BillingAccountsOperations(BillingManagementClient client) return _result; } + /// + /// The operation to update a billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied 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 all invoice sections with create subscription permission for a user. + /// + /// + /// 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>> ListInvoiceSectionsByCreateSubscriptionPermissionWithHttpMessagesAsync(string billingAccountName, 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"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListInvoiceSectionsByCreateSubscriptionPermission", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission").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; + // 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; + } + + /// + /// The operation to update a billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied 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 all invoice sections with create subscription permission for a user. + /// + /// + /// 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>> ListInvoiceSectionsByCreateSubscriptionPermissionNextWithHttpMessagesAsync(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, "ListInvoiceSectionsByCreateSubscriptionPermissionNext", 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("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) + { + 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/BillingAccountsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs index ba67081d8381..3b10056f15e8 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingAccountsOperationsExtensions.cs @@ -28,7 +28,7 @@ public static partial class BillingAccountsOperationsExtensions /// The operations group for this extension method. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// public static BillingAccountListResult List(this IBillingAccountsOperations operations, string expand = default(string)) { @@ -42,7 +42,7 @@ public static partial class BillingAccountsOperationsExtensions /// The operations group for this extension method. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// /// /// The cancellation token. @@ -65,7 +65,7 @@ public static partial class BillingAccountsOperationsExtensions /// billing Account Id. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// public static BillingAccount Get(this IBillingAccountsOperations operations, string billingAccountName, string expand = default(string)) { @@ -82,7 +82,7 @@ public static partial class BillingAccountsOperationsExtensions /// billing Account Id. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and billingProfiles. /// /// /// The cancellation token. @@ -95,5 +95,153 @@ public static partial class BillingAccountsOperationsExtensions } } + /// + /// The operation to update a billing account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account operation. + /// + public static BillingAccount Update(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters) + { + return operations.UpdateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to update a billing account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied 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 all invoice sections with create subscription permission for a user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + public static IPage ListInvoiceSectionsByCreateSubscriptionPermission(this IBillingAccountsOperations operations, string billingAccountName) + { + return operations.ListInvoiceSectionsByCreateSubscriptionPermissionAsync(billingAccountName).GetAwaiter().GetResult(); + } + + /// + /// Lists all invoice sections with create subscription permission for a user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// The cancellation token. + /// + public static async Task> ListInvoiceSectionsByCreateSubscriptionPermissionAsync(this IBillingAccountsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListInvoiceSectionsByCreateSubscriptionPermissionWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The operation to update a billing account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied to the update billing account operation. + /// + public static BillingAccount BeginUpdate(this IBillingAccountsOperations operations, string billingAccountName, BillingAccountUpdateRequest parameters) + { + return operations.BeginUpdateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to update a billing account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied 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 all invoice sections with create subscription permission for a user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListInvoiceSectionsByCreateSubscriptionPermissionNext(this IBillingAccountsOperations operations, string nextPageLink) + { + return operations.ListInvoiceSectionsByCreateSubscriptionPermissionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all invoice sections with create subscription permission for a user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListInvoiceSectionsByCreateSubscriptionPermissionNextAsync(this IBillingAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListInvoiceSectionsByCreateSubscriptionPermissionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } 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 c1d0683efb03..ff06f40bc480 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingManagementClient.cs @@ -49,7 +49,7 @@ public partial class BillingManagementClient : ServiceClient /// Version of the API to be used with the client request. The current version - /// is 2018-11-01-preview. + /// is 2019-10-01-preview. /// public string ApiVersion { get; private set; } @@ -86,6 +86,11 @@ public partial class BillingManagementClient : ServiceClient public virtual IPaymentMethodsOperations PaymentMethods { get; private set; } + /// + /// Gets the IAddressOperations. + /// + public virtual IAddressOperations Address { get; private set; } + /// /// Gets the IAvailableBalancesOperations. /// @@ -96,45 +101,55 @@ public partial class BillingManagementClient : ServiceClient public virtual IBillingProfilesOperations BillingProfiles { get; private set; } + /// + /// Gets the ICustomersOperations. + /// + public virtual ICustomersOperations Customers { get; private set; } + /// /// Gets the IInvoiceSectionsOperations. /// public virtual IInvoiceSectionsOperations InvoiceSections { get; private set; } /// - /// Gets the IDepartmentsOperations. + /// Gets the IBillingPermissionsOperations. /// - public virtual IDepartmentsOperations Departments { get; private set; } + public virtual IBillingPermissionsOperations BillingPermissions { get; private set; } /// - /// Gets the IEnrollmentAccountsOperations. + /// Gets the IBillingSubscriptionsOperations. /// - public virtual IEnrollmentAccountsOperations EnrollmentAccounts { get; private set; } + public virtual IBillingSubscriptionsOperations BillingSubscriptions { get; private set; } /// - /// Gets the IInvoicesOperations. + /// Gets the IProductsOperations. /// - public virtual IInvoicesOperations Invoices { get; private set; } + public virtual IProductsOperations Products { 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 IBillingSubscriptionsOperations. + /// Gets the IDepartmentsOperations. /// - public virtual IBillingSubscriptionsOperations BillingSubscriptions { get; private set; } + public virtual IDepartmentsOperations Departments { get; private set; } /// - /// Gets the IProductsOperations. + /// Gets the IEnrollmentAccountsOperations. /// - public virtual IProductsOperations Products { get; private set; } + public virtual IEnrollmentAccountsOperations EnrollmentAccounts { get; private set; } /// - /// Gets the ITransactionsOperations. + /// Gets the IInvoicesOperations. /// - public virtual ITransactionsOperations Transactions { get; private set; } + public virtual IInvoicesOperations Invoices { get; private set; } + + /// + /// Gets the IPriceSheetOperations. + /// + public virtual IPriceSheetOperations PriceSheet { get; private set; } /// /// Gets the IPoliciesOperations. @@ -151,6 +166,16 @@ public partial class BillingManagementClient : ServiceClient public virtual ITransfersOperations Transfers { get; private set; } + /// + /// Gets the IPartnerTransfersOperations. + /// + public virtual IPartnerTransfersOperations PartnerTransfers { get; private set; } + + /// + /// Gets the IPartnerTransfersTransfersOperations. + /// + public virtual IPartnerTransfersTransfersOperations PartnerTransfersTransfers { get; private set; } + /// /// Gets the IRecipientTransfersOperations. /// @@ -161,11 +186,6 @@ public partial class BillingManagementClient : ServiceClient public virtual IOperations Operations { get; private set; } - /// - /// Gets the IBillingPermissionsOperations. - /// - public virtual IBillingPermissionsOperations BillingPermissions { get; private set; } - /// /// Gets the IBillingRoleDefinitionsOperations. /// @@ -181,6 +201,11 @@ public partial class BillingManagementClient : ServiceClient public virtual IAgreementsOperations Agreements { get; private set; } + /// + /// Gets the ILineOfCreditsOperations. + /// + public virtual ILineOfCreditsOperations LineOfCredits { get; private set; } + /// /// Initializes a new instance of the BillingManagementClient class. /// @@ -424,27 +449,32 @@ private void Initialize() { BillingAccounts = new BillingAccountsOperations(this); PaymentMethods = new PaymentMethodsOperations(this); + Address = new AddressOperations(this); AvailableBalances = new AvailableBalancesOperations(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); Departments = new DepartmentsOperations(this); EnrollmentAccounts = new EnrollmentAccountsOperations(this); Invoices = new InvoicesOperations(this); PriceSheet = new PriceSheetOperations(this); - BillingSubscriptions = new BillingSubscriptionsOperations(this); - Products = new ProductsOperations(this); - Transactions = new TransactionsOperations(this); Policies = new PoliciesOperations(this); BillingProperty = new BillingPropertyOperations(this); Transfers = new TransfersOperations(this); + PartnerTransfers = new PartnerTransfersOperations(this); + PartnerTransfersTransfers = new PartnerTransfersTransfersOperations(this); RecipientTransfers = new RecipientTransfersOperations(this); Operations = new Operations(this); - BillingPermissions = new BillingPermissionsOperations(this); BillingRoleDefinitions = new BillingRoleDefinitionsOperations(this); BillingRoleAssignments = new BillingRoleAssignmentsOperations(this); Agreements = new AgreementsOperations(this); + LineOfCredits = new LineOfCreditsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2018-11-01-preview"; + ApiVersion = "2019-10-01-preview"; 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 1018381b8005..391530e8e167 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperations.cs @@ -50,6 +50,192 @@ internal BillingPermissionsOperations(BillingManagementClient client) /// public BillingManagementClient Client { get; private set; } + /// + /// Lists all billing permissions the caller has for a customer. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// 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, 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 (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + // 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("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}/billingPermissions").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 (_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 all billing permissions for the caller under a billing account. /// @@ -100,7 +286,7 @@ internal BillingPermissionsOperations(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}/providers/Microsoft.Billing/billingPermissions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -233,6 +419,9 @@ internal BillingPermissionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -257,7 +446,7 @@ internal BillingPermissionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, 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) { @@ -267,6 +456,10 @@ internal BillingPermissionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -279,14 +472,16 @@ internal BillingPermissionsOperations(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, "ListByInvoiceSections", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingPermissions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions").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) @@ -414,7 +609,7 @@ internal BillingPermissionsOperations(BillingManagementClient client) } /// - /// Lists all billingPermissions for the caller has for a billing account. + /// Lists all billing permissions the caller has for a billing account. /// /// /// billing Account Id. @@ -471,7 +666,7 @@ internal BillingPermissionsOperations(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}/billingProfiles/{billingProfileName}/providers/Microsoft.Billing/billingPermissions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); List _queryParameters = new List(); 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 a6b04a53d5e7..1367a626c59d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPermissionsOperationsExtensions.cs @@ -21,6 +21,46 @@ namespace Microsoft.Azure.Management.Billing /// public static partial class BillingPermissionsOperationsExtensions { + /// + /// Lists all billing permissions the caller has for a customer. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + public static BillingPermissionsListResult 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. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// The cancellation token. + /// + 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)) + { + return _result.Body; + } + } + /// /// Lists all billing permissions for the caller under a billing account. /// @@ -64,12 +104,15 @@ public static BillingPermissionsListResult ListByBillingAccount(this IBillingPer /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingPermissionsListResult ListByInvoiceSections(this IBillingPermissionsOperations operations, string billingAccountName, string invoiceSectionName) + public static BillingPermissionsListResult ListByInvoiceSections(this IBillingPermissionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByInvoiceSectionsAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionsAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -81,22 +124,25 @@ public static BillingPermissionsListResult ListByInvoiceSections(this IBillingPe /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionsAsync(this IBillingPermissionsOperations operations, string billingAccountName, 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, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionsWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all billingPermissions for the caller has for a billing account. + /// Lists all billing permissions the caller has for a billing account. /// /// /// The operations group for this extension method. @@ -113,7 +159,7 @@ public static BillingPermissionsListResult ListByBillingProfile(this IBillingPer } /// - /// Lists all billingPermissions for the caller has for a billing account. + /// Lists all billing permissions the caller has for a billing account. /// /// /// The operations group for this extension method. 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 9eece86c0e50..061988d6dd62 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperations.cs @@ -80,7 +80,7 @@ internal BillingProfilesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(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) { @@ -100,7 +100,7 @@ internal BillingProfilesOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -429,6 +429,31 @@ internal BillingProfilesOperations(BillingManagementClient client) return _result; } + /// + /// The operation to create a BillingProfile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// The operation to update a billing profile. /// @@ -439,7 +464,7 @@ internal BillingProfilesOperations(BillingManagementClient client) /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// /// /// The headers that will be added to request. @@ -454,6 +479,219 @@ internal BillingProfilesOperations(BillingManagementClient client) return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// The operation to create a BillingProfile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile 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> BeginCreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfileCreationRequest 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"); + } + // 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, "BeginCreate", 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; + } + /// /// The operation to update a billing profile. /// @@ -464,7 +702,7 @@ internal BillingProfilesOperations(BillingManagementClient client) /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// /// /// Headers that will be added to request. @@ -535,7 +773,7 @@ internal BillingProfilesOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) 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 7d9e353cfb46..a38bc7332d4e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingProfilesOperationsExtensions.cs @@ -33,9 +33,9 @@ public static partial class BillingProfilesOperationsExtensions /// /// May be used to expand the invoiceSections. /// - public static BillingProfileListResult ListByBillingAccountName(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string)) + public static BillingProfileListResult ListByBillingAccount(this IBillingProfilesOperations operations, string billingAccountName, string expand = default(string)) { - return operations.ListByBillingAccountNameAsync(billingAccountName, expand).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, expand).GetAwaiter().GetResult(); } /// @@ -53,9 +53,9 @@ public static partial class BillingProfilesOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(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.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -107,6 +107,52 @@ public static partial class BillingProfilesOperationsExtensions } } + /// + /// The operation to create a BillingProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + public static BillingProfile Create(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters) + { + return operations.CreateAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to create a BillingProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// The operation to update a billing profile. /// @@ -120,7 +166,7 @@ public static partial class BillingProfilesOperationsExtensions /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// public static BillingProfile Update(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfile parameters) { @@ -140,7 +186,7 @@ public static BillingProfile Update(this IBillingProfilesOperations operations, /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// /// /// The cancellation token. @@ -153,6 +199,52 @@ public static BillingProfile Update(this IBillingProfilesOperations operations, } } + /// + /// The operation to create a BillingProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + public static BillingProfile BeginCreate(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters) + { + return operations.BeginCreateAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to create a BillingProfile. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// The operation to update a billing profile. /// @@ -166,7 +258,7 @@ public static BillingProfile Update(this IBillingProfilesOperations operations, /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// public static BillingProfile BeginUpdate(this IBillingProfilesOperations operations, string billingAccountName, string billingProfileName, BillingProfile parameters) { @@ -186,7 +278,7 @@ public static BillingProfile BeginUpdate(this IBillingProfilesOperations operati /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile operation. /// /// /// The cancellation token. 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 beaef84cd1f6..32e94e50b9d5 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperations.cs @@ -52,7 +52,7 @@ internal BillingPropertyOperations(BillingManagementClient client) /// /// Get billing property by subscription Id. - /// + /// /// /// /// Headers that will be added to request. @@ -97,7 +97,7 @@ internal BillingPropertyOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty").ToString(); + 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) 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 1cd9c6c24a44..99b7476e92a2 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingPropertyOperationsExtensions.cs @@ -23,7 +23,7 @@ public static partial class BillingPropertyOperationsExtensions { /// /// Get billing property by subscription Id. - /// + /// /// /// /// The operations group for this extension method. @@ -35,7 +35,7 @@ public static BillingProperty Get(this IBillingPropertyOperations operations) /// /// Get billing property by subscription Id. - /// + /// /// /// /// The operations group for this extension method. 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 ad2df2ce0444..5375183fd3b5 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperations.cs @@ -108,7 +108,7 @@ internal BillingRoleAssignmentsOperations(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}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); List _queryParameters = new List(); @@ -266,7 +266,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -290,11 +290,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); List _queryParameters = new List(); @@ -428,6 +428,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -455,7 +458,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -465,6 +468,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -481,15 +488,17 @@ 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("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}").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("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); List _queryParameters = new List(); @@ -623,6 +632,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -650,7 +662,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -660,6 +672,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -676,15 +692,17 @@ 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("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}").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("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); List _queryParameters = new List(); @@ -845,7 +863,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -874,11 +892,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfile", 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}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); @@ -1040,7 +1058,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DeleteByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1069,11 +1087,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("billingRoleAssignmentName", billingRoleAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "DeleteByBillingProfile", 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}/providers/Microsoft.Billing/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{billingRoleAssignmentName}", System.Uri.EscapeDataString(billingRoleAssignmentName)); @@ -1229,7 +1247,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(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) { @@ -1248,11 +1266,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", 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}/providers/Microsoft.Billing/billingRoleAssignments").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1385,6 +1403,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// Headers that will be added to request. /// @@ -1406,7 +1427,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddByBillingAccountWithHttpMessagesAsync(string billingAccountName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1416,7 +1437,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - BillingRoleAssignmentPayload parameters = new BillingRoleAssignmentPayload(); + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1427,11 +1451,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/createBillingRoleAssignment").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/createBillingRoleAssignment").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1570,6 +1594,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -1594,7 +1621,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, 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) { @@ -1604,6 +1631,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -1616,14 +1647,16 @@ 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", 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}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleAssignments").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) @@ -1756,9 +1789,15 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// Headers that will be added to request. /// @@ -1780,7 +1819,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1790,11 +1829,18 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); } - BillingRoleAssignmentPayload parameters = new BillingRoleAssignmentPayload(); + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1803,15 +1849,17 @@ 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/createBillingRoleAssignment").ToString(); + 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)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -1974,7 +2022,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(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) { @@ -1998,11 +2046,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", 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}/providers/Microsoft.Billing/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)); List _queryParameters = new List(); @@ -2139,6 +2187,9 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// Billing Profile Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// Headers that will be added to request. /// @@ -2160,7 +2211,7 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AddByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AddByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -2174,7 +2225,10 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } - BillingRoleAssignmentPayload parameters = new BillingRoleAssignmentPayload(); + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2186,11 +2240,11 @@ internal BillingRoleAssignmentsOperations(BillingManagementClient client) tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AddByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "AddByBillingProfile", 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}/providers/Microsoft.Billing/createBillingRoleAssignment").ToString(); + 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)); List _queryParameters = new List(); 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 c4067a9f8cd3..cb60a1654a81 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleAssignmentsOperationsExtensions.cs @@ -73,9 +73,9 @@ public static BillingRoleAssignment GetByBillingAccount(this IBillingRoleAssignm /// /// role assignment id. /// - public static BillingRoleAssignment DeleteByBillingAccountName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName) + public static BillingRoleAssignment DeleteByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName) { - return operations.DeleteByBillingAccountNameAsync(billingAccountName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.DeleteByBillingAccountAsync(billingAccountName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -93,9 +93,9 @@ public static BillingRoleAssignment DeleteByBillingAccountName(this IBillingRole /// /// The cancellation token. /// - public static async Task DeleteByBillingAccountNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteByBillingAccountAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteByBillingAccountNameWithHttpMessagesAsync(billingAccountName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteByBillingAccountWithHttpMessagesAsync(billingAccountName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -110,15 +110,18 @@ public static BillingRoleAssignment DeleteByBillingAccountName(this IBillingRole /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// role assignment id. /// - public static BillingRoleAssignment GetByInvoiceSectionName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName) + public static BillingRoleAssignment GetByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName) { - return operations.GetByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.GetByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -130,6 +133,9 @@ public static BillingRoleAssignment GetByInvoiceSectionName(this IBillingRoleAss /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -139,9 +145,9 @@ public static BillingRoleAssignment GetByInvoiceSectionName(this IBillingRoleAss /// /// The cancellation token. /// - public static async Task GetByInvoiceSectionNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -156,15 +162,18 @@ public static BillingRoleAssignment GetByInvoiceSectionName(this IBillingRoleAss /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// role assignment id. /// - public static BillingRoleAssignment DeleteByInvoiceSectionName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName) + public static BillingRoleAssignment DeleteByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName) { - return operations.DeleteByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.DeleteByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -176,6 +185,9 @@ public static BillingRoleAssignment DeleteByInvoiceSectionName(this IBillingRole /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -185,9 +197,9 @@ public static BillingRoleAssignment DeleteByInvoiceSectionName(this IBillingRole /// /// The cancellation token. /// - public static async Task DeleteByInvoiceSectionNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -208,9 +220,9 @@ public static BillingRoleAssignment DeleteByInvoiceSectionName(this IBillingRole /// /// role assignment id. /// - public static BillingRoleAssignment GetByBillingProfileName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) + public static BillingRoleAssignment GetByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) { - return operations.GetByBillingProfileNameAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.GetByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -231,9 +243,9 @@ public static BillingRoleAssignment GetByBillingProfileName(this IBillingRoleAss /// /// The cancellation token. /// - public static async Task GetByBillingProfileNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -254,9 +266,9 @@ public static BillingRoleAssignment GetByBillingProfileName(this IBillingRoleAss /// /// role assignment id. /// - public static BillingRoleAssignment DeleteByBillingProfileName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) + public static BillingRoleAssignment DeleteByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName) { - return operations.DeleteByBillingProfileNameAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).GetAwaiter().GetResult(); + return operations.DeleteByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleAssignmentName).GetAwaiter().GetResult(); } /// @@ -277,9 +289,9 @@ public static BillingRoleAssignment DeleteByBillingProfileName(this IBillingRole /// /// The cancellation token. /// - public static async Task DeleteByBillingProfileNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string billingRoleAssignmentName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleAssignmentName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -294,9 +306,9 @@ public static BillingRoleAssignment DeleteByBillingProfileName(this IBillingRole /// /// billing Account Id. /// - public static BillingRoleAssignmentListResult ListByBillingAccountName(this IBillingRoleAssignmentsOperations operations, string billingAccountName) + public static BillingRoleAssignmentListResult ListByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName) { - return operations.ListByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// @@ -311,9 +323,9 @@ public static BillingRoleAssignmentListResult ListByBillingAccountName(this IBil /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(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.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -328,9 +340,12 @@ public static BillingRoleAssignmentListResult ListByBillingAccountName(this IBil /// /// billing Account Id. /// - public static BillingRoleAssignmentListResult AddByBillingAccountName(this IBillingRoleAssignmentsOperations operations, string billingAccountName) + /// + /// Parameters supplied to add a role assignment. + /// + public static BillingRoleAssignmentListResult AddByBillingAccount(this IBillingRoleAssignmentsOperations operations, string billingAccountName, BillingRoleAssignmentPayload parameters) { - return operations.AddByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.AddByBillingAccountAsync(billingAccountName, parameters).GetAwaiter().GetResult(); } /// @@ -342,12 +357,15 @@ public static BillingRoleAssignmentListResult AddByBillingAccountName(this IBill /// /// billing Account Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The cancellation token. /// - public static async Task AddByBillingAccountNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AddByBillingAccountAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.AddByBillingAccountWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -362,12 +380,15 @@ public static BillingRoleAssignmentListResult AddByBillingAccountName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingRoleAssignmentListResult ListByInvoiceSectionName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName) + public static BillingRoleAssignmentListResult ListByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -379,15 +400,18 @@ public static BillingRoleAssignmentListResult ListByInvoiceSectionName(this IBil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, 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.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -402,12 +426,18 @@ public static BillingRoleAssignmentListResult ListByInvoiceSectionName(this IBil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingRoleAssignmentListResult AddByInvoiceSectionName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName) + /// + /// Parameters supplied to add a role assignment. + /// + public static BillingRoleAssignmentListResult AddByInvoiceSection(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters) { - return operations.AddByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.AddByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// @@ -419,15 +449,21 @@ public static BillingRoleAssignmentListResult AddByInvoiceSectionName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The cancellation token. /// - public static async Task AddByInvoiceSectionNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AddByInvoiceSectionAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.AddByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -445,9 +481,9 @@ public static BillingRoleAssignmentListResult AddByInvoiceSectionName(this IBill /// /// Billing Profile Id. /// - public static BillingRoleAssignmentListResult ListByBillingProfileName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName) + public static BillingRoleAssignmentListResult ListByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// @@ -465,9 +501,9 @@ public static BillingRoleAssignmentListResult ListByBillingProfileName(this IBil /// /// The cancellation token. /// - public static async Task ListByBillingProfileNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, 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.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -485,9 +521,12 @@ public static BillingRoleAssignmentListResult ListByBillingProfileName(this IBil /// /// Billing Profile Id. /// - public static BillingRoleAssignmentListResult AddByBillingProfileName(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName) + /// + /// Parameters supplied to add a role assignment. + /// + public static BillingRoleAssignmentListResult AddByBillingProfile(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters) { - return operations.AddByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.AddByBillingProfileAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult(); } /// @@ -502,12 +541,15 @@ public static BillingRoleAssignmentListResult AddByBillingProfileName(this IBill /// /// Billing Profile Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The cancellation token. /// - public static async Task AddByBillingProfileNameAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AddByBillingProfileAsync(this IBillingRoleAssignmentsOperations operations, string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AddByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.AddByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, parameters, 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 3388eb2759da..db1c6fc46e7f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperations.cs @@ -80,7 +80,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -104,11 +104,11 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingRoleDefinitionName", billingRoleDefinitionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingRoleDefinitionName}", System.Uri.EscapeDataString(billingRoleDefinitionName)); List _queryParameters = new List(); @@ -242,6 +242,9 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -269,7 +272,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -279,6 +282,10 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -295,15 +302,17 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("billingRoleDefinitionName", billingRoleDefinitionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}").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("{billingRoleDefinitionName}", System.Uri.EscapeDataString(billingRoleDefinitionName)); List _queryParameters = new List(); @@ -464,7 +473,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -493,11 +502,11 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("billingRoleDefinitionName", billingRoleDefinitionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfile", 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}/providers/Microsoft.Billing/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); _url = _url.Replace("{billingRoleDefinitionName}", System.Uri.EscapeDataString(billingRoleDefinitionName)); @@ -653,7 +662,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(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) { @@ -672,11 +681,11 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", 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}/providers/Microsoft.Billing/billingRoleDefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -809,6 +818,9 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -833,7 +845,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, 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) { @@ -843,6 +855,10 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -855,14 +871,16 @@ internal BillingRoleDefinitionsOperations(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, "ListByInvoiceSectionName", 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}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Billing/billingRoleDefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions").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) @@ -1019,7 +1037,7 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(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) { @@ -1043,11 +1061,11 @@ internal BillingRoleDefinitionsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", 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}/providers/Microsoft.Billing/billingRoleDefinitions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); List _queryParameters = new List(); 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 cb1c83e8c923..10e68be3ec67 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingRoleDefinitionsOperationsExtensions.cs @@ -33,9 +33,9 @@ public static partial class BillingRoleDefinitionsOperationsExtensions /// /// role definition id. /// - public static BillingRoleDefinition GetByBillingAccountName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName) + public static BillingRoleDefinition GetByBillingAccount(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName) { - return operations.GetByBillingAccountNameAsync(billingAccountName, billingRoleDefinitionName).GetAwaiter().GetResult(); + return operations.GetByBillingAccountAsync(billingAccountName, billingRoleDefinitionName).GetAwaiter().GetResult(); } /// @@ -53,9 +53,9 @@ public static BillingRoleDefinition GetByBillingAccountName(this IBillingRoleDef /// /// The cancellation token. /// - public static async Task GetByBillingAccountNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByBillingAccountAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByBillingAccountNameWithHttpMessagesAsync(billingAccountName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByBillingAccountWithHttpMessagesAsync(billingAccountName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -70,15 +70,18 @@ public static BillingRoleDefinition GetByBillingAccountName(this IBillingRoleDef /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// role definition id. /// - public static BillingRoleDefinition GetByInvoiceSectionName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleDefinitionName) + public static BillingRoleDefinition GetByInvoiceSection(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName) { - return operations.GetByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, billingRoleDefinitionName).GetAwaiter().GetResult(); + return operations.GetByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName).GetAwaiter().GetResult(); } /// @@ -90,6 +93,9 @@ public static BillingRoleDefinition GetByInvoiceSectionName(this IBillingRoleDef /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -99,9 +105,9 @@ public static BillingRoleDefinition GetByInvoiceSectionName(this IBillingRoleDef /// /// The cancellation token. /// - public static async Task GetByInvoiceSectionNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string invoiceSectionName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByInvoiceSectionAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -122,9 +128,9 @@ public static BillingRoleDefinition GetByInvoiceSectionName(this IBillingRoleDef /// /// role definition id. /// - public static BillingRoleDefinition GetByBillingProfileName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName) + public static BillingRoleDefinition GetByBillingProfile(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName) { - return operations.GetByBillingProfileNameAsync(billingAccountName, billingProfileName, billingRoleDefinitionName).GetAwaiter().GetResult(); + return operations.GetByBillingProfileAsync(billingAccountName, billingProfileName, billingRoleDefinitionName).GetAwaiter().GetResult(); } /// @@ -145,9 +151,9 @@ public static BillingRoleDefinition GetByBillingProfileName(this IBillingRoleDef /// /// The cancellation token. /// - public static async Task GetByBillingProfileNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByBillingProfileAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string billingRoleDefinitionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, billingRoleDefinitionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -162,9 +168,9 @@ public static BillingRoleDefinition GetByBillingProfileName(this IBillingRoleDef /// /// billing Account Id. /// - public static BillingRoleDefinitionListResult ListByBillingAccountName(this IBillingRoleDefinitionsOperations operations, string billingAccountName) + public static BillingRoleDefinitionListResult ListByBillingAccount(this IBillingRoleDefinitionsOperations operations, string billingAccountName) { - return operations.ListByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// @@ -179,9 +185,9 @@ public static BillingRoleDefinitionListResult ListByBillingAccountName(this IBil /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(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.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -196,12 +202,15 @@ public static BillingRoleDefinitionListResult ListByBillingAccountName(this IBil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingRoleDefinitionListResult ListByInvoiceSectionName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string invoiceSectionName) + public static BillingRoleDefinitionListResult ListByInvoiceSection(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -213,15 +222,18 @@ public static BillingRoleDefinitionListResult ListByInvoiceSectionName(this IBil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this IBillingRoleDefinitionsOperations operations, string billingAccountName, 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.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -239,9 +251,9 @@ public static BillingRoleDefinitionListResult ListByInvoiceSectionName(this IBil /// /// Billing Profile Id. /// - public static BillingRoleDefinitionListResult ListByBillingProfileName(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName) + public static BillingRoleDefinitionListResult ListByBillingProfile(this IBillingRoleDefinitionsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// @@ -259,9 +271,9 @@ public static BillingRoleDefinitionListResult ListByBillingProfileName(this IBil /// /// The cancellation token. /// - public static async Task ListByBillingProfileNameAsync(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.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, 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 08090ecc3117..fa77fa944c0a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperations.cs @@ -51,12 +51,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) public BillingManagementClient Client { get; private set; } /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// /// billing Account Id. /// + /// + /// Customer name. + /// /// /// Headers that will be added to request. /// @@ -78,12 +81,16 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, 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) { 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"); @@ -96,13 +103,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("customerName", customerName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + 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}/billingSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions").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) { @@ -196,7 +205,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")) @@ -209,7 +218,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) { @@ -229,14 +238,17 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscriptions by billing profile name. + /// Get a single billing subscription by id. /// /// /// /// billing Account Id. /// - /// - /// Billing Profile Id. + /// + /// Customer name. + /// + /// + /// Billing Subscription Id. /// /// /// Headers that will be added to request. @@ -259,15 +271,19 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (billingProfileName == null) + if (customerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (billingSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); } if (Client.ApiVersion == null) { @@ -281,15 +297,17 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByCustomer", 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}/customers/{customerName}/billingSubscriptions/{billingSubscriptionName}").ToString(); _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -383,7 +401,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")) @@ -396,7 +414,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) { @@ -416,15 +434,12 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscription by invoice section name. - /// + /// Lists billing subscriptions by billing account name. + /// /// /// /// billing Account Id. /// - /// - /// InvoiceSection Id. - /// /// /// Headers that will be added to request. /// @@ -446,16 +461,12 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, 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 (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -468,15 +479,13 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", 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}/invoiceSections/{invoiceSectionName}/billingSubscriptions").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("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -570,7 +579,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")) @@ -583,7 +592,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) { @@ -603,17 +612,14 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Get a single billing subscription by name. - /// + /// Lists billing subscriptions by billing profile name. + /// /// /// /// billing Account Id. /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. + /// + /// Billing Profile Id. /// /// /// Headers that will be added to request. @@ -636,19 +642,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, 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 (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); - } - if (billingSubscriptionName == null) + if (billingProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } if (Client.ApiVersion == null) { @@ -662,17 +664,15 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", 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}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}").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("{invoiceSectionName}", System.Uri.EscapeDataString(invoiceSectionName)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -766,7 +766,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 +779,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,50 +799,18 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. + /// Lists billing subscription by invoice section name. + /// /// /// /// billing Account Id. /// - /// - /// InvoiceSection Id. - /// - /// - /// Billing Subscription Id. - /// - /// - /// Parameters supplied to the Transfer Billing Subscription operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginTransferWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Transfers the subscription from one invoice section to another within a - /// billing account. - /// - /// - /// billing Account Id. + /// + /// Billing Profile Id. /// /// /// InvoiceSection Id. /// - /// - /// Billing Subscription Id. - /// - /// - /// Parameters supplied to the Transfer Billing Subscription operation. - /// /// /// Headers that will be added to request. /// @@ -864,23 +832,23 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginTransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties 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 (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (invoiceSectionName == null) + if (billingProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } - if (billingSubscriptionName == null) + if (invoiceSectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); } - if (parameters == null) + if (Client.ApiVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -890,19 +858,22 @@ 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, "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}/invoiceSections/{invoiceSectionName}/billingSubscriptions/{billingSubscriptionName}/transfer").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)); - _url = _url.Replace("{billingSubscriptionName}", System.Uri.EscapeDataString(billingSubscriptionName)); 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); @@ -910,7 +881,7 @@ internal BillingSubscriptionsOperations(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) @@ -941,12 +912,6 @@ 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) { @@ -967,7 +932,7 @@ internal BillingSubscriptionsOperations(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 @@ -997,7 +962,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")) @@ -1010,7 +975,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) { @@ -1022,19 +987,6 @@ internal BillingSubscriptionsOperations(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); @@ -1043,8 +995,848 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) } /// - /// Lists billing subscriptions by billing account name. - /// + /// Get a single billing subscription by name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, 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 (billingSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // 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("billingSubscriptionName", billingSubscriptionName); + 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}/billingSubscriptions/{billingSubscriptionName}").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)); + 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; + } + + /// + /// Transfers the subscription from one invoice section to another within a + /// billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Request parameters supplied to the Transfer Billing Subscription operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Validates the transfer of billing subscriptions across invoice sections. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Parameters supplied to the Transfer Billing Subscription 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> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, 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) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } + if (billingSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + } + 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("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); + tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ValidateTransfer", 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(); + _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)); + 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("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(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; + } + + /// + /// Transfers the subscription from one invoice section to another within a + /// billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Request parameters supplied to the Transfer Billing Subscription 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> BeginTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, 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) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } + if (billingSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingSubscriptionName"); + } + 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("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); + tracingParameters.Add("billingSubscriptionName", billingSubscriptionName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginTransfer", 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(); + _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)); + 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("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(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 billing subscription by customer id. + /// + /// + /// + /// 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 billing subscriptions by billing account name. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -1070,7 +1862,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1085,7 +1877,7 @@ internal BillingSubscriptionsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1179,7 +1971,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")) @@ -1192,7 +1984,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) { 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 b0c9011256f2..e4cc2f127fb0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/BillingSubscriptionsOperationsExtensions.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.Billing public static partial class BillingSubscriptionsOperationsExtensions { /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -31,13 +31,16 @@ public static partial class BillingSubscriptionsOperationsExtensions /// /// billing Account Id. /// - public static IPage ListByBillingAccountName(this IBillingSubscriptionsOperations operations, string billingAccountName) + /// + /// Customer name. + /// + public static IPage ListByCustomer(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName) { - return operations.ListByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByCustomerAsync(billingAccountName, customerName).GetAwaiter().GetResult(); } /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -46,19 +49,43 @@ public static IPage ListByBillingAccountName(this IB /// /// billing Account Id. /// + /// + /// Customer name. + /// /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByCustomerAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists billing subscriptions by billing profile name. + /// Get a single billing subscription by id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Billing Subscription Id. + /// + public static BillingSubscription GetByCustomer(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName, string billingSubscriptionName) + { + return operations.GetByCustomerAsync(billingAccountName, customerName, billingSubscriptionName).GetAwaiter().GetResult(); + } + + /// + /// Get a single billing subscription by id. /// /// /// @@ -67,17 +94,80 @@ public static IPage ListByBillingAccountName(this IB /// /// billing Account Id. /// + /// + /// Customer name. + /// + /// + /// Billing Subscription Id. + /// + /// + /// The cancellation token. + /// + public static async Task GetByCustomerAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string customerName, string billingSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetByCustomerWithHttpMessagesAsync(billingAccountName, customerName, billingSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + public static IPage ListByBillingAccount(this IBillingSubscriptionsOperations operations, string billingAccountName) + { + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); + } + + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists billing subscriptions by billing profile name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// /// /// Billing Profile Id. /// - public static BillingSubscriptionsListResult ListByBillingProfileName(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName) + public static BillingSubscriptionsListResult ListByBillingProfile(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// /// Lists billing subscriptions by billing profile name. - /// + /// /// /// /// The operations group for this extension method. @@ -91,9 +181,9 @@ public static BillingSubscriptionsListResult ListByBillingProfileName(this IBill /// /// The cancellation token. /// - public static async Task ListByBillingProfileNameAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, 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.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -101,7 +191,7 @@ public static BillingSubscriptionsListResult ListByBillingProfileName(this IBill /// /// Lists billing subscription by invoice section name. - /// + /// /// /// /// The operations group for this extension method. @@ -109,17 +199,20 @@ public static BillingSubscriptionsListResult ListByBillingProfileName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static BillingSubscriptionsListResult ListByInvoiceSectionName(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName) + public static BillingSubscriptionsListResult ListByInvoiceSection(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// /// Lists billing subscription by invoice section name. - /// + /// /// /// /// The operations group for this extension method. @@ -127,15 +220,18 @@ public static BillingSubscriptionsListResult ListByInvoiceSectionName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, 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.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -143,7 +239,7 @@ public static BillingSubscriptionsListResult ListByInvoiceSectionName(this IBill /// /// Get a single billing subscription by name. - /// + /// /// /// /// The operations group for this extension method. @@ -151,20 +247,23 @@ public static BillingSubscriptionsListResult ListByInvoiceSectionName(this IBill /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// Billing Subscription Id. /// - public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName) + public static BillingSubscription Get(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName) { - return operations.GetAsync(billingAccountName, invoiceSectionName, billingSubscriptionName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName).GetAwaiter().GetResult(); } /// /// Get a single billing subscription by name. - /// + /// /// /// /// The operations group for this extension method. @@ -172,6 +271,9 @@ public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperation /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -181,9 +283,9 @@ public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperation /// /// The cancellation token. /// - public static async Task GetAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -199,6 +301,9 @@ public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperation /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -206,11 +311,11 @@ public static BillingSubscriptionSummary Get(this IBillingSubscriptionsOperation /// Billing Subscription Id. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters supplied to the Transfer Billing Subscription operation. /// - public static TransferBillingSubscriptionResult Transfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + public static TransferBillingSubscriptionResult Transfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { - return operations.TransferAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + return operations.TransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); } /// @@ -223,6 +328,67 @@ public static TransferBillingSubscriptionResult Transfer(this IBillingSubscripti /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Request parameters supplied to the Transfer Billing 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)) + { + using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Validates the transfer of billing subscriptions across invoice sections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Parameters supplied to the Transfer Billing Subscription operation. + /// + public static ValidateSubscriptionTransferEligibilityResult ValidateTransfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + { + return operations.ValidateTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates the transfer of billing subscriptions across invoice sections. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -235,9 +401,9 @@ public static TransferBillingSubscriptionResult Transfer(this IBillingSubscripti /// /// The cancellation token. /// - public static async Task TransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ValidateTransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ValidateTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -253,6 +419,9 @@ public static TransferBillingSubscriptionResult Transfer(this IBillingSubscripti /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -260,11 +429,11 @@ public static TransferBillingSubscriptionResult Transfer(this IBillingSubscripti /// Billing Subscription Id. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters supplied to the Transfer Billing Subscription operation. /// - public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) + public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters) { - return operations.BeginTransferAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); + return operations.BeginTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters).GetAwaiter().GetResult(); } /// @@ -277,6 +446,9 @@ public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubsc /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -284,21 +456,21 @@ public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubsc /// Billing Subscription Id. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters supplied to the Transfer Billing Subscription operation. /// /// /// The cancellation token. /// - public static async Task BeginTransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginTransferAsync(this IBillingSubscriptionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginTransferWithHttpMessagesAsync(billingAccountName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, billingSubscriptionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -307,13 +479,13 @@ public static TransferBillingSubscriptionResult BeginTransfer(this IBillingSubsc /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNameNext(this IBillingSubscriptionsOperations operations, string nextPageLink) + public static IPage ListByCustomerNext(this IBillingSubscriptionsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByCustomerNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -325,9 +497,45 @@ public static IPage ListByBillingAccountNameNext(thi /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameNextAsync(this IBillingSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByCustomerNextAsync(this IBillingSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountNext(this IBillingSubscriptionsOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// 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 IBillingSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + 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/CustomersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs new file mode 100644 index 000000000000..828e3e65281b --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperations.cs @@ -0,0 +1,989 @@ +// +// 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; + + /// + /// CustomersOperations operations. + /// + internal partial class CustomersOperations : IServiceOperations, ICustomersOperations + { + /// + /// Initializes a new instance of the CustomersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal CustomersOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// 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. + /// + /// + /// 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 filter = default(string), string skiptoken = default(string), 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("filter", filter); + tracingParameters.Add("skiptoken", skiptoken); + 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}/customers").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 (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + 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 customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// billing Account Id. + /// + /// + /// 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. + /// + /// + /// 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 filter = default(string), string skiptoken = default(string), 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"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("skiptoken", skiptoken); + 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}/customers").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 (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (skiptoken != null) + { + _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); + } + 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 customer by its id. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to expand enabledAzurePlans, resellers. + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string customerName, string expand = default(string), 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 (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + // 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("expand", expand); + 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}/customers/{customerName}").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 (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + 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 customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// 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 customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// 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/CustomersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs new file mode 100644 index 000000000000..e047020c0811 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/CustomersOperationsExtensions.cs @@ -0,0 +1,257 @@ +// +// 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 CustomersOperations. + /// + public static partial class CustomersOperationsExtensions + { + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// 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)) + { + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, filter, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// 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)) + { + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, filter, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// 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)) + { + return operations.ListByBillingAccountAsync(billingAccountName, filter, skiptoken).GetAwaiter().GetResult(); + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// 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)) + { + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, filter, skiptoken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a customer by its id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to expand enabledAzurePlans, resellers. + /// + public static Customer Get(this ICustomersOperations operations, string billingAccountName, string customerName, string expand = default(string)) + { + return operations.GetAsync(billingAccountName, customerName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets a customer by its id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to expand enabledAzurePlans, resellers. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ICustomersOperations operations, string billingAccountName, string customerName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, customerName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingProfileNext(this ICustomersOperations operations, string nextPageLink) + { + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists customers by billing profile which the current user can work with + /// on-behalf of a partner. + /// + /// + /// 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 ICustomersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingProfileNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountNext(this ICustomersOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// 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 ICustomersOperations 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/IAddressOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs new file mode 100644 index 000000000000..0497e1cfd7e9 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAddressOperations.cs @@ -0,0 +1,48 @@ +// +// 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; + + /// + /// AddressOperations operations. + /// + public partial interface IAddressOperations + { + /// + /// Validates the address. + /// + /// + /// + /// + /// 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> ValidateWithHttpMessagesAsync(AddressDetails address, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} 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 ad1ad24644a8..8857e689506b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IAgreementsOperations.cs @@ -47,7 +47,7 @@ public partial interface IAgreementsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(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. /// 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 b35c31c7891e..7db9787b2ba7 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingAccountsOperations.cs @@ -27,7 +27,8 @@ public partial interface IBillingAccountsOperations /// Lists all billing accounts for a user which he has access to. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and + /// billingProfiles. /// /// /// The headers that will be added to request. @@ -52,7 +53,8 @@ public partial interface IBillingAccountsOperations /// billing Account Id. /// /// - /// May be used to expand the invoiceSections and billingProfiles. + /// May be used to expand the address, invoiceSections and + /// billingProfiles. /// /// /// The headers that will be added to request. @@ -70,5 +72,103 @@ public partial interface IBillingAccountsOperations /// Thrown when a required parameter is null /// Task> GetWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The operation to update a billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied 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 all invoice sections with create subscription permission for + /// a user. + /// + /// + /// 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>> ListInvoiceSectionsByCreateSubscriptionPermissionWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The operation to update a billing account. + /// + /// + /// billing Account Id. + /// + /// + /// Request parameters supplied 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 all invoice sections with create subscription permission for + /// a user. + /// + /// + /// 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>> ListInvoiceSectionsByCreateSubscriptionPermissionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } 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 1a737016940c..171f2c18de7a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingManagementClient.cs @@ -43,7 +43,7 @@ public partial interface IBillingManagementClient : System.IDisposable /// /// Version of the API to be used with the client request. The current - /// version is 2018-11-01-preview. + /// version is 2019-10-01-preview. /// string ApiVersion { get; } @@ -81,6 +81,11 @@ public partial interface IBillingManagementClient : System.IDisposable /// IPaymentMethodsOperations PaymentMethods { get; } + /// + /// Gets the IAddressOperations. + /// + IAddressOperations Address { get; } + /// /// Gets the IAvailableBalancesOperations. /// @@ -91,45 +96,55 @@ public partial interface IBillingManagementClient : System.IDisposable /// IBillingProfilesOperations BillingProfiles { get; } + /// + /// Gets the ICustomersOperations. + /// + ICustomersOperations Customers { get; } + /// /// Gets the IInvoiceSectionsOperations. /// IInvoiceSectionsOperations InvoiceSections { get; } /// - /// Gets the IDepartmentsOperations. + /// Gets the IBillingPermissionsOperations. /// - IDepartmentsOperations Departments { get; } + IBillingPermissionsOperations BillingPermissions { get; } /// - /// Gets the IEnrollmentAccountsOperations. + /// Gets the IBillingSubscriptionsOperations. /// - IEnrollmentAccountsOperations EnrollmentAccounts { get; } + IBillingSubscriptionsOperations BillingSubscriptions { get; } /// - /// Gets the IInvoicesOperations. + /// Gets the IProductsOperations. /// - IInvoicesOperations Invoices { get; } + IProductsOperations Products { get; } /// - /// Gets the IPriceSheetOperations. + /// Gets the ITransactionsOperations. /// - IPriceSheetOperations PriceSheet { get; } + ITransactionsOperations Transactions { get; } /// - /// Gets the IBillingSubscriptionsOperations. + /// Gets the IDepartmentsOperations. /// - IBillingSubscriptionsOperations BillingSubscriptions { get; } + IDepartmentsOperations Departments { get; } /// - /// Gets the IProductsOperations. + /// Gets the IEnrollmentAccountsOperations. /// - IProductsOperations Products { get; } + IEnrollmentAccountsOperations EnrollmentAccounts { get; } /// - /// Gets the ITransactionsOperations. + /// Gets the IInvoicesOperations. /// - ITransactionsOperations Transactions { get; } + IInvoicesOperations Invoices { get; } + + /// + /// Gets the IPriceSheetOperations. + /// + IPriceSheetOperations PriceSheet { get; } /// /// Gets the IPoliciesOperations. @@ -146,6 +161,16 @@ public partial interface IBillingManagementClient : System.IDisposable /// ITransfersOperations Transfers { get; } + /// + /// Gets the IPartnerTransfersOperations. + /// + IPartnerTransfersOperations PartnerTransfers { get; } + + /// + /// Gets the IPartnerTransfersTransfersOperations. + /// + IPartnerTransfersTransfersOperations PartnerTransfersTransfers { get; } + /// /// Gets the IRecipientTransfersOperations. /// @@ -156,11 +181,6 @@ public partial interface IBillingManagementClient : System.IDisposable /// IOperations Operations { get; } - /// - /// Gets the IBillingPermissionsOperations. - /// - IBillingPermissionsOperations BillingPermissions { get; } - /// /// Gets the IBillingRoleDefinitionsOperations. /// @@ -176,5 +196,10 @@ public partial interface IBillingManagementClient : System.IDisposable /// IAgreementsOperations Agreements { get; } + /// + /// Gets the ILineOfCreditsOperations. + /// + ILineOfCreditsOperations LineOfCredits { get; } + } } 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 e0157246a966..13d471c026ea 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPermissionsOperations.cs @@ -23,6 +23,31 @@ namespace Microsoft.Azure.Management.Billing /// public partial interface IBillingPermissionsOperations { + /// + /// Lists all billing permissions the caller has for a customer. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all billing permissions for the caller under a billing /// account. @@ -52,6 +77,9 @@ public partial interface IBillingPermissionsOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -70,10 +98,9 @@ public partial interface IBillingPermissionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionsWithHttpMessagesAsync(string billingAccountName, 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 billingPermissions for the caller has for a billing - /// account. + /// Lists all billing permissions the caller has for a billing account. /// /// /// billing Account Id. 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 6ea9e0f19913..370ead878038 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingProfilesOperations.cs @@ -48,7 +48,7 @@ public partial interface IBillingProfilesOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(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. /// @@ -78,6 +78,34 @@ public partial interface IBillingProfilesOperations /// Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// The operation to create a BillingProfile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile 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> CreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// The operation to update a billing profile. /// /// @@ -87,7 +115,8 @@ public partial interface IBillingProfilesOperations /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile + /// operation. /// /// /// The headers that will be added to request. @@ -106,6 +135,34 @@ public partial interface IBillingProfilesOperations /// Task> UpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfile parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// The operation to create a BillingProfile. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Request parameters supplied to the Create BillingProfile 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> BeginCreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingProfileCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// The operation to update a billing profile. /// /// @@ -115,7 +172,8 @@ public partial interface IBillingProfilesOperations /// Billing Profile Id. /// /// - /// Parameters supplied to the update billing profile operation. + /// Request parameters supplied to the update billing profile + /// operation. /// /// /// The headers that will be added to request. 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 0c8a4329431b..71374d3abd1b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingPropertyOperations.cs @@ -25,7 +25,7 @@ public partial interface IBillingPropertyOperations { /// /// Get billing property by subscription Id. - /// + /// /// /// /// The headers that will be added to request. 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 e8dd336ace8a..dfd967c25418 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleAssignmentsOperations.cs @@ -72,13 +72,16 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> DeleteByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignment for the caller on the invoice Section /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -100,13 +103,16 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> GetByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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 /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -128,7 +134,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> DeleteByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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 /// @@ -156,7 +162,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete the role assignment on this Billing Profile /// @@ -184,7 +190,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> DeleteByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleAssignmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignments on the Billing Account /// @@ -206,13 +212,16 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(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. /// /// /// billing Account Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The headers that will be added to request. /// @@ -228,13 +237,16 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AddByBillingAccountWithHttpMessagesAsync(string billingAccountName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignments on the invoice Section /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -253,16 +265,22 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to add a role assignment to a invoice Section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The headers that will be added to request. /// @@ -278,7 +296,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AddByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, BillingRoleAssignmentPayload parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get the role assignments on the Billing Profile /// @@ -303,7 +321,7 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, 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 billing profile. /// @@ -313,6 +331,9 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Billing Profile Id. /// + /// + /// Parameters supplied to add a role assignment. + /// /// /// The headers that will be added to request. /// @@ -328,6 +349,6 @@ public partial interface IBillingRoleAssignmentsOperations /// /// Thrown when a required parameter is null /// - Task> AddByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AddByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, BillingRoleAssignmentPayload parameters, 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 332b767d96dd..6de9603a2bcb 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingRoleDefinitionsOperations.cs @@ -47,13 +47,16 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByBillingAccountWithHttpMessagesAsync(string billingAccountName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the role definition for a role /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -75,7 +78,7 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> GetByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the role definition for a role /// @@ -103,7 +106,7 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string billingRoleDefinitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the role definition for a billing account /// @@ -125,13 +128,16 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(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 /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -150,7 +156,7 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, 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 /// @@ -175,6 +181,6 @@ public partial interface IBillingRoleDefinitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, 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 ca05ab3286ca..6f0f5e80e8ac 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IBillingSubscriptionsOperations.cs @@ -24,12 +24,15 @@ namespace Microsoft.Azure.Management.Billing public partial interface IBillingSubscriptionsOperations { /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// /// billing Account Id. /// + /// + /// Customer name. + /// /// /// The headers that will be added to request. /// @@ -45,14 +48,66 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscriptions by billing profile name. + /// Get a single billing subscription by id. /// /// /// /// billing Account Id. /// + /// + /// Customer name. + /// + /// + /// 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> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// 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>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists billing subscriptions by billing profile name. + /// + /// + /// + /// billing Account Id. + /// /// /// Billing Profile Id. /// @@ -71,14 +126,17 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileNameWithHttpMessagesAsync(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 billing subscription by invoice section name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -97,14 +155,17 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get a single billing subscription by name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -126,7 +187,7 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Transfers the subscription from one invoice section to another /// within a billing account. @@ -134,6 +195,45 @@ public partial interface IBillingSubscriptionsOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// + /// + /// Billing Subscription Id. + /// + /// + /// Request parameters supplied to the Transfer Billing Subscription + /// 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> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Validates the transfer of billing subscriptions across invoice + /// sections. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -158,7 +258,7 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> TransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Transfers the subscription from one invoice section to another /// within a billing account. @@ -166,6 +266,9 @@ public partial interface IBillingSubscriptionsOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -173,7 +276,8 @@ public partial interface IBillingSubscriptionsOperations /// Billing Subscription Id. /// /// - /// Parameters supplied to the Transfer Billing Subscription operation. + /// Request parameters supplied to the Transfer Billing Subscription + /// operation. /// /// /// The headers that will be added to request. @@ -190,9 +294,9 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginTransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string billingSubscriptionName, TransferBillingSubscriptionRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists billing subscriptions by billing account name. + /// Lists billing subscription by customer id. /// /// /// @@ -213,6 +317,29 @@ public partial interface IBillingSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByCustomerNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists billing subscriptions by billing account name. + /// + /// + /// + /// 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/ICustomersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs new file mode 100644 index 000000000000..127391a15393 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ICustomersOperations.cs @@ -0,0 +1,168 @@ +// +// 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; + + /// + /// CustomersOperations operations. + /// + public partial interface ICustomersOperations + { + /// + /// Lists customers by billing profile which the current user can work + /// with on-behalf of a partner. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// 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. + /// + /// + /// 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 filter = default(string), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// billing Account Id. + /// + /// + /// 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. + /// + /// + /// 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 filter = default(string), string skiptoken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a customer by its id. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// May be used to expand enabledAzurePlans, resellers. + /// + /// + /// 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 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. + /// + /// + /// 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 customers which the current user can work with on-behalf of a + /// partner. + /// + /// + /// 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/IInvoiceSectionsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs index bd865c95b006..6fe7878c3644 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoiceSectionsOperations.cs @@ -29,33 +29,8 @@ public partial interface IInvoiceSectionsOperations /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. - /// - /// - /// 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> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// The operation to create a InvoiceSection. - /// - /// - /// billing Account Id. - /// - /// - /// Parameters supplied to the Create InvoiceSection operation. + /// + /// Billing Profile Id. /// /// /// The headers that will be added to request. @@ -72,10 +47,9 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all invoice sections under a billing profile for a user which - /// he has access to. + /// Get the InvoiceSection by id. /// /// /// billing Account Id. @@ -83,31 +57,8 @@ public partial interface IInvoiceSectionsOperations /// /// 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> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all invoiceSections with create subscription permission for a - /// user. - /// - /// - /// billing Account Id. - /// - /// - /// May be used to expand the billingProfiles. + /// + /// InvoiceSection Id. /// /// /// The headers that will be added to request. @@ -124,18 +75,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByCreateSubscriptionPermissionWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get the InvoiceSection by id. + /// The operation to create an invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -152,18 +106,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to update a InvoiceSection. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -180,13 +137,16 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Elevates the caller's access to match their billing profile access. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -202,15 +162,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// The operation to create a InvoiceSection. + /// The operation to create an invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -227,18 +193,21 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to update a InvoiceSection. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -255,6 +224,6 @@ public partial interface IInvoiceSectionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, 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 20a9710d6e67..92881627e14e 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IInvoicesOperations.cs @@ -50,7 +50,7 @@ public partial interface IInvoicesOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingAccountNameWithHttpMessagesAsync(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. /// @@ -109,6 +109,6 @@ 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ILineOfCreditsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ILineOfCreditsOperations.cs new file mode 100644 index 000000000000..ba1c6ac5edbf --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ILineOfCreditsOperations.cs @@ -0,0 +1,90 @@ +// +// 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; + + /// + /// LineOfCreditsOperations operations. + /// + public partial interface ILineOfCreditsOperations + { + /// + /// Get the current line of credit. + /// + /// + /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Increase the current line of credit. + /// + /// + /// Parameters supplied to the increase line of credit 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(LineOfCredit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Increase the current line of credit. + /// + /// + /// Parameters supplied to the increase line of credit 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(LineOfCredit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersOperations.cs new file mode 100644 index 000000000000..12424f279f60 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersOperations.cs @@ -0,0 +1,120 @@ +// +// 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; + + /// + /// PartnerTransfersOperations operations. + /// + public partial interface IPartnerTransfersOperations + { + /// + /// Initiates the request to transfer the legacy subscriptions or RIs. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to initiate the transfer. + /// + /// + /// 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> InitiateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, InitiateTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the transfer details for given transfer Id. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// 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 customerName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Cancels the transfer for given transfer Id. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// 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> CancelWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersTransfersOperations.cs new file mode 100644 index 000000000000..257b82644cfd --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPartnerTransfersTransfersOperations.cs @@ -0,0 +1,77 @@ +// +// 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; + + /// + /// PartnerTransfersTransfersOperations operations. + /// + public partial interface IPartnerTransfersTransfersOperations + { + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all transfer's details initiated from given 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs index 3436d0cc3003..ed7a123da510 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPaymentMethodsOperations.cs @@ -25,7 +25,7 @@ public partial interface IPaymentMethodsOperations { /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// billing Account Id. @@ -45,10 +45,10 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// billing Account Id. @@ -71,10 +71,10 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingProfileNameWithHttpMessagesAsync(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 Payment Methods by billing account Id. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -94,10 +94,10 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -117,6 +117,6 @@ public partial interface IPaymentMethodsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingProfileNameNextWithHttpMessagesAsync(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/IPoliciesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs index 093508b3467a..ee9ceb1ce5ce 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPoliciesOperations.cs @@ -26,7 +26,7 @@ public partial interface IPoliciesOperations /// /// The policy for a given billing account name and billing profile /// name. - /// + /// /// /// /// billing Account Id. @@ -49,7 +49,7 @@ public partial interface IPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to update a policy. /// @@ -78,5 +78,66 @@ public partial interface IPoliciesOperations /// Thrown when a required parameter is null /// Task> UpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Policy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The policy for a given billing account name and billing profile + /// name and customer name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// 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> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// The operation to update a Customer policy. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to the update customer policy 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> UpdateCustomerWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, CustomerPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs index 4dbbea4a1d6f..d86f10588980 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IPriceSheetOperations.cs @@ -27,10 +27,38 @@ public partial interface IPriceSheetOperations /// Download price sheet for an invoice. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// 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. @@ -47,15 +75,43 @@ public partial interface IPriceSheetOperations /// /// Thrown when a required parameter is null /// - Task> DownloadWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Download price sheet for an invoice. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// 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. @@ -72,6 +128,6 @@ public partial interface IPriceSheetOperations /// /// Thrown when a required parameter is null /// - Task> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + 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 772e45896fea..b6be7ff53256 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IProductsOperations.cs @@ -23,9 +23,70 @@ namespace Microsoft.Azure.Management.Billing /// public partial interface IProductsOperations { + /// + /// Lists products by customer id. + /// + /// + /// + /// billing Account Id. + /// + /// + /// 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 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 filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a customer's product by name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// 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> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists products by billing account name. - /// + /// /// /// /// billing Account Id. @@ -51,14 +112,17 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string filter = default(string), 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 invoice section name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -83,14 +147,17 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, 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. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -112,13 +179,16 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// The operation to transfer a Product to another invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -143,19 +213,24 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> TransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Cancel auto renew for product by product id and billing account - /// name + /// Validates the transfer of products across invoice sections. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// /// Invoice Id. /// - /// - /// Update auto renew request parameters. + /// + /// Parameters supplied to the Transfer Products operation. /// /// /// The headers that will be added to request. @@ -172,7 +247,7 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateAutoRenewByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Cancel auto renew for product by product id and invoice section /// name @@ -180,6 +255,9 @@ public partial interface IProductsOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -204,10 +282,10 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateAutoRenewByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists products by billing account name. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -227,6 +305,6 @@ public partial interface IProductsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IRecipientTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IRecipientTransfersOperations.cs index bf6c68b38fd2..814c7e69e1e6 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IRecipientTransfersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/IRecipientTransfersOperations.cs @@ -29,8 +29,8 @@ public partial interface IRecipientTransfersOperations /// /// Transfer Name. /// - /// - /// Accept transfer parameters. + /// + /// Parameters supplied to accept the transfer. /// /// /// The headers that will be added to request. @@ -47,7 +47,33 @@ public partial interface IRecipientTransfersOperations /// /// Thrown when a required parameter is null /// - Task> AcceptWithHttpMessagesAsync(string transferName, AcceptTransferRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> AcceptWithHttpMessagesAsync(string transferName, AcceptTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Validates if the products can be transferred in the context of the + /// given transfer name. + /// + /// + /// Transfer Name. + /// + /// + /// Parameters supplied to validate the transfer. + /// + /// + /// 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> ValidateWithHttpMessagesAsync(string transferName, AcceptTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Declines the transfer with given transfer Id. /// 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 c4c94779273c..6d4fe16f1332 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransactionsOperations.cs @@ -23,10 +23,49 @@ 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 startDate, string endDate, 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. @@ -58,11 +97,11 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string startDate, string endDate, 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. @@ -97,15 +136,18 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string startDate, string endDate, 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. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -136,11 +178,70 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string startDate, string endDate, 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 startDate, string endDate, 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 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 transactions by billing account name for given start and /// end date. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -160,6 +261,6 @@ public partial interface ITransactionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransfersOperations.cs index 32cf8b3bff6b..181fdf9757ef 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransfersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ITransfersOperations.cs @@ -29,11 +29,14 @@ public partial interface ITransfersOperations /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// Initiate transfer parameters. + /// + /// Parameters supplied to initiate the transfer. /// /// /// The headers that will be added to request. @@ -50,13 +53,16 @@ public partial interface ITransfersOperations /// /// Thrown when a required parameter is null /// - Task> InitiateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InitiateTransferRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> InitiateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InitiateTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the transfer details for given transfer Id. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -78,13 +84,16 @@ public partial interface ITransfersOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Cancels the transfer for given transfer Id. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -106,13 +115,16 @@ public partial interface ITransfersOperations /// /// Thrown when a required parameter is null /// - Task> CancelWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CancelWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all transfer's details initiated from given invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -131,7 +143,7 @@ public partial interface ITransfersOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all transfer's details initiated from given invoice section. /// 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 578c38188985..4812e4c4443d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperations.cs @@ -56,214 +56,6 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. - /// - /// - /// 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> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string expand = default(string), 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"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("expand", expand); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections").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 (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } - 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; - } - - /// - /// The operation to create a InvoiceSection. - /// - /// - /// billing Account Id. - /// - /// - /// Parameters supplied to the Create InvoiceSection operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(billingAccountName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Lists all invoice sections under a billing profile for a user which he has - /// access to. - /// - /// - /// billing Account Id. - /// /// /// Billing Profile Id. /// @@ -288,7 +80,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(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) { @@ -312,7 +104,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -445,13 +237,16 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } /// - /// Lists all invoiceSections with create subscription permission for a user. + /// Get the InvoiceSection by id. /// /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. /// /// /// Headers that will be added to request. @@ -474,7 +269,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByCreateSubscriptionPermissionWithHttpMessagesAsync(string billingAccountName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -484,6 +279,14 @@ internal InvoiceSectionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } + if (invoiceSectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -492,23 +295,22 @@ internal InvoiceSectionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("expand", expand); + tracingParameters.Add("billingProfileName", billingProfileName); + tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByCreateSubscriptionPermission", 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}/listInvoiceSectionsWithCreateSubscriptionPermission").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 (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -597,7 +399,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")) @@ -610,7 +412,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) { @@ -630,197 +432,31 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } /// - /// Get the InvoiceSection by id. + /// The operation to create an invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Request parameters supplied to the Create InvoiceSection operation. /// /// - /// Headers that will be added to request. + /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest 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 (invoiceSectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("billingAccountName", billingAccountName); - tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("expand", expand); - 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}/invoiceSections/{invoiceSectionName}").ToString(); - _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); - _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 (expand != null) - { - _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); - } - 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; + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// @@ -829,11 +465,14 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The headers that will be added to request. @@ -841,10 +480,10 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// The cancellation token. /// - public async Task> UpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(billingAccountName, invoiceSectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -854,6 +493,9 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -875,12 +517,16 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ElevateToBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, 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"); @@ -893,14 +539,16 @@ internal InvoiceSectionsOperations(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, "ElevateToBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/elevate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/elevate").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 (_queryParameters.Count > 0) @@ -1006,13 +654,19 @@ internal InvoiceSectionsOperations(BillingManagementClient client) } /// - /// The operation to create a InvoiceSection. + /// The operation to create an invoice section. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// Headers that will be added to request. @@ -1035,7 +689,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string billingAccountName, InvoiceSectionProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1045,6 +699,14 @@ internal InvoiceSectionsOperations(BillingManagementClient client) { 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"); @@ -1057,14 +719,18 @@ internal InvoiceSectionsOperations(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("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections").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) { @@ -1077,7 +743,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("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1215,11 +881,14 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// Headers that will be added to request. @@ -1242,7 +911,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1252,6 +921,10 @@ internal InvoiceSectionsOperations(BillingManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -1268,6 +941,7 @@ internal InvoiceSectionsOperations(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("cancellationToken", cancellationToken); @@ -1275,8 +949,9 @@ internal InvoiceSectionsOperations(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}/invoiceSections/{invoiceSectionName}").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) @@ -1290,7 +965,7 @@ internal InvoiceSectionsOperations(BillingManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) 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 1de0c2211554..4052f5850ba4 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoiceSectionsOperationsExtensions.cs @@ -30,12 +30,12 @@ public static partial class InvoiceSectionsOperationsExtensions /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Billing Profile Id. /// - public static InvoiceSectionListResult ListByBillingAccountName(this IInvoiceSectionsOperations operations, string billingAccountName, string expand = default(string)) + public static InvoiceSectionListResult ListByBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingAccountNameAsync(billingAccountName, expand).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// @@ -47,63 +47,22 @@ public static partial class InvoiceSectionsOperationsExtensions /// /// billing Account Id. /// - /// - /// May be used to expand the billingProfiles. - /// - /// - /// The cancellation token. - /// - public static async Task ListByBillingAccountNameAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operation to create a InvoiceSection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Parameters supplied to the Create InvoiceSection operation. - /// - public static InvoiceSection Create(this IInvoiceSectionsOperations operations, string billingAccountName, InvoiceSectionProperties parameters) - { - return operations.CreateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); - } - - /// - /// The operation to create a InvoiceSection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// Parameters supplied to the Create InvoiceSection operation. + /// + /// Billing Profile Id. /// /// /// The cancellation token. /// - public static async Task CreateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, InvoiceSectionProperties parameters, 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.CreateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all invoice sections under a billing profile for a user which he has - /// access to. + /// Get the InvoiceSection by id. /// /// /// The operations group for this extension method. @@ -114,14 +73,16 @@ public static InvoiceSection Create(this IInvoiceSectionsOperations operations, /// /// Billing Profile Id. /// - public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName) + /// + /// InvoiceSection Id. + /// + public static InvoiceSection Get(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// - /// Lists all invoice sections under a billing profile for a user which he has - /// access to. + /// Get the InvoiceSection by id. /// /// /// The operations group for this extension method. @@ -132,59 +93,22 @@ public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSec /// /// Billing Profile Id. /// - /// - /// The cancellation token. - /// - public static async Task ListByBillingProfileNameAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all invoiceSections with create subscription permission for a user. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// May be used to expand the billingProfiles. - /// - public static InvoiceSectionListResult ListByCreateSubscriptionPermission(this IInvoiceSectionsOperations operations, string billingAccountName, string expand = default(string)) - { - return operations.ListByCreateSubscriptionPermissionAsync(billingAccountName, expand).GetAwaiter().GetResult(); - } - - /// - /// Lists all invoiceSections with create subscription permission for a user. - /// - /// - /// The operations group for this extension method. - /// - /// - /// billing Account Id. - /// - /// - /// May be used to expand the billingProfiles. + /// + /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ListByCreateSubscriptionPermissionAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByCreateSubscriptionPermissionWithHttpMessagesAsync(billingAccountName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get the InvoiceSection by id. + /// The operation to create an invoice section. /// /// /// The operations group for this extension method. @@ -192,19 +116,22 @@ public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSec /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Request parameters supplied to the Create InvoiceSection operation. /// - public static InvoiceSection Get(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, string expand = default(string)) + public static InvoiceSection Create(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters) { - return operations.GetAsync(billingAccountName, invoiceSectionName, expand).GetAwaiter().GetResult(); + return operations.CreateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// - /// Get the InvoiceSection by id. + /// The operation to create an invoice section. /// /// /// The operations group for this extension method. @@ -212,18 +139,21 @@ public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSec /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// May be used to expand the billingProfiles. + /// + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The cancellation token. /// - public static async Task GetAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceSectionName, expand, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -238,15 +168,18 @@ public static InvoiceSectionListResult ListByBillingProfileName(this IInvoiceSec /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// - public static InvoiceSection Update(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, InvoiceSection parameters) + public static InvoiceSection Update(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters) { - return operations.UpdateAsync(billingAccountName, invoiceSectionName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// @@ -258,18 +191,21 @@ public static InvoiceSection Update(this IInvoiceSectionsOperations operations, /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(billingAccountName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -284,12 +220,15 @@ public static InvoiceSection Update(this IInvoiceSectionsOperations operations, /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static void ElevateToBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName) + public static void ElevateToBillingProfile(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - operations.ElevateToBillingProfileAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + operations.ElevateToBillingProfileAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -301,19 +240,22 @@ public static void ElevateToBillingProfile(this IInvoiceSectionsOperations opera /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task ElevateToBillingProfileAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ElevateToBillingProfileAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ElevateToBillingProfileWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.ElevateToBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// The operation to create a InvoiceSection. + /// The operation to create an invoice section. /// /// /// The operations group for this extension method. @@ -321,16 +263,22 @@ public static void ElevateToBillingProfile(this IInvoiceSectionsOperations opera /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// - public static InvoiceSection BeginCreate(this IInvoiceSectionsOperations operations, string billingAccountName, InvoiceSectionProperties parameters) + public static InvoiceSection BeginCreate(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters) { - return operations.BeginCreateAsync(billingAccountName, parameters).GetAwaiter().GetResult(); + return operations.BeginCreateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// - /// The operation to create a InvoiceSection. + /// The operation to create an invoice section. /// /// /// The operations group for this extension method. @@ -338,15 +286,21 @@ public static InvoiceSection BeginCreate(this IInvoiceSectionsOperations operati /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The cancellation token. /// - public static async Task BeginCreateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, InvoiceSectionProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSectionCreationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(billingAccountName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -361,15 +315,18 @@ public static InvoiceSection BeginCreate(this IInvoiceSectionsOperations operati /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// - public static InvoiceSection BeginUpdate(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, InvoiceSection parameters) + public static InvoiceSection BeginUpdate(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters) { - return operations.BeginUpdateAsync(billingAccountName, invoiceSectionName, parameters).GetAwaiter().GetResult(); + return operations.BeginUpdateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// @@ -381,18 +338,21 @@ public static InvoiceSection BeginUpdate(this IInvoiceSectionsOperations operati /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// - /// Parameters supplied to the Create InvoiceSection operation. + /// Request parameters supplied to the Create InvoiceSection operation. /// /// /// The cancellation token. /// - public static async Task BeginUpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IInvoiceSectionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InvoiceSection parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(billingAccountName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, 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 67850201bfbf..4dd00b21b1b9 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperations.cs @@ -83,7 +83,7 @@ internal InvoicesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingAccountNameWithHttpMessagesAsync(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) { @@ -112,7 +112,7 @@ internal InvoicesOperations(BillingManagementClient client) tracingParameters.Add("periodStartDate", periodStartDate); tracingParameters.Add("periodEndDate", periodEndDate); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -494,7 +494,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 billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -624,7 +624,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")) @@ -637,7 +637,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) { 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 78ac2e59664b..550178ea1e1a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/InvoicesOperationsExtensions.cs @@ -36,9 +36,9 @@ public static partial class InvoicesOperationsExtensions /// /// Invoice period end date. /// - public static InvoiceListResult ListByBillingAccountName(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate) + public static InvoiceListResult ListByBillingAccount(this IInvoicesOperations operations, string billingAccountName, string periodStartDate, string periodEndDate) { - return operations.ListByBillingAccountNameAsync(billingAccountName, periodStartDate, periodEndDate).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, periodStartDate, periodEndDate).GetAwaiter().GetResult(); } /// @@ -59,9 +59,9 @@ public static InvoiceListResult ListByBillingAccountName(this IInvoicesOperation /// /// The cancellation token. /// - public static async Task ListByBillingAccountNameAsync(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.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, periodStartDate, periodEndDate, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -134,7 +134,7 @@ public static InvoiceListResult ListByBillingProfile(this IInvoicesOperations op /// /// Invoice Id. /// - public static InvoiceSummary Get(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName) + public static Invoice Get(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName) { return operations.GetAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); } @@ -157,7 +157,7 @@ public static InvoiceSummary Get(this IInvoicesOperations operations, string bil /// /// 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 GetAsync(this IInvoicesOperations operations, string billingAccountName, string billingProfileName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceName, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperations.cs new file mode 100644 index 000000000000..68d32a7ccb16 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperations.cs @@ -0,0 +1,446 @@ +// +// 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; + + /// + /// LineOfCreditsOperations operations. + /// + internal partial class LineOfCreditsOperations : IServiceOperations, ILineOfCreditsOperations + { + /// + /// Initializes a new instance of the LineOfCreditsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal LineOfCreditsOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Get the current line of credit. + /// + /// + /// 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> GetWithHttpMessagesAsync(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"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/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("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; + } + + /// + /// Increase the current line of credit. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(LineOfCredit parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Increase the current line of credit. + /// + /// + /// Parameters supplied to the increase line of credit 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(LineOfCredit parameters, 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 (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, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingAccounts/default/lineOfCredit/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("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; + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperationsExtensions.cs new file mode 100644 index 000000000000..748cf35fc8fa --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/LineOfCreditsOperationsExtensions.cs @@ -0,0 +1,121 @@ +// +// 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 LineOfCreditsOperations. + /// + public static partial class LineOfCreditsOperationsExtensions + { + /// + /// Get the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + public static LineOfCredit Get(this ILineOfCreditsOperations operations) + { + return operations.GetAsync().GetAwaiter().GetResult(); + } + + /// + /// Get the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ILineOfCreditsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Increase the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + public static LineOfCredit Update(this ILineOfCreditsOperations operations, LineOfCredit parameters) + { + return operations.UpdateAsync(parameters).GetAwaiter().GetResult(); + } + + /// + /// Increase the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ILineOfCreditsOperations operations, LineOfCredit parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Increase the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + public static LineOfCredit BeginUpdate(this ILineOfCreditsOperations operations, LineOfCredit parameters) + { + return operations.BeginUpdateAsync(parameters).GetAwaiter().GetResult(); + } + + /// + /// Increase the current line of credit. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to the increase line of credit operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ILineOfCreditsOperations operations, LineOfCredit parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Address.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs similarity index 86% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Address.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs index 1dc77e0f9a1a..82031e2a89f4 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Address.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressDetails.cs @@ -16,18 +16,18 @@ namespace Microsoft.Azure.Management.Billing.Models /// /// Address details. /// - public partial class Address + public partial class AddressDetails { /// - /// Initializes a new instance of the Address class. + /// Initializes a new instance of the AddressDetails class. /// - public Address() + public AddressDetails() { CustomInit(); } /// - /// Initializes a new instance of the Address class. + /// Initializes a new instance of the AddressDetails class. /// /// First Name. /// Last Name. @@ -40,7 +40,7 @@ public Address() /// Country code uses ISO2, 2-digit /// format. /// Address Postal Code. - public Address(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)) + 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)) { FirstName = firstName; LastName = lastName; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressValidationStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AddressValidationStatus.cs new file mode 100644 index 000000000000..41d215933e7e --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementType.cs new file mode 100644 index 000000000000..69fd15d0737a --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AgreementType.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 AgreementType. + /// + public static class AgreementType + { + public const string MicrosoftCustomerAgreement = "MicrosoftCustomerAgreement"; + public const string EnterpriseAgreement = "EnterpriseAgreement"; + public const string MicrosoftOnlineServicesProgram = "MicrosoftOnlineServicesProgram"; + } +} 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 49d2c7a5582b..c82d4c302b30 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 @@ -50,10 +50,10 @@ public Amount() public string Currency { get; private set; } /// - /// Gets amount value. + /// Gets or sets amount value. /// [JsonProperty(PropertyName = "value")] - public double? Value { get; private set; } + public double? Value { get; set; } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnabledAzureSKUs.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs similarity index 75% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnabledAzureSKUs.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs index fae4b953ef60..0c6c4ae3a058 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/EnabledAzureSKUs.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/AzurePlan.cs @@ -14,24 +14,24 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Details about the enabled azure sku. + /// Details about the azure plan. /// - public partial class EnabledAzureSKUs + public partial class AzurePlan { /// - /// Initializes a new instance of the EnabledAzureSKUs class. + /// Initializes a new instance of the AzurePlan class. /// - public EnabledAzureSKUs() + public AzurePlan() { CustomInit(); } /// - /// Initializes a new instance of the EnabledAzureSKUs class. + /// Initializes a new instance of the AzurePlan class. /// /// The sku id. /// The sku description. - public EnabledAzureSKUs(string skuId = default(string), string skuDescription = default(string)) + public AzurePlan(string skuId = default(string), string skuDescription = default(string)) { SkuId = skuId; SkuDescription = skuDescription; @@ -44,10 +44,10 @@ public EnabledAzureSKUs() partial void CustomInit(); /// - /// Gets the sku id. + /// Gets or sets the sku id. /// [JsonProperty(PropertyName = "skuId")] - public string SkuId { get; private set; } + public string SkuId { get; set; } /// /// Gets the sku description. 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 8a12514385a0..b45f714a6d00 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 @@ -38,15 +38,13 @@ public BillingAccount() /// Resource name. /// Resource type. /// The billing account name. - /// The billing account Type. Possible values - /// include: 'Organization', 'Enrollment' /// The address associated with billing /// account. - /// Company Name. - /// Country Name. - /// The invoice sections associated to - /// the billing account. By default this is not populated, unless it's - /// specified in $expand. + /// The type of agreement. Possible values + /// include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + /// 'MicrosoftOnlineServicesProgram' + /// The type of customer. Possible values + /// include: 'Enterprise', 'Individual', 'Partner' /// The billing profiles associated to /// the billing account. By default this is not populated, unless it's /// specified in $expand. @@ -57,22 +55,19 @@ public BillingAccount() /// enrollment. /// The accounts associated to the /// enrollment. - /// Specifies whether the user has read - /// access on billing account. - public BillingAccount(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string accountType = default(string), Address address = default(Address), string company = default(string), string country = default(string), IList invoiceSections = default(IList), IList billingProfiles = default(IList), Enrollment enrollmentDetails = default(Enrollment), IList departments = default(IList), IList enrollmentAccounts = default(IList), bool? hasReadAccess = default(bool?)) + /// 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)) : base(id, name, type) { DisplayName = displayName; - AccountType = accountType; Address = address; - Company = company; - Country = country; - InvoiceSections = invoiceSections; + AgreementType = agreementType; + CustomerType = customerType; BillingProfiles = billingProfiles; EnrollmentDetails = enrollmentDetails; Departments = departments; EnrollmentAccounts = enrollmentAccounts; - HasReadAccess = hasReadAccess; + OrganizationId = organizationId; CustomInit(); } @@ -87,38 +82,26 @@ public BillingAccount() [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; private set; } - /// - /// Gets the billing account Type. Possible values include: - /// 'Organization', 'Enrollment' - /// - [JsonProperty(PropertyName = "properties.accountType")] - public string AccountType { get; private set; } - /// /// Gets or sets the address associated with billing account. /// [JsonProperty(PropertyName = "properties.address")] - public Address Address { get; set; } + public AddressDetails Address { get; set; } /// - /// Gets company Name. + /// Gets the type of agreement. Possible values include: + /// 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + /// 'MicrosoftOnlineServicesProgram' /// - [JsonProperty(PropertyName = "properties.company")] - public string Company { get; private set; } + [JsonProperty(PropertyName = "properties.agreementType")] + public string AgreementType { get; private set; } /// - /// Gets country Name. - /// - [JsonProperty(PropertyName = "properties.country")] - public string Country { get; private set; } - - /// - /// Gets or sets the invoice sections associated to the billing - /// account. By default this is not populated, unless it's specified in - /// $expand. + /// Gets the type of customer. Possible values include: 'Enterprise', + /// 'Individual', 'Partner' /// - [JsonProperty(PropertyName = "properties.invoiceSections")] - public IList InvoiceSections { get; set; } + [JsonProperty(PropertyName = "properties.customerType")] + public string CustomerType { get; private set; } /// /// Gets or sets the billing profiles associated to the billing @@ -148,10 +131,10 @@ public BillingAccount() public IList EnrollmentAccounts { get; set; } /// - /// Gets specifies whether the user has read access on billing account. + /// Gets organization id. /// - [JsonProperty(PropertyName = "properties.hasReadAccess")] - public bool? HasReadAccess { get; private set; } + [JsonProperty(PropertyName = "properties.organizationId")] + public string OrganizationId { 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 new file mode 100644 index 000000000000..5caf62f1da02 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingAccountUpdateRequest.cs @@ -0,0 +1,138 @@ +// +// 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; + + /// + /// The request properties of the billing account that can be updated. + /// + [Rest.Serialization.JsonTransformation] + public partial class BillingAccountUpdateRequest + { + /// + /// Initializes a new instance of the BillingAccountUpdateRequest + /// class. + /// + public BillingAccountUpdateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BillingAccountUpdateRequest + /// class. + /// + /// The billing account name. + /// The address associated with billing + /// account. + /// The type of agreement. Possible values + /// include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + /// 'MicrosoftOnlineServicesProgram' + /// The type of customer. Possible values + /// include: 'Enterprise', 'Individual', 'Partner' + /// The billing profiles associated to + /// the billing account. By default this is not populated, unless it's + /// specified in $expand. + /// The details about the associated + /// legacy enrollment. By default this is not populated, unless it's + /// specified in $expand. + /// The departments associated to the + /// 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)) + { + DisplayName = displayName; + Address = address; + AgreementType = agreementType; + CustomerType = customerType; + BillingProfiles = billingProfiles; + EnrollmentDetails = enrollmentDetails; + Departments = departments; + EnrollmentAccounts = enrollmentAccounts; + OrganizationId = organizationId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the billing account name. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets or sets the address associated with billing account. + /// + [JsonProperty(PropertyName = "properties.address")] + public AddressDetails Address { get; set; } + + /// + /// Gets the type of agreement. Possible values include: + /// 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', + /// 'MicrosoftOnlineServicesProgram' + /// + [JsonProperty(PropertyName = "properties.agreementType")] + public string AgreementType { get; private set; } + + /// + /// Gets the type of customer. Possible values include: 'Enterprise', + /// 'Individual', 'Partner' + /// + [JsonProperty(PropertyName = "properties.customerType")] + public string CustomerType { get; private set; } + + /// + /// Gets or sets the billing profiles associated to the billing + /// account. By default this is not populated, unless it's specified in + /// $expand. + /// + [JsonProperty(PropertyName = "properties.billingProfiles")] + public IList BillingProfiles { get; set; } + + /// + /// Gets the details about the associated legacy enrollment. By default + /// this is not populated, unless it's specified in $expand. + /// + [JsonProperty(PropertyName = "properties.enrollmentDetails")] + public Enrollment EnrollmentDetails { get; private set; } + + /// + /// Gets or sets the departments associated to the enrollment. + /// + [JsonProperty(PropertyName = "properties.departments")] + public IList Departments { get; set; } + + /// + /// Gets or sets the accounts associated to the enrollment. + /// + [JsonProperty(PropertyName = "properties.enrollmentAccounts")] + public IList EnrollmentAccounts { get; set; } + + /// + /// Gets organization id. + /// + [JsonProperty(PropertyName = "properties.organizationId")] + public string OrganizationId { get; private set; } + + } +} 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 index 38424b54e002..a1408e2c7373 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingPermissionsListResult.cs @@ -33,7 +33,7 @@ public BillingPermissionsListResult() /// Initializes a new instance of the BillingPermissionsListResult /// class. /// - /// The list OF billingPermissions a caller has on + /// The list of billingPermissions a caller has on /// a billing account. public BillingPermissionsListResult(IList value = default(IList)) { @@ -47,7 +47,7 @@ public BillingPermissionsListResult() partial void CustomInit(); /// - /// Gets the list OF billingPermissions a caller has on a billing + /// Gets the list of billingPermissions a caller has on a billing /// account. /// [JsonProperty(PropertyName = "value")] 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 04f9ea67f8c2..2dc671dc0b30 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 @@ -42,26 +42,23 @@ public BillingProfile() /// Billing address. /// If the billing profile is opted in /// to receive invoices via email. - /// Is OMS bootstrapped billing - /// profile. /// Invoice day. /// The currency associated with the billing /// profile. - /// Information about the - /// product. + /// 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), Address address = default(Address), bool? invoiceEmailOptIn = default(bool?), bool? isClassic = default(bool?), int? invoiceDay = default(int?), string currency = default(string), IList enabledAzureSKUs = default(IList), IList invoiceSections = default(IList)) + 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)) : base(id, name, type) { DisplayName = displayName; PoNumber = poNumber; Address = address; InvoiceEmailOptIn = invoiceEmailOptIn; - IsClassic = isClassic; InvoiceDay = invoiceDay; Currency = currency; - EnabledAzureSKUs = enabledAzureSKUs; + EnabledAzurePlans = enabledAzurePlans; InvoiceSections = invoiceSections; CustomInit(); } @@ -87,7 +84,7 @@ public BillingProfile() /// Gets or sets billing address. /// [JsonProperty(PropertyName = "properties.address")] - public Address Address { get; set; } + public AddressDetails Address { get; set; } /// /// Gets if the billing profile is opted in to receive invoices via @@ -96,12 +93,6 @@ public BillingProfile() [JsonProperty(PropertyName = "properties.invoiceEmailOptIn")] public bool? InvoiceEmailOptIn { get; private set; } - /// - /// Gets is OMS bootstrapped billing profile. - /// - [JsonProperty(PropertyName = "properties.isClassic")] - public bool? IsClassic { get; private set; } - /// /// Gets invoice day. /// @@ -115,10 +106,10 @@ public BillingProfile() public string Currency { get; private set; } /// - /// Gets or sets information about the product. + /// Gets or sets information about the enabled azure plans. /// - [JsonProperty(PropertyName = "properties.enabledAzureSKUs")] - public IList EnabledAzureSKUs { get; set; } + [JsonProperty(PropertyName = "properties.enabledAzurePlans")] + public IList EnabledAzurePlans { get; set; } /// /// Gets or sets the invoice sections associated to the billing 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 new file mode 100644 index 000000000000..3286aade2336 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfileCreationRequest.cs @@ -0,0 +1,90 @@ +// +// 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 request parameters for creating a new billing profile. + /// + public partial class BillingProfileCreationRequest + { + /// + /// Initializes a new instance of the BillingProfileCreationRequest + /// class. + /// + public BillingProfileCreationRequest() + { + CustomInit(); + } + + /// + /// 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)) + { + DisplayName = displayName; + PoNumber = poNumber; + Address = address; + InvoiceEmailOptIn = invoiceEmailOptIn; + EnabledAzurePlans = enabledAzurePlans; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the billing profile name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets purchase order number. + /// + [JsonProperty(PropertyName = "poNumber")] + public string PoNumber { get; set; } + + /// + /// Gets or sets billing address. + /// + [JsonProperty(PropertyName = "address")] + public AddressDetails Address { get; set; } + + /// + /// Gets or sets if the billing profile is opted in to receive invoices + /// via email. + /// + [JsonProperty(PropertyName = "invoiceEmailOptIn")] + public bool? InvoiceEmailOptIn { get; set; } + + /// + /// Gets or sets enabled azure plans for this billing profile. + /// + [JsonProperty(PropertyName = "enabledAzurePlans")] + public IList EnabledAzurePlans { 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/BillingProfilesCreateHeaders.cs new file mode 100644 index 000000000000..c5888737ec7d --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProfilesCreateHeaders.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; + + /// + /// Defines headers for Create operation. + /// + public partial class BillingProfilesCreateHeaders + { + /// + /// Initializes a new instance of the BillingProfilesCreateHeaders + /// class. + /// + public BillingProfilesCreateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BillingProfilesCreateHeaders + /// class. + /// + /// Location URI to poll for result + /// Recommends the retryable time after + /// receiving this. + public BillingProfilesCreateHeaders(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/BillingProperty.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingProperty.cs index 899f2827f887..088d08242916 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 @@ -37,27 +37,30 @@ public BillingProperty() /// Resource type. /// Billing tenant Id. /// Billing account Id. - /// Billing account name. + /// Billing account display + /// name. /// Billing profile Id. - /// Billing profile name. + /// Billing profile display + /// name. /// Cost center name. /// Invoice Section Id. - /// Invoice Section name. + /// 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 billingAccountName = default(string), string billingProfileId = default(string), string billingProfileName = default(string), string costCenter = default(string), string invoiceSectionId = default(string), string invoiceSectionName = default(string), string productId = default(string), string productName = default(string), string skuId = default(string), string skuDescription = default(string)) + 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)) : base(id, name, type) { BillingTenantId = billingTenantId; BillingAccountId = billingAccountId; - BillingAccountName = billingAccountName; + BillingAccountDisplayName = billingAccountDisplayName; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; CostCenter = costCenter; InvoiceSectionId = invoiceSectionId; - InvoiceSectionName = invoiceSectionName; + InvoiceSectionDisplayName = invoiceSectionDisplayName; ProductId = productId; ProductName = productName; SkuId = skuId; @@ -83,10 +86,10 @@ public BillingProperty() public string BillingAccountId { get; private set; } /// - /// Gets billing account name. + /// Gets billing account display name. /// - [JsonProperty(PropertyName = "properties.billingAccountName")] - public string BillingAccountName { get; private set; } + [JsonProperty(PropertyName = "properties.billingAccountDisplayName")] + public string BillingAccountDisplayName { get; private set; } /// /// Gets billing profile Id. @@ -95,10 +98,10 @@ public BillingProperty() public string BillingProfileId { get; private set; } /// - /// Gets billing profile name. + /// Gets billing profile display name. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } /// /// Gets cost center name. @@ -113,10 +116,10 @@ public BillingProperty() public string InvoiceSectionId { get; private set; } /// - /// Gets invoice Section name. + /// Gets invoice Section display name. /// - [JsonProperty(PropertyName = "properties.invoiceSectionName")] - public string InvoiceSectionName { get; private set; } + [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } /// /// Gets product Id. 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 index 9fc63badaf94..74d64a4af330 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingRoleAssignmentPayload.cs @@ -33,12 +33,12 @@ public BillingRoleAssignmentPayload() /// /// The user's principal id that the role /// gets assigned to - /// The role definition + /// The role definition /// id - public BillingRoleAssignmentPayload(string principalId = default(string), string billingRoleDefinitionName = default(string)) + public BillingRoleAssignmentPayload(string principalId = default(string), string billingRoleDefinitionId = default(string)) { PrincipalId = principalId; - BillingRoleDefinitionName = billingRoleDefinitionName; + BillingRoleDefinitionId = billingRoleDefinitionId; CustomInit(); } @@ -48,16 +48,16 @@ public BillingRoleAssignmentPayload() partial void CustomInit(); /// - /// Gets the user's principal id that the role gets assigned to + /// Gets or sets the user's principal id that the role gets assigned to /// [JsonProperty(PropertyName = "principalId")] - public string PrincipalId { get; private set; } + public string PrincipalId { get; set; } /// - /// Gets the role definition id + /// Gets or sets the role definition id /// - [JsonProperty(PropertyName = "billingRoleDefinitionName")] - public string BillingRoleDefinitionName { get; private set; } + [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 1ab8f7a72fef..1d8e57c0f051 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 @@ -38,7 +38,7 @@ public BillingRoleDefinition() /// Resource name. /// Resource type. /// The role description - /// The list OF billingPermissions a caller has on + /// The list of billingPermissions a caller has on /// a billing account. /// The name of the role public BillingRoleDefinition(string id = default(string), string name = default(string), string type = default(string), string description = default(string), IList value = default(IList), string roleName = default(string)) @@ -62,7 +62,7 @@ public BillingRoleDefinition() public string Description { get; private set; } /// - /// Gets the list OF billingPermissions a caller has on a billing + /// Gets the list of billingPermissions a caller has on a billing /// account. /// [JsonProperty(PropertyName = "properties.permissions.value")] diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs similarity index 62% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs index af34cba8b4b7..0d8e1dc1a2cc 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscription.cs @@ -16,21 +16,21 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A billing Subscription summary resource. + /// A billing Subscription resource. /// [Rest.Serialization.JsonTransformation] - public partial class BillingSubscriptionSummary : Resource + public partial class BillingSubscription : Resource { /// - /// Initializes a new instance of the BillingSubscriptionSummary class. + /// Initializes a new instance of the BillingSubscription class. /// - public BillingSubscriptionSummary() + public BillingSubscription() { CustomInit(); } /// - /// Initializes a new instance of the BillingSubscriptionSummary class. + /// Initializes a new instance of the BillingSubscription class. /// /// Resource Id. /// Resource name. @@ -44,15 +44,20 @@ public BillingSubscriptionSummary() /// Month to date charges. /// Billing Profile id to which this /// product belongs. - /// Billing Profile name 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 name to which this - /// product belongs. + /// Invoice section display + /// name to which this product belongs. + /// Reseller for this subscription. /// The sku id. /// The sku description. - public BillingSubscriptionSummary(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 billingProfileName = default(string), string invoiceSectionId = default(string), string invoiceSectionName = default(string), string skuId = default(string), string skuDescription = default(string)) + 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)) : base(id, name, type) { DisplayName = displayName; @@ -61,9 +66,12 @@ public BillingSubscriptionSummary() LastMonthCharges = lastMonthCharges; MonthToDateCharges = monthToDateCharges; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; + CustomerId = customerId; + CustomerDisplayName = customerDisplayName; InvoiceSectionId = invoiceSectionId; - InvoiceSectionName = invoiceSectionName; + InvoiceSectionDisplayName = invoiceSectionDisplayName; + Reseller = reseller; SkuId = skuId; SkuDescription = skuDescription; CustomInit(); @@ -112,10 +120,22 @@ public BillingSubscriptionSummary() public string BillingProfileId { get; private set; } /// - /// Gets billing Profile name to which this product belongs. + /// Gets billing Profile display name to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } + + /// + /// Gets customer id to which this product belongs. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId { get; private set; } + + /// + /// Gets display name of customer to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.customerDisplayName")] + public string CustomerDisplayName { get; private set; } /// /// Gets invoice section id to which this product belongs. @@ -124,10 +144,16 @@ public BillingSubscriptionSummary() public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section name to which this product belongs. + /// Gets invoice section display name to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } + + /// + /// Gets reseller for this subscription. /// - [JsonProperty(PropertyName = "properties.invoiceSectionName")] - public string InvoiceSectionName { get; private set; } + [JsonProperty(PropertyName = "properties.reseller")] + public Reseller Reseller { get; private set; } /// /// Gets or sets the sku id. 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 index 4b5829c166b0..65f02e801fef 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsListResult.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Result of listing billing subscriptions summary. + /// Result of listing billing subscriptions. /// public partial class BillingSubscriptionsListResult { @@ -33,11 +33,10 @@ public BillingSubscriptionsListResult() /// Initializes a new instance of the BillingSubscriptionsListResult /// class. /// - /// The list of billing subscriptions - /// summary. + /// The list of billing subscriptions. /// The link (url) to the next page of /// results. - public BillingSubscriptionsListResult(IList value = default(IList), string nextLink = default(string)) + public BillingSubscriptionsListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -50,10 +49,10 @@ public BillingSubscriptionsListResult() partial void CustomInit(); /// - /// Gets the list of billing subscriptions summary. + /// Gets the list of billing subscriptions. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } /// /// Gets the link (url) to the next page of results. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs index 582e08544f7f..253d7ba5b08d 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/BillingSubscriptionsTransferHeaders.cs @@ -34,13 +34,10 @@ public BillingSubscriptionsTransferHeaders() /// Location URI to poll for result. /// Recommends the retryable time after /// receiving this. - /// URI to poll for the operation - /// status - public BillingSubscriptionsTransferHeaders(string location = default(string), int? retryAfter = default(int?), string azureAsyncOperation = default(string)) + public BillingSubscriptionsTransferHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; CustomInit(); } @@ -61,11 +58,5 @@ public BillingSubscriptionsTransferHeaders() [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } - /// - /// Gets or sets URI to poll for the operation status - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } - } } 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 new file mode 100644 index 000000000000..89c7ab63b4cf --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Customer.cs @@ -0,0 +1,79 @@ +// +// 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; + + /// + /// A partner's customer. + /// + [Rest.Serialization.JsonTransformation] + public partial class Customer : Resource + { + /// + /// Initializes a new instance of the Customer class. + /// + public Customer() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Customer class. + /// + /// Resource Id. + /// Resource name. + /// Resource type. + /// 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)) + : base(id, name, type) + { + DisplayName = displayName; + EnabledAzurePlans = enabledAzurePlans; + Resellers = resellers; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the customer. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets information about the product. + /// + [JsonProperty(PropertyName = "properties.enabledAzurePlans")] + public IList EnabledAzurePlans { get; set; } + + /// + /// Gets or sets the resellers which are allowed to provide service to + /// this 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 new file mode 100644 index 000000000000..2102f397542a --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerPolicy.cs @@ -0,0 +1,60 @@ +// +// 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; + + /// + /// The Customer's Policy. + /// + [Rest.Serialization.JsonTransformation] + public partial class CustomerPolicy : Resource + { + /// + /// Initializes a new instance of the CustomerPolicy class. + /// + public CustomerPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CustomerPolicy class. + /// + /// Resource Id. + /// Resource name. + /// Resource type. + /// Customer can view retail 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) + { + ViewCharges = viewCharges; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets customer can view retail 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/CustomerType.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.cs new file mode 100644 index 000000000000..f3aa34eb0848 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/CustomerType.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 CustomerType. + /// + public static class CustomerType + { + public const string Enterprise = "Enterprise"; + public const string Individual = "Individual"; + public const string Partner = "Partner"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs similarity index 83% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadProperties.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs index f91a65dcf1cb..36f973b7dd43 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DownloadProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Document.cs @@ -16,23 +16,23 @@ namespace Microsoft.Azure.Management.Billing.Models /// /// The properties of the invoice download. /// - public partial class DownloadProperties + public partial class Document { /// - /// Initializes a new instance of the DownloadProperties class. + /// Initializes a new instance of the Document class. /// - public DownloadProperties() + public Document() { CustomInit(); } /// - /// Initializes a new instance of the DownloadProperties class. + /// Initializes a new instance of the Document class. /// /// Document type. Possible values include: /// 'Invoice', 'VoidNote', 'Receipt', 'CreditNote' /// Document URL. - public DownloadProperties(string kind = default(string), string url = default(string)) + public Document(string kind = default(string), string url = default(string)) { Kind = kind; Url = url; 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 new file mode 100644 index 000000000000..6a75ed670068 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/DocumentType.cs @@ -0,0 +1,24 @@ +// +// 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 DocumentType. + /// + public static class DocumentType + { + public const string Invoice = "Invoice"; + public const string VoidNote = "VoidNote"; + public const string Receipt = "Receipt"; + public const string CreditNote = "CreditNote"; + } +} 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 index a16b7c341e08..00b981362f05 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InitiateTransferRequest.cs @@ -32,14 +32,13 @@ public InitiateTransferRequest() /// /// Initializes a new instance of the InitiateTransferRequest class. /// - /// Target Usage context for devTest - /// subscriptions. /// Email Id of recipient for /// transfer. - public InitiateTransferRequest(string billingProfileId = default(string), string recipientEmailId = default(string)) + /// Optional reseller Id for transfer. + public InitiateTransferRequest(string recipientEmailId = default(string), string resellerId = default(string)) { - BillingProfileId = billingProfileId; RecipientEmailId = recipientEmailId; + ResellerId = resellerId; CustomInit(); } @@ -48,17 +47,17 @@ public InitiateTransferRequest() /// partial void CustomInit(); - /// - /// Gets or sets target Usage context for devTest subscriptions. - /// - [JsonProperty(PropertyName = "properties.billingProfileId")] - public string BillingProfileId { get; set; } - /// /// 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/InvoiceSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs similarity index 73% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs index ffd2e631cc45..21725e4db657 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Invoice.cs @@ -21,18 +21,18 @@ namespace Microsoft.Azure.Management.Billing.Models /// An invoice resource. /// [Rest.Serialization.JsonTransformation] - public partial class InvoiceSummary : Resource + public partial class Invoice : Resource { /// - /// Initializes a new instance of the InvoiceSummary class. + /// Initializes a new instance of the Invoice class. /// - public InvoiceSummary() + public Invoice() { CustomInit(); } /// - /// Initializes a new instance of the InvoiceSummary class. + /// Initializes a new instance of the Invoice class. /// /// Resource Id. /// Resource name. @@ -50,14 +50,14 @@ public InvoiceSummary() /// period. /// The billing profile id this invoice /// belongs to. - /// The profile name this invoice - /// belongs to. + /// The billing profile display + /// name this invoice belongs to. /// The purchase identifier for the /// invoice. - /// List of document urls available to - /// download including invoice and tax documents. + /// List of documents available to download + /// including invoice and tax documents. /// List of payments. - public InvoiceSummary(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?), string billingProfileId = default(string), string billingProfileName = default(string), string purchaseOrderNumber = default(string), IList documentUrls = default(IList), IList payments = default(IList)) + 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?), string billingProfileId = default(string), string billingProfileDisplayName = default(string), string purchaseOrderNumber = default(string), IList documents = default(IList), IList payments = default(IList)) : base(id, name, type) { DueDate = dueDate; @@ -68,9 +68,9 @@ public InvoiceSummary() InvoicePeriodStartDate = invoicePeriodStartDate; InvoicePeriodEndDate = invoicePeriodEndDate; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; PurchaseOrderNumber = purchaseOrderNumber; - DocumentUrls = documentUrls; + Documents = documents; Payments = payments; CustomInit(); } @@ -130,10 +130,10 @@ public InvoiceSummary() public string BillingProfileId { get; private set; } /// - /// Gets the profile name this invoice belongs to. + /// Gets the billing profile display name this invoice belongs to. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } /// /// Gets the purchase identifier for the invoice. @@ -142,11 +142,11 @@ public InvoiceSummary() public string PurchaseOrderNumber { get; private set; } /// - /// Gets list of document urls available to download including invoice - /// and tax documents. + /// Gets list of documents available to download including invoice and + /// tax documents. /// - [JsonProperty(PropertyName = "properties.documentUrls")] - public IList DocumentUrls { get; private set; } + [JsonProperty(PropertyName = "properties.documents")] + public IList Documents { get; private set; } /// /// Gets list of payments. 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 index 3d3d9d8b41ae..29686c43e46f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceListResult.cs @@ -34,7 +34,7 @@ public InvoiceListResult() /// The list of invoices. /// The link (url) to the next page of /// results. - public InvoiceListResult(IList value = default(IList), string nextLink = default(string)) + public InvoiceListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -50,7 +50,7 @@ public InvoiceListResult() /// Gets the list of invoices. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } /// /// Gets the link (url) to the next page of results. 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 2c83b9f016f6..7d0e4e64e6d7 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,8 +13,6 @@ 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; /// @@ -38,13 +36,10 @@ public InvoiceSection() /// Resource name. /// Resource type. /// The name of the InvoiceSection. - /// The billing profiles associated to - /// the billing account. - public InvoiceSection(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), IList billingProfiles = default(IList)) + public InvoiceSection(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string)) : base(id, name, type) { DisplayName = displayName; - BillingProfiles = billingProfiles; CustomInit(); } @@ -59,12 +54,5 @@ public InvoiceSection() [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } - /// - /// Gets or sets the billing profiles associated to the billing - /// account. - /// - [JsonProperty(PropertyName = "properties.billingProfiles")] - public IList BillingProfiles { get; set; } - } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs similarity index 57% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionProperties.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs index 0d524e480a90..63666bada0da 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionProperties.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionCreationRequest.cs @@ -11,33 +11,30 @@ namespace Microsoft.Azure.Management.Billing.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// The properties of an InvoiceSection. /// - public partial class InvoiceSectionProperties + public partial class InvoiceSectionCreationRequest { /// - /// Initializes a new instance of the InvoiceSectionProperties class. + /// Initializes a new instance of the InvoiceSectionCreationRequest + /// class. /// - public InvoiceSectionProperties() + public InvoiceSectionCreationRequest() { CustomInit(); } /// - /// Initializes a new instance of the InvoiceSectionProperties class. + /// Initializes a new instance of the InvoiceSectionCreationRequest + /// class. /// /// The name of the InvoiceSection. - /// The billing profiles associated to - /// the billing account. - public InvoiceSectionProperties(string displayName = default(string), IList billingProfiles = default(IList)) + public InvoiceSectionCreationRequest(string displayName = default(string)) { DisplayName = displayName; - BillingProfiles = billingProfiles; CustomInit(); } @@ -52,12 +49,5 @@ public InvoiceSectionProperties() [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } - /// - /// Gets or sets the billing profiles associated to the billing - /// account. - /// - [JsonProperty(PropertyName = "billingProfiles")] - public IList BillingProfiles { get; 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 new file mode 100644 index 000000000000..bb5db3d7a271 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionWithCreateSubPermission.cs @@ -0,0 +1,91 @@ +// +// 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; + + /// + /// Invoice section properties with create subscription permission. + /// + public partial class InvoiceSectionWithCreateSubPermission + { + /// + /// Initializes a new instance of the + /// InvoiceSectionWithCreateSubPermission class. + /// + public InvoiceSectionWithCreateSubPermission() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// InvoiceSectionWithCreateSubPermission class. + /// + /// Invoice Section Id. + /// Invoice Section display + /// name. + /// Billing profile Id. + /// Billing profile display + /// name. + /// 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)) + { + InvoiceSectionId = invoiceSectionId; + InvoiceSectionDisplayName = invoiceSectionDisplayName; + BillingProfileId = billingProfileId; + BillingProfileDisplayName = billingProfileDisplayName; + EnabledAzurePlans = enabledAzurePlans; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets invoice Section Id. + /// + [JsonProperty(PropertyName = "invoiceSectionId")] + public string InvoiceSectionId { get; private set; } + + /// + /// Gets invoice Section display name. + /// + [JsonProperty(PropertyName = "invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } + + /// + /// Gets billing profile Id. + /// + [JsonProperty(PropertyName = "billingProfileId")] + public string BillingProfileId { get; private set; } + + /// + /// Gets billing profile display name. + /// + [JsonProperty(PropertyName = "billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } + + /// + /// Gets or sets enabled azure plans for the associated billing + /// profile. + /// + [JsonProperty(PropertyName = "enabledAzurePlans")] + public IList EnabledAzurePlans { get; set; } + + } +} 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 index 035ba83f811e..347073d3b7c4 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceSectionsCreateHeaders.cs @@ -34,13 +34,10 @@ public InvoiceSectionsCreateHeaders() /// Location URI to poll for result /// Recommends the retryable time after /// receiving this. - /// URI to poll for the operation - /// status - public InvoiceSectionsCreateHeaders(string location = default(string), int? retryAfter = default(int?), string azureAsyncOperation = default(string)) + public InvoiceSectionsCreateHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; CustomInit(); } @@ -61,11 +58,5 @@ public InvoiceSectionsCreateHeaders() [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } - /// - /// Gets or sets URI to poll for the operation status - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { 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 new file mode 100644 index 000000000000..3ed93022c055 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/InvoiceStatus.cs @@ -0,0 +1,24 @@ +// +// 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 InvoiceStatus. + /// + public static class InvoiceStatus + { + public const string PastDue = "PastDue"; + public const string Due = "Due"; + public const string Paid = "Paid"; + public const string Void = "Void"; + } +} 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 new file mode 100644 index 000000000000..69722dbd5433 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCredit.cs @@ -0,0 +1,85 @@ +// +// 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/LineOfCreditsUpdateHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs new file mode 100644 index 000000000000..11328f1778e5 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/LineOfCreditsUpdateHeaders.cs @@ -0,0 +1,60 @@ +// +// 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 Update operation. + /// + public partial class LineOfCreditsUpdateHeaders + { + /// + /// Initializes a new instance of the LineOfCreditsUpdateHeaders class. + /// + public LineOfCreditsUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LineOfCreditsUpdateHeaders class. + /// + /// Location URI to poll for result. + /// Recommends the retryable time after + /// receiving this. + public LineOfCreditsUpdateHeaders(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/MarketplacePurchasesPolicy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/MarketplacePurchasesPolicy.cs new file mode 100644 index 000000000000..b9b51871a589 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/MarketplacePurchasesPolicy.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 MarketplacePurchasesPolicy. + /// + public static class MarketplacePurchasesPolicy + { + public const string AllAllowed = "AllAllowed"; + public const string FreeAllowed = "FreeAllowed"; + public const string NotAllowed = "NotAllowed"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationStatus.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationStatus.cs deleted file mode 100644 index 26a84a70ab38..000000000000 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/OperationStatus.cs +++ /dev/null @@ -1,68 +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; - - /// - /// status of the Billing POST/PUT operation. - /// - public partial class OperationStatus - { - /// - /// Initializes a new instance of the OperationStatus class. - /// - public OperationStatus() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OperationStatus class. - /// - /// The operation Id. - /// Status of the pending operation - /// Status Detail of the pending - /// operation - public OperationStatus(string id = default(string), string status = default(string), string statusDetail = default(string)) - { - Id = id; - Status = status; - StatusDetail = statusDetail; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the operation Id. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets or sets status of the pending operation - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// Gets or sets status Detail of the pending operation - /// - [JsonProperty(PropertyName = "statusDetail")] - public string StatusDetail { get; 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 index 5cf71f943c91..02fb87d8c3d0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PaymentMethod.cs @@ -38,10 +38,10 @@ public PaymentMethod() /// Payment method type. Possible /// values include: 'Credits', 'ChequeWire' /// Details about the payment method. - /// Expiration date. + /// 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), System.DateTime? expiration = default(System.DateTime?), string currency = default(string)) + 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; @@ -70,10 +70,10 @@ public PaymentMethod() public string Details { get; private set; } /// - /// Gets expiration date. + /// Gets expiration month and year. /// [JsonProperty(PropertyName = "properties.expiration")] - public System.DateTime? Expiration { get; private set; } + public string Expiration { get; private set; } /// /// Gets the currency associated with the payment method. 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 1e3f633436fe..85de382160ac 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 @@ -35,18 +35,20 @@ public Policy() /// Resource Id. /// Resource name. /// Resource type. - /// The - /// marketplacePurchasesAllowed flag. - /// The - /// reservationPurchasesAllowed flag. - /// The - /// subscriptionOwnerCanViewCharges flag. - public Policy(string id = default(string), string name = default(string), string type = default(string), bool? marketplacePurchasesAllowed = default(bool?), bool? reservationPurchasesAllowed = default(bool?), bool? subscriptionOwnerCanViewCharges = default(bool?)) + /// The marketplace purchases are + /// free, allowed or not allowed. Possible values include: + /// 'AllAllowed', 'FreeAllowed', 'NotAllowed' + /// The reservation purchases + /// allowed or not. Possible values include: 'Allowed', + /// 'NotAllowed' + /// Who can view charges. Possible values + /// include: 'None', 'SubscriptionOwner' + 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) { - MarketplacePurchasesAllowed = marketplacePurchasesAllowed; - ReservationPurchasesAllowed = reservationPurchasesAllowed; - SubscriptionOwnerCanViewCharges = subscriptionOwnerCanViewCharges; + MarketplacePurchases = marketplacePurchases; + ReservationPurchases = reservationPurchases; + ViewCharges = viewCharges; CustomInit(); } @@ -56,22 +58,26 @@ public Policy() partial void CustomInit(); /// - /// Gets or sets the marketplacePurchasesAllowed flag. + /// Gets or sets the marketplace purchases are free, allowed or not + /// allowed. Possible values include: 'AllAllowed', 'FreeAllowed', + /// 'NotAllowed' /// - [JsonProperty(PropertyName = "properties.marketplacePurchasesAllowed")] - public bool? MarketplacePurchasesAllowed { get; set; } + [JsonProperty(PropertyName = "properties.marketplacePurchases")] + public string MarketplacePurchases { get; set; } /// - /// Gets or sets the reservationPurchasesAllowed flag. + /// Gets or sets the reservation purchases allowed or not. Possible + /// values include: 'Allowed', 'NotAllowed' /// - [JsonProperty(PropertyName = "properties.reservationPurchasesAllowed")] - public bool? ReservationPurchasesAllowed { get; set; } + [JsonProperty(PropertyName = "properties.reservationPurchases")] + public string ReservationPurchases { get; set; } /// - /// Gets or sets the subscriptionOwnerCanViewCharges flag. + /// Gets or sets who can view charges. Possible values include: 'None', + /// 'SubscriptionOwner' /// - [JsonProperty(PropertyName = "properties.subscriptionOwnerCanViewCharges")] - public bool? SubscriptionOwnerCanViewCharges { get; set; } + [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 new file mode 100644 index 000000000000..47a7dd2a5b11 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadByBillingProfileHeaders.cs @@ -0,0 +1,74 @@ +// +// 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 index d01435a680a8..29f758def14c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/PriceSheetDownloadHeaders.cs @@ -34,15 +34,11 @@ public PriceSheetDownloadHeaders() /// The amount of delay to use while the /// status of the operation is checked. The value is expressed in /// seconds. - /// To get the progress of the - /// operation, call GET operation on the URL in Azure-AsyncOperation - /// header field. /// The operation entity Id GUID. - public PriceSheetDownloadHeaders(string location = default(string), string retryAfter = default(string), string azureAsyncOperation = default(string), string oDataEntityId = default(string)) + public PriceSheetDownloadHeaders(string location = default(string), string retryAfter = default(string), string oDataEntityId = default(string)) { Location = location; RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; ODataEntityId = oDataEntityId; CustomInit(); } @@ -66,13 +62,6 @@ public PriceSheetDownloadHeaders() [JsonProperty(PropertyName = "Retry-After")] public string RetryAfter { get; set; } - /// - /// Gets or sets to get the progress of the operation, call GET - /// operation on the URL in Azure-AsyncOperation header field. - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } - /// /// Gets or sets the operation entity Id GUID. /// diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs similarity index 68% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs index 7b824db3a0c1..8303f5c9e9a6 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Product.cs @@ -16,21 +16,21 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A product summary resource. + /// A product resource. /// [Rest.Serialization.JsonTransformation] - public partial class ProductSummary : Resource + public partial class Product : Resource { /// - /// Initializes a new instance of the ProductSummary class. + /// Initializes a new instance of the Product class. /// - public ProductSummary() + public Product() { CustomInit(); } /// - /// Initializes a new instance of the ProductSummary class. + /// Initializes a new instance of the Product class. /// /// Resource Id. /// Resource name. @@ -54,13 +54,18 @@ public ProductSummary() /// Parent Product Id. /// Invoice section id to which this /// product belongs. - /// Invoice section name to which this - /// product belongs. + /// Invoice section display + /// name to which this product belongs. /// Billing Profile id to which this /// product belongs. - /// Billing Profile name to which this - /// product belongs. - public ProductSummary(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 invoiceSectionName = default(string), string billingProfileId = default(string), string billingProfileName = default(string)) + /// 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. + /// 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)) : base(id, name, type) { DisplayName = displayName; @@ -78,9 +83,12 @@ public ProductSummary() AvailabilityId = availabilityId; ParentProductId = parentProductId; InvoiceSectionId = invoiceSectionId; - InvoiceSectionName = invoiceSectionName; + InvoiceSectionDisplayName = invoiceSectionDisplayName; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; + CustomerId = customerId; + CustomerDisplayName = customerDisplayName; + Reseller = reseller; CustomInit(); } @@ -183,10 +191,10 @@ public ProductSummary() public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section name to which this product belongs. + /// Gets invoice section display name to which this product belongs. /// - [JsonProperty(PropertyName = "properties.invoiceSectionName")] - public string InvoiceSectionName { get; private set; } + [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } /// /// Gets billing Profile id to which this product belongs. @@ -195,10 +203,28 @@ public ProductSummary() public string BillingProfileId { get; private set; } /// - /// Gets billing Profile name to which this product belongs. + /// Gets billing Profile display name to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } + + /// + /// Gets customer id to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId { get; private set; } + + /// + /// Gets display name of customer to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.customerDisplayName")] + public string CustomerDisplayName { get; private set; } + + /// + /// Gets reseller for this product. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.reseller")] + public Reseller Reseller { get; private set; } } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferValidationErrorCode.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductTransferValidationErrorCode.cs new file mode 100644 index 000000000000..b2aa3eff7e27 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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 InsufficientPermissionOnSource = "InsufficientPermissionOnSource"; + public const string InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination"; + 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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs index f32c04aec14b..90a6ed7c54f0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsListResult.cs @@ -16,8 +16,8 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Result of listing products summary. It contains a list of available - /// products summaries in reverse chronological order by purchase date. + /// Result of listing products. It contains a list of available products + /// summaries in reverse chronological order by purchase date. /// public partial class ProductsListResult { @@ -32,10 +32,10 @@ public ProductsListResult() /// /// Initializes a new instance of the ProductsListResult class. /// - /// The list of products summary. + /// The list of products. /// The link (url) to the next page of /// results. - public ProductsListResult(IList value = default(IList), string nextLink = default(string)) + public ProductsListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -48,10 +48,10 @@ public ProductsListResult() partial void CustomInit(); /// - /// Gets the list of products summary. + /// Gets the list of products. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } /// /// Gets the link (url) to the next page of results. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs index d0cadf2b0d55..2440f6d2f2f0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ProductsTransferHeaders.cs @@ -32,13 +32,10 @@ public ProductsTransferHeaders() /// Location URI to poll for result /// Recommends the retryable time after /// receiving this. - /// URI to poll for the operation - /// status - public ProductsTransferHeaders(string location = default(string), int? retryAfter = default(int?), string azureAsyncOperation = default(string)) + public ProductsTransferHeaders(string location = default(string), int? retryAfter = default(int?)) { Location = location; RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; CustomInit(); } @@ -59,11 +56,5 @@ public ProductsTransferHeaders() [JsonProperty(PropertyName = "Retry-After")] public int? RetryAfter { get; set; } - /// - /// Gets or sets URI to poll for the operation status - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { 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 index a451ae984fb1..c4dddcb9ca96 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/RecipientTransferDetails.cs @@ -45,13 +45,17 @@ public RecipientTransferDetails() /// 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 canceledBy = default(string), System.DateTime? lastModifiedTime = default(System.DateTime?), IList detailedTransferStatus = default(IList)) + 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; @@ -59,6 +63,9 @@ public RecipientTransferDetails() TransferStatus = transferStatus; RecipientEmailId = recipientEmailId; InitiatorEmailId = initiatorEmailId; + ResellerId = resellerId; + ResellerName = resellerName; + InitiatorCustomerType = initiatorCustomerType; CanceledBy = canceledBy; LastModifiedTime = lastModifiedTime; DetailedTransferStatus = detailedTransferStatus; @@ -108,6 +115,24 @@ public RecipientTransferDetails() [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. /// 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 new file mode 100644 index 000000000000..5efc6c6fcde2 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Reseller.cs @@ -0,0 +1,59 @@ +// +// 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 about a reseller. + /// + public partial class Reseller + { + /// + /// Initializes a new instance of the Reseller class. + /// + public Reseller() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Reseller class. + /// + /// The reseller id. + /// A description of the reseller. + public Reseller(string resellerId = default(string), string description = default(string)) + { + ResellerId = resellerId; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the reseller id. + /// + [JsonProperty(PropertyName = "resellerId")] + public string ResellerId { get; private set; } + + /// + /// Gets a description of the reseller. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; private set; } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPurchasesPolicy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPurchasesPolicy.cs new file mode 100644 index 000000000000..a41293d8b273 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ReservationPurchasesPolicy.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 ReservationPurchasesPolicy. + /// + public static class ReservationPurchasesPolicy + { + public const string Allowed = "Allowed"; + public const string NotAllowed = "NotAllowed"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.cs new file mode 100644 index 000000000000..c0910b803733 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Status.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 Status. + /// + public static class Status + { + public const string Approved = "Approved"; + public const string Rejected = "Rejected"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SubscriptionTransferValidationErrorCode.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/SubscriptionTransferValidationErrorCode.cs new file mode 100644 index 000000000000..128d487ef129 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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 InsufficientPermissionOnSource = "InsufficientPermissionOnSource"; + public const string InsufficientPermissionOnDestination = "InsufficientPermissionOnDestination"; + public const string DestinationBillingProfilePastDue = "DestinationBillingProfilePastDue"; + public const string SubscriptionTypeNotSupported = "SubscriptionTypeNotSupported"; + public const string CrossBillingAccountNotAllowed = "CrossBillingAccountNotAllowed"; + public const string NotAvailableForDestinationMarket = "NotAvailableForDestinationMarket"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs similarity index 70% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs index 97e3617a5a09..41adddc53bee 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/Transaction.cs @@ -16,21 +16,21 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// A reservation transaction summary resource. + /// A reservation transaction resource. /// [Rest.Serialization.JsonTransformation] - public partial class TransactionsSummary : Resource + public partial class Transaction : Resource { /// - /// Initializes a new instance of the TransactionsSummary class. + /// Initializes a new instance of the Transaction class. /// - public TransactionsSummary() + public Transaction() { CustomInit(); } /// - /// Initializes a new instance of the TransactionsSummary class. + /// Initializes a new instance of the Transaction class. /// /// Resource Id. /// Resource name. @@ -53,15 +53,19 @@ public TransactionsSummary() /// Purchase quantity. /// Invoice section id to which this /// product belongs. - /// Invoice section name to which this - /// product belongs. + /// Invoice section display + /// name to which this product belongs. /// Billing Profile id to which this /// product belongs. - /// Billing Profile name 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 TransactionsSummary(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 invoiceSectionName = default(string), string billingProfileId = default(string), string billingProfileName = default(string), string subscriptionId = default(string), string subscriptionName = default(string)) + 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)) : base(id, name, type) { Kind = kind; @@ -77,9 +81,11 @@ public TransactionsSummary() TransactionAmount = transactionAmount; Quantity = quantity; InvoiceSectionId = invoiceSectionId; - InvoiceSectionName = invoiceSectionName; + InvoiceSectionDisplayName = invoiceSectionDisplayName; BillingProfileId = billingProfileId; - BillingProfileName = billingProfileName; + BillingProfileDisplayName = billingProfileDisplayName; + CustomerId = customerId; + CustomerDisplayName = customerDisplayName; SubscriptionId = subscriptionId; SubscriptionName = subscriptionName; CustomInit(); @@ -171,10 +177,10 @@ public TransactionsSummary() public string InvoiceSectionId { get; private set; } /// - /// Gets invoice section name to which this product belongs. + /// Gets invoice section display name to which this product belongs. /// - [JsonProperty(PropertyName = "properties.invoiceSectionName")] - public string InvoiceSectionName { get; private set; } + [JsonProperty(PropertyName = "properties.invoiceSectionDisplayName")] + public string InvoiceSectionDisplayName { get; private set; } /// /// Gets billing Profile id to which this product belongs. @@ -183,10 +189,22 @@ public TransactionsSummary() public string BillingProfileId { get; private set; } /// - /// Gets billing Profile name to which this product belongs. + /// Gets billing Profile display name to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.billingProfileDisplayName")] + public string BillingProfileDisplayName { get; private set; } + + /// + /// Gets customer id to which this product belongs. + /// + [JsonProperty(PropertyName = "properties.customerId")] + public string CustomerId { get; private set; } + + /// + /// Gets display name of customer to which this product belongs. /// - [JsonProperty(PropertyName = "properties.billingProfileName")] - public string BillingProfileName { get; private set; } + [JsonProperty(PropertyName = "properties.customerDisplayName")] + public string CustomerDisplayName { get; private set; } /// /// Gets the subscription id. diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsListResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs similarity index 70% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsListResult.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs index 0698ce1fb2e6..b38f7aa05616 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionsListResult.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransactionListResult.cs @@ -16,26 +16,25 @@ namespace Microsoft.Azure.Management.Billing.Models using System.Linq; /// - /// Result of listing reservation transactions summary. + /// Result of listing reservation transactions. /// - public partial class TransactionsListResult + public partial class TransactionListResult { /// - /// Initializes a new instance of the TransactionsListResult class. + /// Initializes a new instance of the TransactionListResult class. /// - public TransactionsListResult() + public TransactionListResult() { CustomInit(); } /// - /// Initializes a new instance of the TransactionsListResult class. + /// Initializes a new instance of the TransactionListResult class. /// - /// The list of reservation transactions - /// summary. + /// The list of reservation transactions. /// The link (url) to the next page of /// results. - public TransactionsListResult(IList value = default(IList), string nextLink = default(string)) + public TransactionListResult(IList value = default(IList), string nextLink = default(string)) { Value = value; NextLink = nextLink; @@ -48,10 +47,10 @@ public TransactionsListResult() partial void CustomInit(); /// - /// Gets the list of reservation transactions summary. + /// Gets the list of reservation transactions. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } /// /// Gets the link (url) to the next page of results. 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 index 73356f7165b6..caee5a03f332 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequest.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferBillingSubscriptionRequestProperties.cs index 1de9174f58fd..c441d309ce65 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 @@ -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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs index ea1d76fa501e..293d805691c8 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/TransferDetails.cs @@ -38,6 +38,11 @@ public TransferDetails() /// 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' @@ -51,12 +56,16 @@ public TransferDetails() /// 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 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)) + 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; @@ -95,6 +104,30 @@ public TransferDetails() [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', 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 dab785ca787c..76f21e33a9eb 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 @@ -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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperationSummary.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs similarity index 84% rename from sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperationSummary.cs rename to sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs index 7df5ea8e5aca..d30e817542b0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperationSummary.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/UpdateAutoRenewOperation.cs @@ -19,23 +19,21 @@ namespace Microsoft.Azure.Management.Billing.Models /// Summary of cancel product operation /// [Rest.Serialization.JsonTransformation] - public partial class UpdateAutoRenewOperationSummary + public partial class UpdateAutoRenewOperation { /// - /// Initializes a new instance of the UpdateAutoRenewOperationSummary - /// class. + /// Initializes a new instance of the UpdateAutoRenewOperation class. /// - public UpdateAutoRenewOperationSummary() + public UpdateAutoRenewOperation() { CustomInit(); } /// - /// Initializes a new instance of the UpdateAutoRenewOperationSummary - /// class. + /// Initializes a new instance of the UpdateAutoRenewOperation class. /// /// The end date of this asset - public UpdateAutoRenewOperationSummary(System.DateTime? endDate = default(System.DateTime?)) + public UpdateAutoRenewOperation(System.DateTime? endDate = default(System.DateTime?)) { EndDate = endDate; CustomInit(); 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 new file mode 100644 index 000000000000..076c6728e33d --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityError.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityError.cs new file mode 100644 index 000000000000..6d06b5bcc559 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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', + /// 'InsufficientPermissionOnSource', + /// 'InsufficientPermissionOnDestination', + /// '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', + /// 'InsufficientPermissionOnSource', + /// 'InsufficientPermissionOnDestination', + /// '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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateProductTransferEligibilityResult.cs new file mode 100644 index 000000000000..20546dd70c0f --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityError.cs new file mode 100644 index 000000000000..93b4696ea517 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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', + /// 'InsufficientPermissionOnSource', + /// 'InsufficientPermissionOnDestination', + /// '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', + /// 'InsufficientPermissionOnSource', + /// 'InsufficientPermissionOnDestination', + /// '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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateSubscriptionTransferEligibilityResult.cs new file mode 100644 index 000000000000..d467475793ba --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/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/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs new file mode 100644 index 000000000000..3315764c903f --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferListResponse.cs @@ -0,0 +1,56 @@ +// +// 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 new file mode 100644 index 000000000000..e5ff705c05b1 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidateTransferResponse.cs @@ -0,0 +1,73 @@ +// +// 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 new file mode 100644 index 000000000000..5f59a5f39c39 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ValidationResultProperties.cs @@ -0,0 +1,67 @@ +// +// 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/Models/ViewCharges.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewCharges.cs new file mode 100644 index 000000000000..1554a09e32ab --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewCharges.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 ViewCharges. + /// + public static class ViewCharges + { + public const string Allowed = "Allowed"; + public const string NotAllowed = "NotAllowed"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewChargesPolicy.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewChargesPolicy.cs new file mode 100644 index 000000000000..7b579b67e345 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/Models/ViewChargesPolicy.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 ViewChargesPolicy. + /// + public static class ViewChargesPolicy + { + public const string None = "None"; + public const string SubscriptionOwner = "SubscriptionOwner"; + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperations.cs new file mode 100644 index 000000000000..84085899e0d6 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperations.cs @@ -0,0 +1,647 @@ +// +// 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; + + /// + /// PartnerTransfersOperations operations. + /// + internal partial class PartnerTransfersOperations : IServiceOperations, IPartnerTransfersOperations + { + /// + /// Initializes a new instance of the PartnerTransfersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PartnerTransfersOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Initiates the request to transfer the legacy subscriptions or RIs. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to initiate the transfer. + /// + /// + /// 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> InitiateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, InitiateTransferRequest 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 (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + 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("billingProfileName", billingProfileName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Initiate", 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}/customers/{customerName}/initiateTransfer").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + 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("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(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; + } + + /// + /// Gets the transfer details for given transfer Id. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, string transferName, 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 (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (transferName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "transferName"); + } + // 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("customerName", customerName); + tracingParameters.Add("transferName", transferName); + 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}/customers/{customerName}/transfers/{transferName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); + 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; + } + + /// + /// Cancels the transfer for given transfer Id. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// 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> CancelWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, string transferName, 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 (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (transferName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "transferName"); + } + // 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("customerName", customerName); + tracingParameters.Add("transferName", transferName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Cancel", 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}/customers/{customerName}/transfers/{transferName}").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); + 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("DELETE"); + _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/PartnerTransfersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperationsExtensions.cs new file mode 100644 index 000000000000..8860052a15e9 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersOperationsExtensions.cs @@ -0,0 +1,181 @@ +// +// 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 PartnerTransfersOperations. + /// + public static partial class PartnerTransfersOperationsExtensions + { + /// + /// Initiates the request to transfer the legacy subscriptions or RIs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to initiate the transfer. + /// + public static TransferDetails Initiate(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, InitiateTransferRequest parameters) + { + return operations.InitiateAsync(billingAccountName, billingProfileName, customerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Initiates the request to transfer the legacy subscriptions or RIs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to initiate the transfer. + /// + /// + /// The cancellation token. + /// + public static async Task InitiateAsync(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, InitiateTransferRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.InitiateWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the transfer details for given transfer Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + public static TransferDetails Get(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, string transferName) + { + return operations.GetAsync(billingAccountName, billingProfileName, customerName, transferName).GetAwaiter().GetResult(); + } + + /// + /// Gets the transfer details for given transfer Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, transferName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Cancels the transfer for given transfer Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + public static TransferDetails Cancel(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, string transferName) + { + return operations.CancelAsync(billingAccountName, billingProfileName, customerName, transferName).GetAwaiter().GetResult(); + } + + /// + /// Cancels the transfer for given transfer Id. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Transfer Name. + /// + /// + /// The cancellation token. + /// + public static async Task CancelAsync(this IPartnerTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CancelWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, transferName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperations.cs new file mode 100644 index 000000000000..76b9b237a451 --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperations.cs @@ -0,0 +1,409 @@ +// +// 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; + + /// + /// PartnerTransfersTransfersOperations operations. + /// + internal partial class PartnerTransfersTransfersOperations : IServiceOperations, IPartnerTransfersTransfersOperations + { + /// + /// Initializes a new instance of the PartnerTransfersTransfersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PartnerTransfersTransfersOperations(BillingManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the BillingManagementClient + /// + public BillingManagementClient Client { get; private set; } + + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, 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 (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + // 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("customerName", customerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", 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}/customers/{customerName}/transfers").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _url = _url.Replace("{customerName}", System.Uri.EscapeDataString(customerName)); + 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 all transfer's details initiated from given 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>> 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; + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperationsExtensions.cs new file mode 100644 index 000000000000..92744de0099d --- /dev/null +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PartnerTransfersTransfersOperationsExtensions.cs @@ -0,0 +1,105 @@ +// +// 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 PartnerTransfersTransfersOperations. + /// + public static partial class PartnerTransfersTransfersOperationsExtensions + { + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + public static IPage List(this IPartnerTransfersTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName) + { + return operations.ListAsync(billingAccountName, billingProfileName, customerName).GetAwaiter().GetResult(); + } + + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPartnerTransfersTransfersOperations operations, string billingAccountName, string billingProfileName, string customerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all transfer's details initiated from given invoice section. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IPartnerTransfersTransfersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all transfer's details initiated from given 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> ListNextAsync(this IPartnerTransfersTransfersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs index 374230e3d8d2..e624b752ef7a 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperations.cs @@ -52,7 +52,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// billing Account Id. @@ -78,7 +78,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -97,7 +97,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -230,7 +230,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// billing Account Id. @@ -259,7 +259,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingProfileNameWithHttpMessagesAsync(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 (billingAccountName == null) { @@ -283,7 +283,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -417,7 +417,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -443,7 +443,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -458,7 +458,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -586,7 +586,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -612,7 +612,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingProfileNameNextWithHttpMessagesAsync(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) { @@ -627,7 +627,7 @@ internal PaymentMethodsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs index f68d86f732f4..8f13960e5ac3 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PaymentMethodsOperationsExtensions.cs @@ -23,7 +23,7 @@ public static partial class PaymentMethodsOperationsExtensions { /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The operations group for this extension method. @@ -31,14 +31,14 @@ public static partial class PaymentMethodsOperationsExtensions /// /// billing Account Id. /// - public static IPage ListByBillingAccountName(this IPaymentMethodsOperations operations, string billingAccountName) + public static IPage ListByBillingAccount(this IPaymentMethodsOperations operations, string billingAccountName) { - return operations.ListByBillingAccountNameAsync(billingAccountName).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName).GetAwaiter().GetResult(); } /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The operations group for this extension method. @@ -49,9 +49,9 @@ public static IPage ListByBillingAccountName(this IPaymentMethods /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameAsync(this IPaymentMethodsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this IPaymentMethodsOperations operations, string billingAccountName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -59,7 +59,7 @@ public static IPage ListByBillingAccountName(this IPaymentMethods /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The operations group for this extension method. @@ -70,14 +70,14 @@ public static IPage ListByBillingAccountName(this IPaymentMethods /// /// Billing Profile Id. /// - public static IPage ListByBillingProfileName(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName) + public static IPage ListByBillingProfile(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The operations group for this extension method. @@ -91,9 +91,9 @@ public static IPage ListByBillingProfileName(this IPaymentMethods /// /// The cancellation token. /// - public static async Task> ListByBillingProfileNameAsync(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileAsync(this IPaymentMethodsOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -101,7 +101,7 @@ public static IPage ListByBillingProfileName(this IPaymentMethods /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The operations group for this extension method. @@ -109,14 +109,14 @@ public static IPage ListByBillingProfileName(this IPaymentMethods /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNameNext(this IPaymentMethodsOperations operations, string nextPageLink) + public static IPage ListByBillingAccountNext(this IPaymentMethodsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// /// Lists the Payment Methods by billing account Id. - /// + /// /// /// /// The operations group for this extension method. @@ -127,9 +127,9 @@ public static IPage ListByBillingAccountNameNext(this IPaymentMet /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameNextAsync(this IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountNextAsync(this IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -137,7 +137,7 @@ public static IPage ListByBillingAccountNameNext(this IPaymentMet /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The operations group for this extension method. @@ -145,14 +145,14 @@ public static IPage ListByBillingAccountNameNext(this IPaymentMet /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingProfileNameNext(this IPaymentMethodsOperations operations, string nextPageLink) + public static IPage ListByBillingProfileNext(this IPaymentMethodsOperations operations, string nextPageLink) { - return operations.ListByBillingProfileNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByBillingProfileNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// /// Lists the Payment Methods by billing profile Id. - /// + /// /// /// /// The operations group for this extension method. @@ -163,9 +163,9 @@ public static IPage ListByBillingProfileNameNext(this IPaymentMet /// /// The cancellation token. /// - public static async Task> ListByBillingProfileNameNextAsync(this IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingProfileNextAsync(this IPaymentMethodsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameNextWithHttpMessagesAsync(nextPageLink, 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/PoliciesOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs index 0e0efa6ab96f..1f32c9df07f5 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperations.cs @@ -52,7 +52,7 @@ internal PoliciesOperations(BillingManagementClient client) /// /// The policy for a given billing account name and billing profile name. - /// + /// /// /// /// billing Account Id. @@ -81,7 +81,7 @@ internal PoliciesOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -105,7 +105,7 @@ internal PoliciesOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -437,5 +437,411 @@ internal PoliciesOperations(BillingManagementClient client) return _result; } + /// + /// The policy for a given billing account name and billing profile name and + /// customer name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// 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> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, 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 (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // 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("customerName", customerName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetByCustomer", 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}/customers/{customerName}/policies/default").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _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 (_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; + } + + /// + /// The operation to update a Customer policy. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to the update customer policy 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> UpdateCustomerWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string customerName, CustomerPolicy 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 (customerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "customerName"); + } + 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("billingProfileName", billingProfileName); + tracingParameters.Add("customerName", customerName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UpdateCustomer", 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}/customers/{customerName}/policies/default").ToString(); + _url = _url.Replace("{billingAccountName}", System.Uri.EscapeDataString(billingAccountName)); + _url = _url.Replace("{billingProfileName}", System.Uri.EscapeDataString(billingProfileName)); + _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 (_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) + { + 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/PoliciesOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs index 15938b36e44c..714b87e0745c 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PoliciesOperationsExtensions.cs @@ -23,7 +23,7 @@ public static partial class PoliciesOperationsExtensions { /// /// The policy for a given billing account name and billing profile name. - /// + /// /// /// /// The operations group for this extension method. @@ -34,14 +34,14 @@ public static partial class PoliciesOperationsExtensions /// /// Billing Profile Id. /// - public static Policy GetByBillingProfileName(this IPoliciesOperations operations, string billingAccountName, string billingProfileName) + public static Policy GetByBillingProfile(this IPoliciesOperations operations, string billingAccountName, string billingProfileName) { - return operations.GetByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); + return operations.GetByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult(); } /// /// The policy for a given billing account name and billing profile name. - /// + /// /// /// /// The operations group for this extension method. @@ -55,9 +55,9 @@ public static Policy GetByBillingProfileName(this IPoliciesOperations operations /// /// The cancellation token. /// - public static async Task GetByBillingProfileNameAsync(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByBillingProfileAsync(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -109,5 +109,107 @@ public static Policy Update(this IPoliciesOperations operations, string billingA } } + /// + /// The policy for a given billing account name and billing profile name and + /// customer name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + public static CustomerPolicy GetByCustomer(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, string customerName) + { + return operations.GetByCustomerAsync(billingAccountName, billingProfileName, customerName).GetAwaiter().GetResult(); + } + + /// + /// The policy for a given billing account name and billing profile name and + /// customer name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// The cancellation token. + /// + public static async Task GetByCustomerAsync(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, string customerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetByCustomerWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// The operation to update a Customer policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to the update customer policy operation. + /// + public static CustomerPolicy UpdateCustomer(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, string customerName, CustomerPolicy parameters) + { + return operations.UpdateCustomerAsync(billingAccountName, billingProfileName, customerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// The operation to update a Customer policy. + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Customer name. + /// + /// + /// Parameters supplied to the update customer policy operation. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateCustomerAsync(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, string customerName, CustomerPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateCustomerWithHttpMessagesAsync(billingAccountName, billingProfileName, customerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs index 1169c16a7a45..73c97053b8c6 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperations.cs @@ -54,10 +54,35 @@ internal PriceSheetOperations(BillingManagementClient client) /// Download price sheet for an invoice. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// 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. @@ -65,10 +90,10 @@ internal PriceSheetOperations(BillingManagementClient client) /// /// The cancellation token. /// - public async Task> DownloadWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> DownloadByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDownloadWithHttpMessagesAsync(billingAccountName, invoiceName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDownloadByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -76,10 +101,13 @@ internal PriceSheetOperations(BillingManagementClient client) /// Download price sheet for an invoice. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. /// /// /// Headers that will be added to request. @@ -102,7 +130,7 @@ internal PriceSheetOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDownloadWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -112,6 +140,10 @@ internal PriceSheetOperations(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"); @@ -124,14 +156,16 @@ internal PriceSheetOperations(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, "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}/invoices/{invoiceName}/pricesheet/default/download").ToString(); + 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) @@ -271,5 +305,204 @@ internal PriceSheetOperations(BillingManagementClient client) 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 index 44adaa29634e..a1be5f407ad0 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/PriceSheetOperationsExtensions.cs @@ -28,14 +28,17 @@ public static partial class PriceSheetOperationsExtensions /// The operations group for this extension method. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. /// - public static DownloadUrl Download(this IPriceSheetOperations operations, string billingAccountName, string invoiceName) + public static DownloadUrl Download(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName) { - return operations.DownloadAsync(billingAccountName, invoiceName).GetAwaiter().GetResult(); + return operations.DownloadAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); } /// @@ -45,17 +48,60 @@ public static DownloadUrl Download(this IPriceSheetOperations operations, string /// The operations group for this extension method. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// 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 DownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DownloadByBillingProfileAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DownloadWithHttpMessagesAsync(billingAccountName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DownloadByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -68,14 +114,17 @@ public static DownloadUrl Download(this IPriceSheetOperations operations, string /// The operations group for this extension method. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// Invoice Id. /// - public static DownloadUrl BeginDownload(this IPriceSheetOperations operations, string billingAccountName, string invoiceName) + public static DownloadUrl BeginDownload(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, string invoiceName) { - return operations.BeginDownloadAsync(billingAccountName, invoiceName).GetAwaiter().GetResult(); + return operations.BeginDownloadAsync(billingAccountName, billingProfileName, invoiceName).GetAwaiter().GetResult(); } /// @@ -85,17 +134,60 @@ public static DownloadUrl BeginDownload(this IPriceSheetOperations operations, s /// The operations group for this extension method. /// /// - /// Azure Billing Account ID. + /// billing Account Id. + /// + /// + /// Billing Profile Id. /// /// - /// The name of an invoice resource. + /// 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 BeginDownloadAsync(this IPriceSheetOperations operations, string billingAccountName, string invoiceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDownloadByBillingProfileAsync(this IPriceSheetOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginDownloadWithHttpMessagesAsync(billingAccountName, invoiceName, null, cancellationToken).ConfigureAwait(false)) + 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 f6745ea37bcc..7ad32db0d2a8 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperations.cs @@ -50,9 +50,403 @@ internal ProductsOperations(BillingManagementClient client) /// public BillingManagementClient Client { get; private set; } + /// + /// Lists products by customer id. + /// + /// + /// + /// billing Account Id. + /// + /// + /// 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 (:). + /// + /// + /// 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 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"); + } + // 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("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}/products").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 (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 a customer's product by name. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// 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> GetByCustomerWithHttpMessagesAsync(string billingAccountName, string customerName, string productName, 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"); + } + // 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("productName", productName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetByCustomer", 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(); + _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 (_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 products by billing account name. - /// + /// /// /// /// billing Account Id. @@ -84,7 +478,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string filter = default(string), 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) { @@ -104,7 +498,7 @@ internal ProductsOperations(BillingManagementClient client) tracingParameters.Add("billingAccountName", billingAccountName); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -207,7 +601,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")) @@ -220,7 +614,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) { @@ -241,11 +635,14 @@ internal ProductsOperations(BillingManagementClient client) /// /// Lists products by invoice section name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -276,12 +673,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, 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) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } + if (billingProfileName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); + } if (invoiceSectionName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); @@ -298,15 +699,17 @@ 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("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", 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}/invoiceSections/{invoiceSectionName}/products").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products").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) @@ -439,11 +842,14 @@ internal ProductsOperations(BillingManagementClient client) /// /// Get a single product by name. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -471,12 +877,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, 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"); @@ -497,6 +907,7 @@ 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); @@ -504,8 +915,9 @@ internal ProductsOperations(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}/invoiceSections/{invoiceSectionName}/products/{productName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/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(); @@ -601,7 +1013,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")) @@ -614,7 +1026,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) { @@ -639,6 +1051,9 @@ internal ProductsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -669,12 +1084,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> TransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, 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"); @@ -699,6 +1118,7 @@ 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); @@ -707,8 +1127,9 @@ internal ProductsOperations(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}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/transfer").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(); @@ -810,7 +1231,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")) @@ -823,7 +1244,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) { @@ -856,16 +1277,22 @@ internal ProductsOperations(BillingManagementClient client) } /// - /// Cancel auto renew for product by product id and billing account name + /// Validates the transfer of products across invoice sections. /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// /// Invoice Id. /// - /// - /// Update auto renew request parameters. + /// + /// Parameters supplied to the Transfer Products operation. /// /// /// Headers that will be added to request. @@ -888,23 +1315,27 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAutoRenewByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ValidateTransferWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountName"); } - if (productName == null) + if (billingProfileName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "productName"); + throw new ValidationException(ValidationRules.CannotBeNull, "billingProfileName"); } - if (Client.ApiVersion == null) + if (invoiceSectionName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "invoiceSectionName"); } - if (body == null) + if (productName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new ValidationException(ValidationRules.CannotBeNull, "productName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -914,21 +1345,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("body", body); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAutoRenewByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ValidateTransfer", 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/{productName}/updateAutoRenew").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/validateTransferEligibility").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); @@ -967,9 +1398,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"); } @@ -1023,7 +1454,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")) @@ -1036,7 +1467,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) { @@ -1061,6 +1492,9 @@ internal ProductsOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -1091,12 +1525,16 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateAutoRenewByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, 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"); @@ -1121,16 +1559,18 @@ 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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateAutoRenewByInvoiceSectionName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "UpdateAutoRenewByInvoiceSection", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products/{productName}/updateAutoRenew").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(); @@ -1232,7 +1672,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")) @@ -1245,7 +1685,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) { @@ -1266,7 +1706,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// Lists products by billing account name. - /// + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -1292,7 +1732,7 @@ internal ProductsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1307,7 +1747,7 @@ internal ProductsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1401,7 +1841,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")) @@ -1414,7 +1854,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) { 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 d8574bf10be0..d01234b0c380 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/ProductsOperationsExtensions.cs @@ -21,9 +21,111 @@ namespace Microsoft.Azure.Management.Billing /// public static partial class ProductsOperationsExtensions { + /// + /// Lists products by customer id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// 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 (:). + /// + public static ProductsListResult ListByCustomer(this IProductsOperations operations, string billingAccountName, string customerName, string filter = default(string)) + { + return operations.ListByCustomerAsync(billingAccountName, customerName, filter).GetAwaiter().GetResult(); + } + + /// + /// Lists products by customer id. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// 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 cancellation token. + /// + public static async Task ListByCustomerAsync(this IProductsOperations operations, string billingAccountName, string customerName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a customer's product by name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Invoice Id. + /// + public static Product GetByCustomer(this IProductsOperations operations, string billingAccountName, string customerName, string productName) + { + return operations.GetByCustomerAsync(billingAccountName, customerName, productName).GetAwaiter().GetResult(); + } + + /// + /// Get a customer's product by name. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Customer name. + /// + /// + /// Invoice Id. + /// + /// + /// The cancellation token. + /// + public static async Task GetByCustomerAsync(this IProductsOperations operations, string billingAccountName, string customerName, string productName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetByCustomerWithHttpMessagesAsync(billingAccountName, customerName, productName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists products by billing account name. - /// + /// /// /// /// The operations group for this extension method. @@ -37,14 +139,14 @@ public static partial class ProductsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static IPage ListByBillingAccountName(this IProductsOperations operations, string billingAccountName, string filter = default(string)) + public static IPage ListByBillingAccount(this IProductsOperations operations, string billingAccountName, string filter = default(string)) { - return operations.ListByBillingAccountNameAsync(billingAccountName, filter).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, filter).GetAwaiter().GetResult(); } /// /// Lists products by billing account name. - /// + /// /// /// /// The operations group for this extension method. @@ -61,9 +163,9 @@ public static partial class ProductsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameAsync(this IProductsOperations operations, string billingAccountName, string filter = default(string), 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.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -71,7 +173,7 @@ public static partial class ProductsOperationsExtensions /// /// Lists products by invoice section name. - /// + /// /// /// /// The operations group for this extension method. @@ -79,6 +181,9 @@ public static partial class ProductsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -88,14 +193,14 @@ public static partial class ProductsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static ProductsListResult ListByInvoiceSectionName(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string filter = default(string)) + public static ProductsListResult ListByInvoiceSection(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string filter = default(string)) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, filter).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, filter).GetAwaiter().GetResult(); } /// /// Lists products by invoice section name. - /// + /// /// /// /// The operations group for this extension method. @@ -103,6 +208,9 @@ public static partial class ProductsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -115,9 +223,9 @@ public static partial class ProductsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this IProductsOperations operations, string billingAccountName, 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.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -125,7 +233,7 @@ public static partial class ProductsOperationsExtensions /// /// Get a single product by name. - /// + /// /// /// /// The operations group for this extension method. @@ -133,20 +241,23 @@ public static partial class ProductsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// Invoice Id. /// - public static ProductSummary Get(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName) + public static Product Get(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName) { - return operations.GetAsync(billingAccountName, invoiceSectionName, productName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName, productName).GetAwaiter().GetResult(); } /// /// Get a single product by name. - /// + /// /// /// /// The operations group for this extension method. @@ -154,6 +265,9 @@ public static ProductSummary Get(this IProductsOperations operations, string bil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -163,9 +277,9 @@ public static ProductSummary Get(this IProductsOperations operations, string bil /// /// The cancellation token. /// - public static async Task GetAsync(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceSectionName, productName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -180,6 +294,9 @@ public static ProductSummary Get(this IProductsOperations operations, string bil /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -189,9 +306,9 @@ public static ProductSummary Get(this IProductsOperations operations, string bil /// /// Parameters supplied to the Transfer Product operation. /// - public static ProductSummary Transfer(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters) + public static Product Transfer(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters) { - return operations.TransferAsync(billingAccountName, invoiceSectionName, productName, parameters).GetAwaiter().GetResult(); + return operations.TransferAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).GetAwaiter().GetResult(); } /// @@ -203,6 +320,9 @@ public static ProductSummary Transfer(this IProductsOperations operations, strin /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -215,16 +335,16 @@ public static ProductSummary Transfer(this IProductsOperations operations, strin /// /// The cancellation token. /// - public static async Task TransferAsync(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task TransferAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, invoiceSectionName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.TransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Cancel auto renew for product by product id and billing account name + /// Validates the transfer of products across invoice sections. /// /// /// The operations group for this extension method. @@ -232,19 +352,25 @@ public static ProductSummary Transfer(this IProductsOperations operations, strin /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// /// Invoice Id. /// - /// - /// Update auto renew request parameters. + /// + /// Parameters supplied to the Transfer Products operation. /// - public static UpdateAutoRenewOperationSummary UpdateAutoRenewByBillingAccountName(this IProductsOperations operations, string billingAccountName, string productName, UpdateAutoRenewRequest body) + public static ValidateProductTransferEligibilityResult ValidateTransfer(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters) { - return operations.UpdateAutoRenewByBillingAccountNameAsync(billingAccountName, productName, body).GetAwaiter().GetResult(); + return operations.ValidateTransferAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters).GetAwaiter().GetResult(); } /// - /// Cancel auto renew for product by product id and billing account name + /// Validates the transfer of products across invoice sections. /// /// /// The operations group for this extension method. @@ -252,18 +378,24 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByBillingAccountNam /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// + /// + /// InvoiceSection Id. + /// /// /// Invoice Id. /// - /// - /// Update auto renew request parameters. + /// + /// Parameters supplied to the Transfer Products operation. /// /// /// The cancellation token. /// - public static async Task UpdateAutoRenewByBillingAccountNameAsync(this IProductsOperations operations, string billingAccountName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ValidateTransferAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, TransferProductRequestProperties parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateAutoRenewByBillingAccountNameWithHttpMessagesAsync(billingAccountName, productName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ValidateTransferWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -278,6 +410,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByBillingAccountNam /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -287,9 +422,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByBillingAccountNam /// /// Update auto renew request parameters. /// - public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionName(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body) + public static UpdateAutoRenewOperation UpdateAutoRenewByInvoiceSection(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body) { - return operations.UpdateAutoRenewByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, productName, body).GetAwaiter().GetResult(); + return operations.UpdateAutoRenewByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, body).GetAwaiter().GetResult(); } /// @@ -301,6 +436,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionNam /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -313,9 +451,9 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionNam /// /// The cancellation token. /// - public static async Task UpdateAutoRenewByInvoiceSectionNameAsync(this IProductsOperations operations, string billingAccountName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAutoRenewByInvoiceSectionAsync(this IProductsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string productName, UpdateAutoRenewRequest body, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateAutoRenewByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, productName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateAutoRenewByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, productName, body, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -323,7 +461,7 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionNam /// /// Lists products by billing account name. - /// + /// /// /// /// The operations group for this extension method. @@ -331,14 +469,14 @@ public static UpdateAutoRenewOperationSummary UpdateAutoRenewByInvoiceSectionNam /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNameNext(this IProductsOperations operations, string nextPageLink) + public static IPage ListByBillingAccountNext(this IProductsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// /// Lists products by billing account name. - /// + /// /// /// /// The operations group for this extension method. @@ -349,9 +487,9 @@ public static IPage ListByBillingAccountNameNext(this IProductsO /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameNextAsync(this IProductsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountNextAsync(this IProductsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + 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/RecipientTransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperations.cs index 379141cc8125..a37dd849bf00 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperations.cs @@ -56,8 +56,8 @@ internal RecipientTransfersOperations(BillingManagementClient client) /// /// Transfer Name. /// - /// - /// Accept transfer parameters. + /// + /// Parameters supplied to accept the transfer. /// /// /// Headers that will be added to request. @@ -80,15 +80,15 @@ internal RecipientTransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> AcceptWithHttpMessagesAsync(string transferName, AcceptTransferRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> AcceptWithHttpMessagesAsync(string transferName, AcceptTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (transferName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "transferName"); } - if (body == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -98,7 +98,7 @@ internal RecipientTransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("transferName", transferName); - tracingParameters.Add("body", body); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Accept", tracingParameters); } @@ -145,9 +145,9 @@ internal RecipientTransfersOperations(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"); } @@ -233,6 +233,190 @@ internal RecipientTransfersOperations(BillingManagementClient client) return _result; } + /// + /// Validates if the products can be transferred in the context of the given + /// transfer name. + /// + /// + /// Transfer Name. + /// + /// + /// Parameters supplied to validate the transfer. + /// + /// + /// 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> ValidateWithHttpMessagesAsync(string transferName, AcceptTransferRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (transferName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "transferName"); + } + 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("transferName", transferName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Validate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/transfers/{transferName}/validateTransfer").ToString(); + _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); + 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("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(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; + } + /// /// Declines the transfer with given transfer Id. /// @@ -448,7 +632,7 @@ internal RecipientTransfersOperations(BillingManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/transfers/{transferName}/").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/transfers/{transferName}").ToString(); _url = _url.Replace("{transferName}", System.Uri.EscapeDataString(transferName)); List _queryParameters = new List(); if (_queryParameters.Count > 0) diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperationsExtensions.cs index bd0c5678ac0a..f12f304aba5f 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/RecipientTransfersOperationsExtensions.cs @@ -30,12 +30,12 @@ public static partial class RecipientTransfersOperationsExtensions /// /// Transfer Name. /// - /// - /// Accept transfer parameters. + /// + /// Parameters supplied to accept the transfer. /// - public static RecipientTransferDetails Accept(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest body) + public static RecipientTransferDetails Accept(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest parameters) { - return operations.AcceptAsync(transferName, body).GetAwaiter().GetResult(); + return operations.AcceptAsync(transferName, parameters).GetAwaiter().GetResult(); } /// @@ -47,15 +47,57 @@ public static RecipientTransferDetails Accept(this IRecipientTransfersOperations /// /// Transfer Name. /// - /// - /// Accept transfer parameters. + /// + /// Parameters supplied to accept the transfer. /// /// /// The cancellation token. /// - public static async Task AcceptAsync(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task AcceptAsync(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.AcceptWithHttpMessagesAsync(transferName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.AcceptWithHttpMessagesAsync(transferName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Validates if the products can be transferred in the context of the given + /// transfer name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Transfer Name. + /// + /// + /// Parameters supplied to validate the transfer. + /// + public static ValidateTransferListResponse Validate(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest parameters) + { + return operations.ValidateAsync(transferName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates if the products can be transferred in the context of the given + /// transfer name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Transfer Name. + /// + /// + /// Parameters supplied to validate the transfer. + /// + /// + /// The cancellation token. + /// + public static async Task ValidateAsync(this IRecipientTransfersOperations operations, string transferName, AcceptTransferRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateWithHttpMessagesAsync(transferName, parameters, 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 ea1bcebcf0bd..df921c36912f 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,27 +19,32 @@ public static IEnumerable> ApiInfo_BillingManageme { return new Tuple[] { - 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", "BillingPermissions", "2018-11-01-preview"), - new Tuple("Billing", "BillingProfiles", "2018-11-01-preview"), - new Tuple("Billing", "BillingProperty", "2018-11-01-preview"), - new Tuple("Billing", "BillingRoleAssignments", "2018-11-01-preview"), - new Tuple("Billing", "BillingRoleDefinitions", "2018-11-01-preview"), - new Tuple("Billing", "BillingSubscriptions", "2018-11-01-preview"), - new Tuple("Billing", "Departments", "2018-11-01-preview"), - new Tuple("Billing", "EnrollmentAccounts", "2018-11-01-preview"), - new Tuple("Billing", "InvoiceSections", "2018-11-01-preview"), - new Tuple("Billing", "Invoices", "2018-11-01-preview"), - new Tuple("Billing", "Operations", "2018-11-01-preview"), - new Tuple("Billing", "PaymentMethods", "2018-11-01-preview"), - new Tuple("Billing", "Policies", "2018-11-01-preview"), - new Tuple("Billing", "PriceSheet", "2018-11-01-preview"), - new Tuple("Billing", "Products", "2018-11-01-preview"), - new Tuple("Billing", "RecipientTransfers", "2018-11-01-preview"), - new Tuple("Billing", "Transactions", "2018-11-01-preview"), - new Tuple("Billing", "Transfers", "2018-11-01-preview"), + 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"), }.AsEnumerable(); } } 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 15c25c43a851..af4f49332675 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperations.cs @@ -50,10 +50,232 @@ 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 startDate, string endDate, 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 (startDate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "startDate"); + } + if (endDate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "endDate"); + } + // 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("startDate", startDate); + tracingParameters.Add("endDate", endDate); + 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 (startDate != null) + { + _queryParameters.Add(string.Format("startDate={0}", System.Uri.EscapeDataString(startDate))); + } + if (endDate != null) + { + _queryParameters.Add(string.Format("endDate={0}", System.Uri.EscapeDataString(endDate))); + } + 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. @@ -91,7 +313,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameWithHttpMessagesAsync(string billingAccountName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountWithHttpMessagesAsync(string billingAccountName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -121,7 +343,7 @@ internal TransactionsOperations(BillingManagementClient client) tracingParameters.Add("endDate", endDate); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccount", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -232,7 +454,7 @@ internal TransactionsOperations(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")) @@ -245,7 +467,7 @@ internal TransactionsOperations(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) { @@ -267,7 +489,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// Lists the transactions by billing profile name for given start date and end /// date. - /// + /// /// /// /// billing Account Id. @@ -308,7 +530,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByBillingProfileNameWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByBillingProfileWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (billingAccountName == null) { @@ -343,7 +565,7 @@ internal TransactionsOperations(BillingManagementClient client) tracingParameters.Add("endDate", endDate); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfileName", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingProfile", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -455,7 +677,7 @@ internal TransactionsOperations(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")) @@ -468,7 +690,7 @@ internal TransactionsOperations(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) { @@ -490,11 +712,14 @@ internal TransactionsOperations(BillingManagementClient client) /// /// Lists the transactions by invoice section name for given start date and end /// date. - /// + /// /// /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -531,12 +756,16 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByInvoiceSectionNameWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListByInvoiceSectionWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string startDate, string endDate, 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"); @@ -561,17 +790,19 @@ internal TransactionsOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("startDate", startDate); tracingParameters.Add("endDate", endDate); tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByInvoiceSectionName", 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}/invoiceSections/{invoiceSectionName}/transactions").ToString(); + 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) @@ -678,7 +909,7 @@ internal TransactionsOperations(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")) @@ -691,7 +922,7 @@ internal TransactionsOperations(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) { @@ -711,9 +942,398 @@ internal TransactionsOperations(BillingManagementClient client) } /// - /// Lists the transactions by billing account name for given start and end - /// date. - /// + /// Get the transaction. + /// + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Transaction name. + /// + /// + /// Start date + /// + /// + /// End date + /// + /// + /// 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> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string transactionName, string startDate, string endDate, 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 (startDate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "startDate"); + } + if (endDate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "endDate"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // 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("transactionName", transactionName); + tracingParameters.Add("startDate", startDate); + tracingParameters.Add("endDate", endDate); + 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}/transactions/{transactionName}").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)); + List _queryParameters = new List(); + if (startDate != null) + { + _queryParameters.Add(string.Format("startDate={0}", System.Uri.EscapeDataString(startDate))); + } + if (endDate != null) + { + _queryParameters.Add(string.Format("endDate={0}", System.Uri.EscapeDataString(endDate))); + } + 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; + } + + /// + /// 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) + { + 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. + /// /// /// /// The NextLink from the previous successful call to List operation. @@ -739,7 +1359,7 @@ internal TransactionsOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByBillingAccountNameNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByBillingAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -754,7 +1374,7 @@ internal TransactionsOperations(BillingManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNameNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -848,7 +1468,7 @@ internal TransactionsOperations(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")) @@ -861,7 +1481,7 @@ internal TransactionsOperations(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/TransactionsOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs index b688c5fd9120..c94b794fd62b 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransactionsOperationsExtensions.cs @@ -21,10 +21,76 @@ 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 startDate, string endDate, string filter = default(string)) + { + return operations.ListByCustomerAsync(billingAccountName, customerName, startDate, endDate, 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 startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerWithHttpMessagesAsync(billingAccountName, customerName, startDate, endDate, 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. @@ -44,15 +110,15 @@ public static partial class TransactionsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static IPage ListByBillingAccountName(this ITransactionsOperations operations, string billingAccountName, string startDate, string endDate, string filter = default(string)) + public static IPage ListByBillingAccount(this ITransactionsOperations operations, string billingAccountName, string startDate, string endDate, string filter = default(string)) { - return operations.ListByBillingAccountNameAsync(billingAccountName, startDate, endDate, filter).GetAwaiter().GetResult(); + return operations.ListByBillingAccountAsync(billingAccountName, startDate, endDate, filter).GetAwaiter().GetResult(); } /// /// Lists the transactions by billing account name for given start and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -75,9 +141,9 @@ public static partial class TransactionsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameAsync(this ITransactionsOperations operations, string billingAccountName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountAsync(this ITransactionsOperations operations, string billingAccountName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameWithHttpMessagesAsync(billingAccountName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingAccountWithHttpMessagesAsync(billingAccountName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -86,7 +152,7 @@ public static partial class TransactionsOperationsExtensions /// /// Lists the transactions by billing profile name for given start date and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -109,15 +175,15 @@ public static partial class TransactionsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static TransactionsListResult ListByBillingProfileName(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string)) + public static TransactionListResult ListByBillingProfile(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string)) { - return operations.ListByBillingProfileNameAsync(billingAccountName, billingProfileName, startDate, endDate, filter).GetAwaiter().GetResult(); + return operations.ListByBillingProfileAsync(billingAccountName, billingProfileName, startDate, endDate, filter).GetAwaiter().GetResult(); } /// /// Lists the transactions by billing profile name for given start date and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -143,9 +209,9 @@ public static partial class TransactionsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByBillingProfileNameAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByBillingProfileAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -154,7 +220,7 @@ public static partial class TransactionsOperationsExtensions /// /// Lists the transactions by invoice section name for given start date and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -162,6 +228,9 @@ public static partial class TransactionsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -177,15 +246,15 @@ public static partial class TransactionsOperationsExtensions /// 'not'. Tag filter is a key value pair string where key and value is /// separated by a colon (:). /// - public static TransactionsListResult ListByInvoiceSectionName(this ITransactionsOperations operations, string billingAccountName, string invoiceSectionName, string startDate, string endDate, string filter = default(string)) + public static TransactionListResult ListByInvoiceSection(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string startDate, string endDate, string filter = default(string)) { - return operations.ListByInvoiceSectionNameAsync(billingAccountName, invoiceSectionName, startDate, endDate, filter).GetAwaiter().GetResult(); + return operations.ListByInvoiceSectionAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate, filter).GetAwaiter().GetResult(); } /// /// Lists the transactions by invoice section name for given start date and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -193,6 +262,9 @@ public static partial class TransactionsOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -211,9 +283,105 @@ public static partial class TransactionsOperationsExtensions /// /// The cancellation token. /// - public static async Task ListByInvoiceSectionNameAsync(this ITransactionsOperations operations, string billingAccountName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListByInvoiceSectionAsync(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string startDate, string endDate, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByInvoiceSectionWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get the transaction. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// billing Account Id. + /// + /// + /// Billing Profile Id. + /// + /// + /// Transaction name. + /// + /// + /// Start date + /// + /// + /// End date + /// + public static Transaction Get(this ITransactionsOperations operations, string billingAccountName, string billingProfileName, string transactionName, string startDate, string endDate) + { + return operations.GetAsync(billingAccountName, billingProfileName, transactionName, startDate, endDate).GetAwaiter().GetResult(); + } + + /// + /// Get the transaction. + /// + /// + /// + /// 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 startDate, string endDate, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByInvoiceSectionNameWithHttpMessagesAsync(billingAccountName, invoiceSectionName, startDate, endDate, filter, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, transactionName, startDate, endDate, 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. + /// + 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 cancellation token. + /// + public static async Task> ListByCustomerNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByCustomerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -222,7 +390,7 @@ public static partial class TransactionsOperationsExtensions /// /// Lists the transactions by billing account name for given start and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -230,15 +398,15 @@ public static partial class TransactionsOperationsExtensions /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByBillingAccountNameNext(this ITransactionsOperations operations, string nextPageLink) + public static IPage ListByBillingAccountNext(this ITransactionsOperations operations, string nextPageLink) { - return operations.ListByBillingAccountNameNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByBillingAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// /// Lists the transactions by billing account name for given start and end /// date. - /// + /// /// /// /// The operations group for this extension method. @@ -249,9 +417,9 @@ public static IPage ListByBillingAccountNameNext(this ITran /// /// The cancellation token. /// - public static async Task> ListByBillingAccountNameNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByBillingAccountNextAsync(this ITransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByBillingAccountNameNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + 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/TransfersOperations.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperations.cs index 9bd562f3cebd..7a42f150f109 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperations.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperations.cs @@ -56,11 +56,14 @@ internal TransfersOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// Initiate transfer parameters. + /// + /// Parameters supplied to initiate the transfer. /// /// /// Headers that will be added to request. @@ -83,19 +86,23 @@ internal TransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> InitiateWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, InitiateTransferRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> InitiateWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, InitiateTransferRequest 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 (body == null) + if (parameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -105,15 +112,17 @@ internal TransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); - tracingParameters.Add("body", body); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Initiate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/initiateTransfer").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/initiateTransfer").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 (_queryParameters.Count > 0) @@ -154,9 +163,9 @@ internal TransfersOperations(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"); } @@ -248,6 +257,9 @@ internal TransfersOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -275,12 +287,16 @@ internal TransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, 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"); @@ -297,6 +313,7 @@ internal TransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("transferName", transferName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -304,8 +321,9 @@ internal TransfersOperations(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}/invoiceSections/{invoiceSectionName}/transfers/{transferName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}").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("{transferName}", System.Uri.EscapeDataString(transferName)); List _queryParameters = new List(); @@ -435,6 +453,9 @@ internal TransfersOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -462,12 +483,16 @@ internal TransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CancelWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, string transferName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CancelWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, 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"); @@ -484,6 +509,7 @@ internal TransfersOperations(BillingManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("billingAccountName", billingAccountName); + tracingParameters.Add("billingProfileName", billingProfileName); tracingParameters.Add("invoiceSectionName", invoiceSectionName); tracingParameters.Add("transferName", transferName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -491,8 +517,9 @@ internal TransfersOperations(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}/invoiceSections/{invoiceSectionName}/transfers/{transferName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers/{transferName}").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("{transferName}", System.Uri.EscapeDataString(transferName)); List _queryParameters = new List(); @@ -622,6 +649,9 @@ internal TransfersOperations(BillingManagementClient client) /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -646,12 +676,16 @@ internal TransfersOperations(BillingManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string billingAccountName, string invoiceSectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string billingAccountName, string billingProfileName, string invoiceSectionName, 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"); @@ -664,14 +698,16 @@ internal TransfersOperations(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, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/transfers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/transfers").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 (_queryParameters.Count > 0) diff --git a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperationsExtensions.cs b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperationsExtensions.cs index fc89c4ca02b4..3b529a83a0c3 100644 --- a/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperationsExtensions.cs +++ b/sdk/billing/Microsoft.Azure.Management.Billing/src/Generated/TransfersOperationsExtensions.cs @@ -30,15 +30,18 @@ public static partial class TransfersOperationsExtensions /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// Initiate transfer parameters. + /// + /// Parameters supplied to initiate the transfer. /// - public static TransferDetails Initiate(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, InitiateTransferRequest body) + public static TransferDetails Initiate(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InitiateTransferRequest parameters) { - return operations.InitiateAsync(billingAccountName, invoiceSectionName, body).GetAwaiter().GetResult(); + return operations.InitiateAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters).GetAwaiter().GetResult(); } /// @@ -50,18 +53,21 @@ public static TransferDetails Initiate(this ITransfersOperations operations, str /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - /// - /// Initiate transfer parameters. + /// + /// Parameters supplied to initiate the transfer. /// /// /// The cancellation token. /// - public static async Task InitiateAsync(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, InitiateTransferRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task InitiateAsync(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, InitiateTransferRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.InitiateWithHttpMessagesAsync(billingAccountName, invoiceSectionName, body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.InitiateWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -76,15 +82,18 @@ public static TransferDetails Initiate(this ITransfersOperations operations, str /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// Transfer Name. /// - public static TransferDetails Get(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, string transferName) + public static TransferDetails Get(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName) { - return operations.GetAsync(billingAccountName, invoiceSectionName, transferName).GetAwaiter().GetResult(); + return operations.GetAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).GetAwaiter().GetResult(); } /// @@ -96,6 +105,9 @@ public static TransferDetails Get(this ITransfersOperations operations, string b /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -105,9 +117,9 @@ public static TransferDetails Get(this ITransfersOperations operations, string b /// /// The cancellation token. /// - public static async Task GetAsync(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, invoiceSectionName, transferName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -122,15 +134,18 @@ public static TransferDetails Get(this ITransfersOperations operations, string b /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// Transfer Name. /// - public static TransferDetails Cancel(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, string transferName) + public static TransferDetails Cancel(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName) { - return operations.CancelAsync(billingAccountName, invoiceSectionName, transferName).GetAwaiter().GetResult(); + return operations.CancelAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName).GetAwaiter().GetResult(); } /// @@ -142,6 +157,9 @@ public static TransferDetails Cancel(this ITransfersOperations operations, strin /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// @@ -151,9 +169,9 @@ public static TransferDetails Cancel(this ITransfersOperations operations, strin /// /// The cancellation token. /// - public static async Task CancelAsync(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CancelAsync(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, string transferName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CancelWithHttpMessagesAsync(billingAccountName, invoiceSectionName, transferName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CancelWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, transferName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -168,12 +186,15 @@ public static TransferDetails Cancel(this ITransfersOperations operations, strin /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// - public static IPage List(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName) + public static IPage List(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName) { - return operations.ListAsync(billingAccountName, invoiceSectionName).GetAwaiter().GetResult(); + return operations.ListAsync(billingAccountName, billingProfileName, invoiceSectionName).GetAwaiter().GetResult(); } /// @@ -185,15 +206,18 @@ public static IPage List(this ITransfersOperations operations, /// /// billing Account Id. /// + /// + /// Billing Profile Id. + /// /// /// InvoiceSection Id. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ITransfersOperations operations, string billingAccountName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ITransfersOperations operations, string billingAccountName, string billingProfileName, string invoiceSectionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(billingAccountName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(billingAccountName, billingProfileName, invoiceSectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } From c967f0d551a242ad9bdf10cb00933424d8154608 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2019 06:33:27 +0000 Subject: [PATCH 07/23] Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme --- ...sOperations.cs => IPublicIPAddressesOperations.cs} | 0 ...ualWANsOperations.cs => IVirtualWansOperations.cs} | 0 ...s => ApplicationGatewayFrontendIPConfiguration.cs} | 0 ...ration.cs => ApplicationGatewayIPConfiguration.cs} | 0 ...dIpConfiguration.cs => FrontendIPConfiguration.cs} | 0 .../{IpAllocationMethod.cs => IPAllocationMethod.cs} | 0 ...guration.cs => NetworkInterfaceIPConfiguration.cs} | 0 .../Models/{PublicIpAddress.cs => PublicIPAddress.cs} | 0 ...ssDnsSettings.cs => PublicIPAddressDnsSettings.cs} | 0 ...ion.cs => VirtualNetworkGatewayIPConfiguration.cs} | 0 ...esOperations.cs => PublicIPAddressesOperations.cs} | 0 ...ns.cs => PublicIPAddressesOperationsExtensions.cs} | 0 .../src/Generated/SdkInfo_NetworkManagementClient.cs | 11 ----------- ...tualWANsOperations.cs => VirtualWansOperations.cs} | 0 ...tensions.cs => VirtualWansOperationsExtensions.cs} | 0 15 files changed, 11 deletions(-) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{IPublicIpAddressesOperations.cs => IPublicIPAddressesOperations.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{IVirtualWANsOperations.cs => IVirtualWansOperations.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{ApplicationGatewayFrontendIpConfiguration.cs => ApplicationGatewayFrontendIPConfiguration.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{ApplicationGatewayIpConfiguration.cs => ApplicationGatewayIPConfiguration.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{FrontendIpConfiguration.cs => FrontendIPConfiguration.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{IpAllocationMethod.cs => IPAllocationMethod.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{NetworkInterfaceIpConfiguration.cs => NetworkInterfaceIPConfiguration.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{PublicIpAddress.cs => PublicIPAddress.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{PublicIpAddressDnsSettings.cs => PublicIPAddressDnsSettings.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{VirtualNetworkGatewayIpConfiguration.cs => VirtualNetworkGatewayIPConfiguration.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{PublicIpAddressesOperations.cs => PublicIPAddressesOperations.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{PublicIpAddressesOperationsExtensions.cs => PublicIPAddressesOperationsExtensions.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{VirtualWANsOperations.cs => VirtualWansOperations.cs} (100%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{VirtualWANsOperationsExtensions.cs => VirtualWansOperationsExtensions.cs} (100%) diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPAddressesOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIpAddressesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPublicIPAddressesOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWansOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWANsOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualWansOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayFrontendIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpAllocationMethod.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPAllocationMethod.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IpAllocationMethod.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPAllocationMethod.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddress.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddress.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddressDnsSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddressDnsSettings.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddressDnsSettings.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPAddressDnsSettings.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIpConfiguration.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayIPConfiguration.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperationsExtensions.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperationsExtensions.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPAddressesOperationsExtensions.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs index 386b9a90b511..b250bdaf7a1d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs @@ -110,16 +110,5 @@ public static IEnumerable> ApiInfo_NetworkManageme }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/network/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\Projects\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "3d752bf8850d2a1baa3b3aebdd4682224f4f81e8"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperations.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperations.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperationsExtensions.cs similarity index 100% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperationsExtensions.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWansOperationsExtensions.cs From acbab4886b76a2fa0b353a135c33a7f9784c55af Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2019 07:23:30 +0000 Subject: [PATCH 08/23] [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt --- .../ContainerRegistryManagementClient.cs | 12 + .../IContainerRegistryManagementClient.cs | 10 + .../src/Generated/IRegistriesOperations.cs | 58 + .../src/Generated/IScopeMapsOperations.cs | 305 ++++ .../src/Generated/ITokensOperations.cs | 285 +++ .../Models/GenerateCredentialsParameters.cs | 78 + .../Models/GenerateCredentialsResult.cs | 63 + ...OperationServiceSpecificationDefinition.cs | 2 +- .../src/Generated/Models/Registry.cs | 4 +- .../src/Generated/Models/Replication.cs | 4 +- .../src/Generated/Models/RetentionPolicy.cs | 8 +- .../src/Generated/Models/ScopeMap.cs | 116 ++ .../Models/ScopeMapUpdateParameters.cs | 70 + .../src/Generated/Models/Status.cs | 57 +- .../src/Generated/Models/Status1.cs | 71 + .../src/Generated/Models/Token.cs | 110 ++ .../src/Generated/Models/TokenCertificate.cs | 81 + .../Generated/Models/TokenCertificateName.cs | 22 + .../Models/TokenCredentialsProperties.cs | 58 + .../src/Generated/Models/TokenPassword.cs | 79 + .../src/Generated/Models/TokenPasswordName.cs | 22 + .../src/Generated/Models/TokenStatus.cs | 22 + .../Generated/Models/TokenUpdateParameters.cs | 76 + .../src/Generated/RegistriesOperations.cs | 255 +++ .../RegistriesOperationsExtensions.cs | 92 + .../src/Generated/ScopeMapsOperations.cs | 1554 +++++++++++++++++ .../ScopeMapsOperationsExtensions.cs | 480 +++++ ...kInfo_ContainerRegistryManagementClient.cs | 3 + .../src/Generated/TokensOperations.cs | 1526 ++++++++++++++++ .../Generated/TokensOperationsExtensions.cs | 438 +++++ 30 files changed, 5899 insertions(+), 62 deletions(-) create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IScopeMapsOperations.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITokensOperations.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsParameters.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsResult.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMap.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMapUpdateParameters.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Status1.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Token.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificate.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificateName.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCredentialsProperties.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPassword.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPasswordName.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenStatus.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenUpdateParameters.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperations.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperationsExtensions.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperations.cs create mode 100644 sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperationsExtensions.cs diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs index b8f5a8bb5e92..4c7b96c11a2b 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ContainerRegistryManagementClient.cs @@ -96,6 +96,16 @@ public partial class ContainerRegistryManagementClient : ServiceClient public virtual ITasksOperations Tasks { get; private set; } + /// + /// Gets the IScopeMapsOperations. + /// + public virtual IScopeMapsOperations ScopeMaps { get; private set; } + + /// + /// Gets the ITokensOperations. + /// + public virtual ITokensOperations Tokens { get; private set; } + /// /// Initializes a new instance of the ContainerRegistryManagementClient class. /// @@ -343,6 +353,8 @@ private void Initialize() Webhooks = new WebhooksOperations(this); Runs = new RunsOperations(this); Tasks = new TasksOperations(this); + ScopeMaps = new ScopeMapsOperations(this); + Tokens = new TokensOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs index e245c6061829..915fb7d07773 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IContainerRegistryManagementClient.cs @@ -93,5 +93,15 @@ public partial interface IContainerRegistryManagementClient : System.IDisposable /// ITasksOperations Tasks { get; } + /// + /// Gets the IScopeMapsOperations. + /// + IScopeMapsOperations ScopeMaps { get; } + + /// + /// Gets the ITokensOperations. + /// + ITokensOperations Tokens { get; } + } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs index 4c90452f8283..f9726c7e19ea 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IRegistriesOperations.cs @@ -367,6 +367,35 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task> GetBuildSourceUploadUrlWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Generate keys for a token of a specified container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for generating credentials. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Copies an image to this container registry from the specified /// container registry. /// @@ -506,6 +535,35 @@ public partial interface IRegistriesOperations /// System.Threading.Tasks.Task> BeginScheduleRunWithHttpMessagesAsync(string resourceGroupName, string registryName, RunRequest runRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Generate keys for a token of a specified container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for generating credentials. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginGenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all the container registries under the specified resource /// group. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IScopeMapsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IScopeMapsOperations.cs new file mode 100644 index 000000000000..582dbe5cba91 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/IScopeMapsOperations.cs @@ -0,0 +1,305 @@ +// +// 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.ContainerRegistry +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + + /// + /// ScopeMapsOperations operations. + /// + public partial interface IScopeMapsOperations + { + /// + /// Gets the properties of the specified scope map. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a scope map for a container registry with the specified + /// parameters. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a scope map from a container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a scope map with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the scope maps for the specified container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a scope map for a container registry with the specified + /// parameters. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a scope map from a container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a scope map with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the scope maps for the specified container registry. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITokensOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITokensOperations.cs new file mode 100644 index 000000000000..54ea4e6b411e --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ITokensOperations.cs @@ -0,0 +1,285 @@ +// +// 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.ContainerRegistry +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + + /// + /// TokensOperations operations. + /// + public partial interface ITokensOperations + { + /// + /// Gets the properties of the specified token. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a token for a container registry with the specified + /// parameters. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for creating a token. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a token from a container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a token with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for updating a token. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the tokens for the specified container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a token for a container registry with the specified + /// parameters. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for creating a token. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a token from a container registry. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a token with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry + /// belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for updating a token. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the tokens for the specified container registry. + /// + /// + /// 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 + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsParameters.cs new file mode 100644 index 000000000000..5a9f7fb746f4 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsParameters.cs @@ -0,0 +1,78 @@ +// +// 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.ContainerRegistry.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The parameters used to generate credentials for a specified token or + /// user of a container registry. + /// + public partial class GenerateCredentialsParameters + { + /// + /// Initializes a new instance of the GenerateCredentialsParameters + /// class. + /// + public GenerateCredentialsParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenerateCredentialsParameters + /// class. + /// + /// The resource ID of the token for which + /// credentials have to be generated. + /// The expiry date of the generated credentials + /// after which the credentials become invalid. + /// Specifies name of the password which should be + /// regenerated if any -- password or password2. Possible values + /// include: 'password1', 'password2' + public GenerateCredentialsParameters(string tokenId = default(string), System.DateTime? expiry = default(System.DateTime?), string name = default(string)) + { + TokenId = tokenId; + Expiry = expiry; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource ID of the token for which credentials + /// have to be generated. + /// + [JsonProperty(PropertyName = "tokenId")] + public string TokenId { get; set; } + + /// + /// Gets or sets the expiry date of the generated credentials after + /// which the credentials become invalid. + /// + [JsonProperty(PropertyName = "expiry")] + public System.DateTime? Expiry { get; set; } + + /// + /// Gets or sets specifies name of the password which should be + /// regenerated if any -- password or password2. Possible values + /// include: 'password1', 'password2' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsResult.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsResult.cs new file mode 100644 index 000000000000..054a3ea3eabd --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/GenerateCredentialsResult.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.ContainerRegistry.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The response from the GenerateCredentials operation. + /// + public partial class GenerateCredentialsResult + { + /// + /// Initializes a new instance of the GenerateCredentialsResult class. + /// + public GenerateCredentialsResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GenerateCredentialsResult class. + /// + /// The username for a container + /// registry. + /// The list of passwords for a container + /// registry. + public GenerateCredentialsResult(string username = default(string), IList passwords = default(IList)) + { + Username = username; + Passwords = passwords; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the username for a container registry. + /// + [JsonProperty(PropertyName = "username")] + public string Username { get; set; } + + /// + /// Gets or sets the list of passwords for a container registry. + /// + [JsonProperty(PropertyName = "passwords")] + public IList Passwords { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationServiceSpecificationDefinition.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationServiceSpecificationDefinition.cs index fd6a6d21b2cd..b38c70091a26 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationServiceSpecificationDefinition.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/OperationServiceSpecificationDefinition.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models using System.Linq; /// - /// The definition of Azure Monitoring metrics list. + /// The definition of Azure Monitoring list. /// public partial class OperationServiceSpecificationDefinition { diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Registry.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Registry.cs index 49d723eea4d7..945796749110 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Registry.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Registry.cs @@ -59,7 +59,7 @@ public Registry() /// registry. /// The policies for a container /// registry. - public Registry(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string loginServer = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), Status status = default(Status), bool? adminUserEnabled = default(bool?), StorageAccountProperties storageAccount = default(StorageAccountProperties), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), Policies policies = default(Policies)) + public Registry(string location, Sku sku, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string loginServer = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), Status1 status = default(Status1), bool? adminUserEnabled = default(bool?), StorageAccountProperties storageAccount = default(StorageAccountProperties), NetworkRuleSet networkRuleSet = default(NetworkRuleSet), Policies policies = default(Policies)) : base(location, id, name, type, tags) { Sku = sku; @@ -110,7 +110,7 @@ public Registry() /// was called. /// [JsonProperty(PropertyName = "properties.status")] - public Status Status { get; private set; } + public Status1 Status { get; private set; } /// /// Gets or sets the value that indicates whether the admin user is diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Replication.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Replication.cs index 09cca0fdaf99..974768be0afd 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Replication.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Replication.cs @@ -46,7 +46,7 @@ public Replication() /// 'Canceled' /// The status of the replication at the time the /// operation was called. - public Replication(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), Status status = default(Status)) + public Replication(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), Status1 status = default(Status1)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; @@ -72,7 +72,7 @@ public Replication() /// called. /// [JsonProperty(PropertyName = "properties.status")] - public Status Status { get; private set; } + public Status1 Status { get; private set; } /// /// Validate the object. diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RetentionPolicy.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RetentionPolicy.cs index 3d10bdffaa32..5e3f5459d802 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RetentionPolicy.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/RetentionPolicy.cs @@ -29,8 +29,8 @@ public RetentionPolicy() /// /// Initializes a new instance of the RetentionPolicy class. /// - /// The number of days to retain manifest before it - /// expires. + /// The number of days to retain an untagged + /// manifest after which it gets purged. /// The timestamp when the policy was /// last updated. /// The value that indicates whether the policy is @@ -50,8 +50,8 @@ public RetentionPolicy() partial void CustomInit(); /// - /// Gets or sets the number of days to retain manifest before it - /// expires. + /// Gets or sets the number of days to retain an untagged manifest + /// after which it gets purged. /// [JsonProperty(PropertyName = "days")] public int? Days { get; set; } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMap.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMap.cs new file mode 100644 index 000000000000..9e642969f3b0 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMap.cs @@ -0,0 +1,116 @@ +// +// 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.ContainerRegistry.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An object that represents a scope map for a container registry. + /// + [Rest.Serialization.JsonTransformation] + public partial class ScopeMap : ProxyResource + { + /// + /// Initializes a new instance of the ScopeMap class. + /// + public ScopeMap() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScopeMap class. + /// + /// The list of scoped permissions for registry + /// artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The user friendly description of the + /// scope map. + /// The type of the scope map. E.g. BuildIn + /// scope map. + /// The creation date of scope map. + /// Provisioning state of the resource. + /// Possible values include: 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Failed', 'Canceled' + public ScopeMap(IList actions, string id = default(string), string name = default(string), string type = default(string), string description = default(string), string scopeMapType = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string)) + : base(id, name, type) + { + Description = description; + ScopeMapType = scopeMapType; + CreationDate = creationDate; + ProvisioningState = provisioningState; + Actions = actions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the user friendly description of the scope map. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets the type of the scope map. E.g. BuildIn scope map. + /// + [JsonProperty(PropertyName = "properties.type")] + public string ScopeMapType { get; private set; } + + /// + /// Gets the creation date of scope map. + /// + [JsonProperty(PropertyName = "properties.creationDate")] + public System.DateTime? CreationDate { get; private set; } + + /// + /// Gets provisioning state of the resource. Possible values include: + /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + /// 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + [JsonProperty(PropertyName = "properties.actions")] + public IList Actions { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Actions == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Actions"); + } + } + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMapUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMapUpdateParameters.cs new file mode 100644 index 000000000000..da1b18ca66b1 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/ScopeMapUpdateParameters.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.ContainerRegistry.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties for updating the scope map. + /// + [Rest.Serialization.JsonTransformation] + public partial class ScopeMapUpdateParameters + { + /// + /// Initializes a new instance of the ScopeMapUpdateParameters class. + /// + public ScopeMapUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScopeMapUpdateParameters class. + /// + /// The user friendly description of the + /// scope map. + /// The list of scope permissions for registry + /// artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + public ScopeMapUpdateParameters(string description = default(string), IList actions = default(IList)) + { + Description = description; + Actions = actions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the user friendly description of the scope map. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + [JsonProperty(PropertyName = "properties.actions")] + public IList Actions { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Status.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Status.cs index 41032fd63519..895cf1073cf2 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Status.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Status.cs @@ -10,62 +10,13 @@ namespace Microsoft.Azure.Management.ContainerRegistry.Models { - using Newtonsoft.Json; - using System.Linq; /// - /// The status of an Azure resource at the time the operation was called. + /// Defines values for Status. /// - public partial class Status + public static class Status { - /// - /// Initializes a new instance of the Status class. - /// - public Status() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Status class. - /// - /// The short label for the status. - /// The detailed message for the status, - /// including alerts and error messages. - /// The timestamp when the status was changed - /// to the current value. - public Status(string displayStatus = default(string), string message = default(string), System.DateTime? timestamp = default(System.DateTime?)) - { - DisplayStatus = displayStatus; - Message = message; - Timestamp = timestamp; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the short label for the status. - /// - [JsonProperty(PropertyName = "displayStatus")] - public string DisplayStatus { get; private set; } - - /// - /// Gets the detailed message for the status, including alerts and - /// error messages. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the timestamp when the status was changed to the current - /// value. - /// - [JsonProperty(PropertyName = "timestamp")] - public System.DateTime? Timestamp { get; private set; } - + public const string Enabled = "enabled"; + public const string Disabled = "disabled"; } } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Status1.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Status1.cs new file mode 100644 index 000000000000..3035c46f3cc6 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Status1.cs @@ -0,0 +1,71 @@ +// +// 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.ContainerRegistry.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The status of an Azure resource at the time the operation was called. + /// + public partial class Status1 + { + /// + /// Initializes a new instance of the Status1 class. + /// + public Status1() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Status1 class. + /// + /// The short label for the status. + /// The detailed message for the status, + /// including alerts and error messages. + /// The timestamp when the status was changed + /// to the current value. + public Status1(string displayStatus = default(string), string message = default(string), System.DateTime? timestamp = default(System.DateTime?)) + { + DisplayStatus = displayStatus; + Message = message; + Timestamp = timestamp; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the short label for the status. + /// + [JsonProperty(PropertyName = "displayStatus")] + public string DisplayStatus { get; private set; } + + /// + /// Gets the detailed message for the status, including alerts and + /// error messages. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the timestamp when the status was changed to the current + /// value. + /// + [JsonProperty(PropertyName = "timestamp")] + public System.DateTime? Timestamp { get; private set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Token.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Token.cs new file mode 100644 index 000000000000..941327d5cc1e --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/Token.cs @@ -0,0 +1,110 @@ +// +// 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.ContainerRegistry.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An object that represents a token for a container registry. + /// + [Rest.Serialization.JsonTransformation] + public partial class Token : ProxyResource + { + /// + /// Initializes a new instance of the Token class. + /// + public Token() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Token class. + /// + /// The resource ID. + /// The name of the resource. + /// The type of the resource. + /// The creation date of scope map. + /// Provisioning state of the resource. + /// Possible values include: 'Creating', 'Updating', 'Deleting', + /// 'Succeeded', 'Failed', 'Canceled' + /// The resource ID of the scope map to which + /// the token will be associated with. + /// The user/group/application object ID for + /// which the token has to be created. + /// The credentials that can be used for + /// authenticating the token. + /// The status of the token example enabled or + /// disabled. Possible values include: 'enabled', 'disabled' + public Token(string id = default(string), string name = default(string), string type = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), string scopeMapId = default(string), string objectId = default(string), TokenCredentialsProperties credentials = default(TokenCredentialsProperties), string status = default(string)) + : base(id, name, type) + { + CreationDate = creationDate; + ProvisioningState = provisioningState; + ScopeMapId = scopeMapId; + ObjectId = objectId; + Credentials = credentials; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the creation date of scope map. + /// + [JsonProperty(PropertyName = "properties.creationDate")] + public System.DateTime? CreationDate { get; private set; } + + /// + /// Gets provisioning state of the resource. Possible values include: + /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', + /// 'Canceled' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the resource ID of the scope map to which the token + /// will be associated with. + /// + [JsonProperty(PropertyName = "properties.scopeMapId")] + public string ScopeMapId { get; set; } + + /// + /// Gets or sets the user/group/application object ID for which the + /// token has to be created. + /// + [JsonProperty(PropertyName = "properties.objectId")] + public string ObjectId { get; set; } + + /// + /// Gets or sets the credentials that can be used for authenticating + /// the token. + /// + [JsonProperty(PropertyName = "properties.credentials")] + public TokenCredentialsProperties Credentials { get; set; } + + /// + /// Gets or sets the status of the token example enabled or disabled. + /// Possible values include: 'enabled', 'disabled' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificate.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificate.cs new file mode 100644 index 000000000000..58d68a397323 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificate.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.ContainerRegistry.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The properties of a certificate used for authenticating a token. + /// + public partial class TokenCertificate + { + /// + /// Initializes a new instance of the TokenCertificate class. + /// + public TokenCertificate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TokenCertificate class. + /// + /// Possible values include: 'certificate1', + /// 'certificate2' + /// The expiry datetime of the + /// certificate. + /// The thumbprint of the certificate. + /// Base 64 encoded string of the + /// public certificate1 in PEM format that will be used for + /// authenticating the token. + public TokenCertificate(string name = default(string), System.DateTime? expiry = default(System.DateTime?), string thumbprint = default(string), string encodedPemCertificate = default(string)) + { + Name = name; + Expiry = expiry; + Thumbprint = thumbprint; + EncodedPemCertificate = encodedPemCertificate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'certificate1', + /// 'certificate2' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the expiry datetime of the certificate. + /// + [JsonProperty(PropertyName = "expiry")] + public System.DateTime? Expiry { get; set; } + + /// + /// Gets or sets the thumbprint of the certificate. + /// + [JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint { get; set; } + + /// + /// Gets or sets base 64 encoded string of the public certificate1 in + /// PEM format that will be used for authenticating the token. + /// + [JsonProperty(PropertyName = "encodedPemCertificate")] + public string EncodedPemCertificate { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificateName.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificateName.cs new file mode 100644 index 000000000000..a975121ef70d --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCertificateName.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.ContainerRegistry.Models +{ + + /// + /// Defines values for TokenCertificateName. + /// + public static class TokenCertificateName + { + public const string Certificate1 = "certificate1"; + public const string Certificate2 = "certificate2"; + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCredentialsProperties.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCredentialsProperties.cs new file mode 100644 index 000000000000..c87fbb8cb1e8 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenCredentialsProperties.cs @@ -0,0 +1,58 @@ +// +// 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.ContainerRegistry.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The properties of the credentials that can be used for authenticating + /// the token. + /// + public partial class TokenCredentialsProperties + { + /// + /// Initializes a new instance of the TokenCredentialsProperties class. + /// + public TokenCredentialsProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TokenCredentialsProperties class. + /// + public TokenCredentialsProperties(IList certificates = default(IList), IList passwords = default(IList)) + { + Certificates = certificates; + Passwords = passwords; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "certificates")] + public IList Certificates { get; set; } + + /// + /// + [JsonProperty(PropertyName = "passwords")] + public IList Passwords { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPassword.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPassword.cs new file mode 100644 index 000000000000..a5ec57bd6d3f --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPassword.cs @@ -0,0 +1,79 @@ +// +// 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.ContainerRegistry.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The password that will be used for authenticating the token of a + /// container registry. + /// + public partial class TokenPassword + { + /// + /// Initializes a new instance of the TokenPassword class. + /// + public TokenPassword() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TokenPassword class. + /// + /// The creation datetime of the + /// password. + /// The expiry datetime of the password. + /// The password name "password" or "password2". + /// Possible values include: 'password1', 'password2' + /// The password value. + public TokenPassword(System.DateTime? creationTime = default(System.DateTime?), System.DateTime? expiry = default(System.DateTime?), string name = default(string), string value = default(string)) + { + CreationTime = creationTime; + Expiry = expiry; + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the creation datetime of the password. + /// + [JsonProperty(PropertyName = "creationTime")] + public System.DateTime? CreationTime { get; set; } + + /// + /// Gets or sets the expiry datetime of the password. + /// + [JsonProperty(PropertyName = "expiry")] + public System.DateTime? Expiry { get; set; } + + /// + /// Gets or sets the password name "password" or "password2". Possible + /// values include: 'password1', 'password2' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets the password value. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPasswordName.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPasswordName.cs new file mode 100644 index 000000000000..78d44e77dc4d --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenPasswordName.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.ContainerRegistry.Models +{ + + /// + /// Defines values for TokenPasswordName. + /// + public static class TokenPasswordName + { + public const string Password1 = "password1"; + public const string Password2 = "password2"; + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenStatus.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenStatus.cs new file mode 100644 index 000000000000..66e28887889e --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenStatus.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.ContainerRegistry.Models +{ + + /// + /// Defines values for TokenStatus. + /// + public static class TokenStatus + { + public const string Enabled = "enabled"; + public const string Disabled = "disabled"; + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenUpdateParameters.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenUpdateParameters.cs new file mode 100644 index 000000000000..d79f50445396 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/Models/TokenUpdateParameters.cs @@ -0,0 +1,76 @@ +// +// 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.ContainerRegistry.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The parameters for updating a token. + /// + [Rest.Serialization.JsonTransformation] + public partial class TokenUpdateParameters + { + /// + /// Initializes a new instance of the TokenUpdateParameters class. + /// + public TokenUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TokenUpdateParameters class. + /// + /// The resource ID of the scope map to which + /// the token will be associated with. + /// The status of the token example enabled or + /// disabled. Possible values include: 'enabled', 'disabled' + /// The credentials that can be used for + /// authenticating the token. + public TokenUpdateParameters(string scopeMapId = default(string), string status = default(string), TokenCredentialsProperties credentials = default(TokenCredentialsProperties)) + { + ScopeMapId = scopeMapId; + Status = status; + Credentials = credentials; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource ID of the scope map to which the token + /// will be associated with. + /// + [JsonProperty(PropertyName = "properties.scopeMapId")] + public string ScopeMapId { get; set; } + + /// + /// Gets or sets the status of the token example enabled or disabled. + /// Possible values include: 'enabled', 'disabled' + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; set; } + + /// + /// Gets or sets the credentials that can be used for authenticating + /// the token. + /// + [JsonProperty(PropertyName = "properties.credentials")] + public TokenCredentialsProperties Credentials { get; set; } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs index c0a558dd88c0..8d91323a4ddf 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperations.cs @@ -1848,6 +1848,31 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) return _result; } + /// + /// Generate keys for a token of a specified container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for generating credentials. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> GenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Copies an image to this container registry from the specified container /// registry. @@ -2989,6 +3014,236 @@ internal RegistriesOperations(ContainerRegistryManagementClient client) return _result; } + /// + /// Generate keys for a token of a specified container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for generating credentials. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginGenerateCredentialsWithHttpMessagesAsync(string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (generateCredentialsParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "generateCredentialsParameters"); + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("generateCredentialsParameters", generateCredentialsParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginGenerateCredentials", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/generateCredentials").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(generateCredentialsParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(generateCredentialsParameters, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 all the container registries under the specified resource group. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs index f9e010d7e7fe..0ccdac3dfc8b 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/RegistriesOperationsExtensions.cs @@ -554,6 +554,52 @@ public static SourceUploadDefinition GetBuildSourceUploadUrl(this IRegistriesOpe } } + /// + /// Generate keys for a token of a specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for generating credentials. + /// + public static GenerateCredentialsResult GenerateCredentials(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters) + { + return operations.GenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters).GetAwaiter().GetResult(); + } + + /// + /// Generate keys for a token of a specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for generating credentials. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GenerateCredentialsAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Copies an image to this container registry from the specified container /// registry. @@ -778,6 +824,52 @@ public static Run BeginScheduleRun(this IRegistriesOperations operations, string } } + /// + /// Generate keys for a token of a specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for generating credentials. + /// + public static GenerateCredentialsResult BeginGenerateCredentials(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters) + { + return operations.BeginGenerateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters).GetAwaiter().GetResult(); + } + + /// + /// Generate keys for a token of a specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The parameters for generating credentials. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginGenerateCredentialsAsync(this IRegistriesOperations operations, string resourceGroupName, string registryName, GenerateCredentialsParameters generateCredentialsParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginGenerateCredentialsWithHttpMessagesAsync(resourceGroupName, registryName, generateCredentialsParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists all the container registries under the specified resource group. /// diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperations.cs new file mode 100644 index 000000000000..4a0e0b6ddd9f --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperations.cs @@ -0,0 +1,1554 @@ +// +// 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.ContainerRegistry +{ + 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; + + /// + /// ScopeMapsOperations operations. + /// + internal partial class ScopeMapsOperations : IServiceOperations, IScopeMapsOperations + { + /// + /// Initializes a new instance of the ScopeMapsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ScopeMapsOperations(ContainerRegistryManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ContainerRegistryManagementClient + /// + public ContainerRegistryManagementClient Client { get; private set; } + + /// + /// Gets the properties of the specified scope map. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (scopeMapName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); + } + if (scopeMapName != null) + { + if (scopeMapName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); + } + if (scopeMapName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-]*$"); + } + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("scopeMapName", scopeMapName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates a scope map for a container registry with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, actions, description, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a scope map from a container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a scope map with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, description, actions, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the scope maps for the specified container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates a scope map for a container registry with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (scopeMapName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); + } + if (scopeMapName != null) + { + if (scopeMapName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); + } + if (scopeMapName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-]*$"); + } + } + if (actions == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "actions"); + } + string apiVersion = "2019-05-01-preview"; + ScopeMap scopeMapCreateParameters = new ScopeMap(); + if (description != null || actions != null) + { + scopeMapCreateParameters.Description = description; + scopeMapCreateParameters.Actions = actions; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("scopeMapName", scopeMapName); + tracingParameters.Add("scopeMapCreateParameters", scopeMapCreateParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(scopeMapCreateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(scopeMapCreateParameters, 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 != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _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; + } + + /// + /// Deletes a scope map from a container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (scopeMapName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); + } + if (scopeMapName != null) + { + if (scopeMapName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); + } + if (scopeMapName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-]*$"); + } + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("scopeMapName", scopeMapName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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("DELETE"); + _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 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a scope map with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// 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 System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (scopeMapName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scopeMapName"); + } + if (scopeMapName != null) + { + if (scopeMapName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "scopeMapName", 50); + } + if (scopeMapName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "scopeMapName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(scopeMapName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "scopeMapName", "^[a-zA-Z0-9-]*$"); + } + } + string apiVersion = "2019-05-01-preview"; + ScopeMapUpdateParameters scopeMapUpdateParameters = new ScopeMapUpdateParameters(); + if (description != null || actions != null) + { + scopeMapUpdateParameters.Description = description; + scopeMapUpdateParameters.Actions = actions; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("scopeMapName", scopeMapName); + tracingParameters.Add("scopeMapUpdateParameters", scopeMapUpdateParameters); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{scopeMapName}", System.Uri.EscapeDataString(scopeMapName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(scopeMapUpdateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(scopeMapUpdateParameters, 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 != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _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 all the scope maps for the specified container registry. + /// + /// + /// 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 System.Threading.Tasks.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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperationsExtensions.cs new file mode 100644 index 000000000000..b16e7809db5f --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/ScopeMapsOperationsExtensions.cs @@ -0,0 +1,480 @@ +// +// 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.ContainerRegistry +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + + /// + /// Extension methods for ScopeMapsOperations. + /// + public static partial class ScopeMapsOperationsExtensions + { + /// + /// Gets the properties of the specified scope map. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + public static ScopeMap Get(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) + { + return operations.GetAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the specified scope map. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a scope map for a container registry with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The user friendly description of the scope map. + /// + public static ScopeMap Create(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string)) + { + return operations.CreateAsync(resourceGroupName, registryName, scopeMapName, actions, description).GetAwaiter().GetResult(); + } + + /// + /// Creates a scope map for a container registry with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, actions, description, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a scope map from a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + public static void Delete(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) + { + operations.DeleteAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a scope map from a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a scope map with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + public static ScopeMap Update(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList)) + { + return operations.UpdateAsync(resourceGroupName, registryName, scopeMapName, description, actions).GetAwaiter().GetResult(); + } + + /// + /// Updates a scope map with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, description, actions, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the scope maps for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + public static IPage List(this IScopeMapsOperations operations, string resourceGroupName, string registryName) + { + return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the scope maps for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a scope map for a container registry with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The user friendly description of the scope map. + /// + public static ScopeMap BeginCreate(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string)) + { + return operations.BeginCreateAsync(resourceGroupName, registryName, scopeMapName, actions, description).GetAwaiter().GetResult(); + } + + /// + /// Creates a scope map for a container registry with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The list of scoped permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, IList actions, string description = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, actions, description, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a scope map from a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + public static void BeginDelete(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName) + { + operations.BeginDeleteAsync(resourceGroupName, registryName, scopeMapName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a scope map from a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a scope map with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + public static ScopeMap BeginUpdate(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList)) + { + return operations.BeginUpdateAsync(resourceGroupName, registryName, scopeMapName, description, actions).GetAwaiter().GetResult(); + } + + /// + /// Updates a scope map with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the scope map. + /// + /// + /// The user friendly description of the scope map. + /// + /// + /// The list of scope permissions for registry artifacts. + /// E.g. repositories/repository-name/pull, + /// repositories/repository-name/delete + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this IScopeMapsOperations operations, string resourceGroupName, string registryName, string scopeMapName, string description = default(string), IList actions = default(IList), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, scopeMapName, description, actions, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the scope maps for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IScopeMapsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the scope maps for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IScopeMapsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/SdkInfo_ContainerRegistryManagementClient.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/SdkInfo_ContainerRegistryManagementClient.cs index 3d8804e0c1f3..c3869abaf775 100644 --- a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/SdkInfo_ContainerRegistryManagementClient.cs +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/SdkInfo_ContainerRegistryManagementClient.cs @@ -21,10 +21,13 @@ public static IEnumerable> ApiInfo_ContainerRegist { new Tuple("ContainerRegistry", "Operations", "2019-05-01"), new Tuple("ContainerRegistry", "Registries", "2019-05-01"), + new Tuple("ContainerRegistry", "Registries", "2019-05-01-preview"), new Tuple("ContainerRegistry", "Registries", "2019-06-01-preview"), new Tuple("ContainerRegistry", "Replications", "2019-05-01"), new Tuple("ContainerRegistry", "Runs", "2019-06-01-preview"), + new Tuple("ContainerRegistry", "ScopeMaps", "2019-05-01-preview"), new Tuple("ContainerRegistry", "Tasks", "2019-06-01-preview"), + new Tuple("ContainerRegistry", "Tokens", "2019-05-01-preview"), new Tuple("ContainerRegistry", "Webhooks", "2019-05-01"), }.AsEnumerable(); } diff --git a/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperations.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperations.cs new file mode 100644 index 000000000000..02b13a6f7ee1 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperations.cs @@ -0,0 +1,1526 @@ +// +// 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.ContainerRegistry +{ + 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; + + /// + /// TokensOperations operations. + /// + internal partial class TokensOperations : IServiceOperations, ITokensOperations + { + /// + /// Initializes a new instance of the TokensOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TokensOperations(ContainerRegistryManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ContainerRegistryManagementClient + /// + public ContainerRegistryManagementClient Client { get; private set; } + + /// + /// Gets the properties of the specified token. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (tokenName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); + } + if (tokenName != null) + { + if (tokenName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); + } + if (tokenName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); + } + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("tokenName", tokenName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates a token for a container registry with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for creating a token. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a token from a container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates a token with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for updating a token. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists all the tokens for the specified container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// 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 System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string registryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Creates a token for a container registry with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for creating a token. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (tokenName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); + } + if (tokenName != null) + { + if (tokenName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); + } + if (tokenName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); + } + } + if (tokenCreateParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tokenCreateParameters"); + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("tokenName", tokenName); + tracingParameters.Add("tokenCreateParameters", tokenCreateParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(tokenCreateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tokenCreateParameters, 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 != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _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; + } + + /// + /// Deletes a token from a container registry. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (tokenName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); + } + if (tokenName != null) + { + if (tokenName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); + } + if (tokenName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); + } + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("tokenName", tokenName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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("DELETE"); + _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 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a token with the specified parameters. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for updating a token. + /// + /// + /// 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 System.Threading.Tasks.Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (registryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registryName"); + } + if (registryName != null) + { + if (registryName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "registryName", 50); + } + if (registryName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "registryName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(registryName, "^[a-zA-Z0-9]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "registryName", "^[a-zA-Z0-9]*$"); + } + } + if (tokenName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tokenName"); + } + if (tokenName != null) + { + if (tokenName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "tokenName", 50); + } + if (tokenName.Length < 5) + { + throw new ValidationException(ValidationRules.MinLength, "tokenName", 5); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(tokenName, "^[a-zA-Z0-9-]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "tokenName", "^[a-zA-Z0-9-]*$"); + } + } + if (tokenUpdateParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tokenUpdateParameters"); + } + string apiVersion = "2019-05-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("registryName", registryName); + tracingParameters.Add("tokenName", tokenName); + tracingParameters.Add("tokenUpdateParameters", tokenUpdateParameters); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{registryName}", System.Uri.EscapeDataString(registryName)); + _url = _url.Replace("{tokenName}", System.Uri.EscapeDataString(tokenName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(tokenUpdateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tokenUpdateParameters, 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 != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _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 all the tokens for the specified container registry. + /// + /// + /// 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 System.Threading.Tasks.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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperationsExtensions.cs b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperationsExtensions.cs new file mode 100644 index 000000000000..1624952dc581 --- /dev/null +++ b/sdk/containerregistry/Microsoft.Azure.Management.ContainerRegistry/src/Generated/TokensOperationsExtensions.cs @@ -0,0 +1,438 @@ +// +// 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.ContainerRegistry +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + + /// + /// Extension methods for TokensOperations. + /// + public static partial class TokensOperationsExtensions + { + /// + /// Gets the properties of the specified token. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + public static Token Get(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) + { + return operations.GetAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the specified token. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a token for a container registry with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for creating a token. + /// + public static Token Create(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters) + { + return operations.CreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a token for a container registry with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for creating a token. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a token from a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + public static void Delete(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) + { + operations.DeleteAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a token from a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a token with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for updating a token. + /// + public static Token Update(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters) + { + return operations.UpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a token with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for updating a token. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the tokens for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + public static IPage List(this ITokensOperations operations, string resourceGroupName, string registryName) + { + return operations.ListAsync(resourceGroupName, registryName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the tokens for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this ITokensOperations operations, string resourceGroupName, string registryName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, registryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a token for a container registry with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for creating a token. + /// + public static Token BeginCreate(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters) + { + return operations.BeginCreateAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a token for a container registry with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for creating a token. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginCreateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, Token tokenCreateParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a token from a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + public static void BeginDelete(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName) + { + operations.BeginDeleteAsync(resourceGroupName, registryName, tokenName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a token from a container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginDeleteAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates a token with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for updating a token. + /// + public static Token BeginUpdate(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters) + { + return operations.BeginUpdateAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a token with the specified parameters. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group to which the container registry belongs. + /// + /// + /// The name of the container registry. + /// + /// + /// The name of the token. + /// + /// + /// The parameters for updating a token. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginUpdateAsync(this ITokensOperations operations, string resourceGroupName, string registryName, string tokenName, TokenUpdateParameters tokenUpdateParameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all the tokens for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ITokensOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the tokens for the specified container registry. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this ITokensOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} From 13857505406b15e7439d0bacbb174dc1e4f1fc98 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2019 02:32:10 +0000 Subject: [PATCH 09/23] [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields --- .../Generated/Models/ManagedRuleDefinition.cs | 25 ++++++++++++++++++- .../src/Generated/Models/MatchCondition.cs | 5 ++-- .../src/Generated/Models/MatchVariable.cs | 1 + .../SdkInfo_FrontDoorManagementClient.cs | 11 -------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/ManagedRuleDefinition.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/ManagedRuleDefinition.cs index 81dc7e9d18ab..39e46fd6b729 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/ManagedRuleDefinition.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/ManagedRuleDefinition.cs @@ -30,11 +30,19 @@ public ManagedRuleDefinition() /// Initializes a new instance of the ManagedRuleDefinition class. /// /// Identifier for the managed rule. + /// Describes the default state for the + /// managed rule. Possible values include: 'Disabled', + /// 'Enabled' + /// Describes the default action to be + /// applied when the managed rule matches. Possible values include: + /// 'Allow', 'Block', 'Log', 'Redirect' /// Describes the functionality of the /// managed rule. - public ManagedRuleDefinition(string ruleId = default(string), string description = default(string)) + public ManagedRuleDefinition(string ruleId = default(string), string defaultState = default(string), string defaultAction = default(string), string description = default(string)) { RuleId = ruleId; + DefaultState = defaultState; + DefaultAction = defaultAction; Description = description; CustomInit(); } @@ -50,6 +58,21 @@ public ManagedRuleDefinition() [JsonProperty(PropertyName = "ruleId")] public string RuleId { get; private set; } + /// + /// Gets or sets describes the default state for the managed rule. + /// Possible values include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "defaultState")] + public string DefaultState { get; set; } + + /// + /// Gets or sets describes the default action to be applied when the + /// managed rule matches. Possible values include: 'Allow', 'Block', + /// 'Log', 'Redirect' + /// + [JsonProperty(PropertyName = "defaultAction")] + public string DefaultAction { get; set; } + /// /// Gets describes the functionality of the managed rule. /// diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/MatchCondition.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/MatchCondition.cs index 8936696e6c0b..453f38b18424 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/MatchCondition.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/MatchCondition.cs @@ -35,7 +35,7 @@ public MatchCondition() /// Request variable to compare with. /// Possible values include: 'RemoteAddr', 'RequestMethod', /// 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeader', - /// 'RequestBody', 'Cookies' + /// 'RequestBody', 'Cookies', 'SocketAddr' /// Comparison type to use for matching /// with the variable value. Possible values include: 'Any', 'IPMatch', /// 'GeoMatch', 'Equal', 'Contains', 'LessThan', 'GreaterThan', @@ -67,7 +67,8 @@ public MatchCondition() /// /// Gets or sets request variable to compare with. Possible values /// include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', - /// 'RequestUri', 'RequestHeader', 'RequestBody', 'Cookies' + /// 'RequestUri', 'RequestHeader', 'RequestBody', 'Cookies', + /// 'SocketAddr' /// [JsonProperty(PropertyName = "matchVariable")] public string MatchVariable { get; set; } diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/MatchVariable.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/MatchVariable.cs index c2b72181268f..3be7ab12788f 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/MatchVariable.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/MatchVariable.cs @@ -24,5 +24,6 @@ public static class MatchVariable public const string RequestHeader = "RequestHeader"; public const string RequestBody = "RequestBody"; public const string Cookies = "Cookies"; + public const string SocketAddr = "SocketAddr"; } } diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/SdkInfo_FrontDoorManagementClient.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/SdkInfo_FrontDoorManagementClient.cs index db24a5925aa0..bed136bbe781 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/SdkInfo_FrontDoorManagementClient.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/SdkInfo_FrontDoorManagementClient.cs @@ -33,16 +33,5 @@ public static IEnumerable> ApiInfo_FrontDoorManage }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/frontdoor/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\AFD\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "59c5761efb6dae1a0cfb624bc1a054e902a855cf"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - From 48786f1a072f05a93cc7992df9f0ca262c2477a5 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2019 02:36:25 +0000 Subject: [PATCH 10/23] [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change --- .../Generated/AzureReservationAPIClient.cs | 3 +- .../AzureReservationAPIClientExtensions.cs | 6 +- .../Generated/IAzureReservationAPIClient.cs | 4 +- .../Generated/IReservationOrderOperations.cs | 7 +- .../CalculatePriceResponseProperties.cs | 10 +- .../src/Generated/Models/Catalog.cs | 11 +- .../Models/CatalogBillingPlansItem.cs | 62 ++++++++++ .../src/Generated/Models/PaymentDetail.cs | 110 ++++++++++++++++++ .../src/Generated/Models/PaymentStatus.cs | 24 ++++ .../src/Generated/Models/Price.cs | 56 +++++++++ .../src/Generated/Models/PurchaseRequest.cs | 11 +- .../Models/ReservationBillingPlan.cs | 22 ++++ .../ReservationOrderBillingPlanInformation.cs | 87 ++++++++++++++ .../Models/ReservationOrderResponse.cs | 17 ++- .../Generated/Models/ReservationProperties.cs | 11 +- .../Generated/ReservationOrderOperations.cs | 14 ++- .../ReservationOrderOperationsExtensions.cs | 22 ++-- .../Generated/SdkInfo_AzureReservationAPI.cs | 11 -- 18 files changed, 454 insertions(+), 34 deletions(-) create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CatalogBillingPlansItem.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PaymentDetail.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PaymentStatus.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/Price.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationBillingPlan.cs create mode 100644 sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationOrderBillingPlanInformation.cs diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClient.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClient.cs index ac89f41d888b..c489108e8097 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClient.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClient.cs @@ -568,7 +568,8 @@ private void Initialize() /// Get list of applicable `Reservation`s. /// /// - /// Get applicable `Reservation`s that are applied to this subscription. + /// Get applicable `Reservation`s that are applied to this subscription or a + /// resource group under this subscription. /// /// /// Id of the subscription diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClientExtensions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClientExtensions.cs index 49b7052f78b2..c2db522acc3e 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClientExtensions.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/AzureReservationAPIClientExtensions.cs @@ -77,7 +77,8 @@ public static partial class AzureReservationAPIClientExtensions /// Get list of applicable `Reservation`s. /// /// - /// Get applicable `Reservation`s that are applied to this subscription. + /// Get applicable `Reservation`s that are applied to this subscription or a + /// resource group under this subscription. /// /// /// The operations group for this extension method. @@ -94,7 +95,8 @@ public static AppliedReservations GetAppliedReservationList(this IAzureReservati /// Get list of applicable `Reservation`s. /// /// - /// Get applicable `Reservation`s that are applied to this subscription. + /// Get applicable `Reservation`s that are applied to this subscription or a + /// resource group under this subscription. /// /// /// The operations group for this extension method. diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAzureReservationAPIClient.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAzureReservationAPIClient.cs index 13d1b104b195..38adaf5b4129 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAzureReservationAPIClient.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IAzureReservationAPIClient.cs @@ -109,8 +109,8 @@ public partial interface IAzureReservationAPIClient : System.IDisposable /// Get list of applicable `Reservation`s. /// /// - /// Get applicable `Reservation`s that are applied to this - /// subscription. + /// Get applicable `Reservation`s that are applied to this subscription + /// or a resource group under this subscription. /// /// /// Id of the subscription diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IReservationOrderOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IReservationOrderOperations.cs index 0167dcfe6c34..09095458fcab 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IReservationOrderOperations.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/IReservationOrderOperations.cs @@ -47,7 +47,7 @@ public partial interface IReservationOrderOperations /// /// Thrown when a required parameter is null /// - Task> CalculateWithHttpMessagesAsync(PurchaseRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CalculatePriceWithHttpMessagesAsync(PurchaseRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get all `ReservationOrder`s. /// @@ -109,6 +109,9 @@ public partial interface IReservationOrderOperations /// /// Order Id of the reservation /// + /// + /// May be used to expand the planInformation. + /// /// /// The headers that will be added to request. /// @@ -124,7 +127,7 @@ public partial interface IReservationOrderOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string reservationOrderId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string reservationOrderId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Purchase `ReservationOrder` /// diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CalculatePriceResponseProperties.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CalculatePriceResponseProperties.cs index b1d85159bb7b..eb8049c9485b 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CalculatePriceResponseProperties.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CalculatePriceResponseProperties.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.Reservations.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; public partial class CalculatePriceResponseProperties @@ -42,7 +44,7 @@ public CalculatePriceResponseProperties() /// Amount that Microsoft uses for /// record. Used during refund for calculating refund limit. Tax is not /// included. - public CalculatePriceResponseProperties(CalculatePriceResponsePropertiesBillingCurrencyTotal billingCurrencyTotal = default(CalculatePriceResponsePropertiesBillingCurrencyTotal), bool? isBillingPartnerManaged = default(bool?), string reservationOrderId = default(string), string skuTitle = default(string), string skuDescription = default(string), CalculatePriceResponsePropertiesPricingCurrencyTotal pricingCurrencyTotal = default(CalculatePriceResponsePropertiesPricingCurrencyTotal)) + public CalculatePriceResponseProperties(CalculatePriceResponsePropertiesBillingCurrencyTotal billingCurrencyTotal = default(CalculatePriceResponsePropertiesBillingCurrencyTotal), bool? isBillingPartnerManaged = default(bool?), string reservationOrderId = default(string), string skuTitle = default(string), string skuDescription = default(string), CalculatePriceResponsePropertiesPricingCurrencyTotal pricingCurrencyTotal = default(CalculatePriceResponsePropertiesPricingCurrencyTotal), IList paymentSchedule = default(IList)) { BillingCurrencyTotal = billingCurrencyTotal; IsBillingPartnerManaged = isBillingPartnerManaged; @@ -50,6 +52,7 @@ public CalculatePriceResponseProperties() SkuTitle = skuTitle; SkuDescription = skuDescription; PricingCurrencyTotal = pricingCurrencyTotal; + PaymentSchedule = paymentSchedule; CustomInit(); } @@ -98,5 +101,10 @@ public CalculatePriceResponseProperties() [JsonProperty(PropertyName = "pricingCurrencyTotal")] public CalculatePriceResponsePropertiesPricingCurrencyTotal PricingCurrencyTotal { get; set; } + /// + /// + [JsonProperty(PropertyName = "paymentSchedule")] + public IList PaymentSchedule { get; set; } + } } diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/Catalog.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/Catalog.cs index 09fedefd0c89..85a221e689de 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/Catalog.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/Catalog.cs @@ -31,12 +31,15 @@ public Catalog() /// The type of resource the SKU applies /// to. /// The name of SKU + /// The billing plan options available for + /// this SKU. /// Available reservation terms for this /// resource - public Catalog(string resourceType = default(string), string name = default(string), IList terms = default(IList), IList locations = default(IList), IList skuProperties = default(IList), IList restrictions = default(IList)) + public Catalog(string resourceType = default(string), string name = default(string), IList billingPlans = default(IList), IList terms = default(IList), IList locations = default(IList), IList skuProperties = default(IList), IList restrictions = default(IList)) { ResourceType = resourceType; Name = name; + BillingPlans = billingPlans; Terms = terms; Locations = locations; SkuProperties = skuProperties; @@ -61,6 +64,12 @@ public Catalog() [JsonProperty(PropertyName = "name")] public string Name { get; private set; } + /// + /// Gets or sets the billing plan options available for this SKU. + /// + [JsonProperty(PropertyName = "billingPlans")] + public IList BillingPlans { get; set; } + /// /// Gets available reservation terms for this resource /// diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CatalogBillingPlansItem.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CatalogBillingPlansItem.cs new file mode 100644 index 000000000000..38af1a1d0dcb --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/CatalogBillingPlansItem.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.Reservations.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class CatalogBillingPlansItem + { + /// + /// Initializes a new instance of the CatalogBillingPlansItem class. + /// + public CatalogBillingPlansItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CatalogBillingPlansItem class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// The term for the billing SKU is available for. + /// Possible values include: 'P1Y', 'P3Y' + public CatalogBillingPlansItem(IDictionary> additionalProperties = default(IDictionary>), string name = default(string)) + { + AdditionalProperties = additionalProperties; + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unmatched properties from the message are deserialized + /// this collection + /// + [JsonExtensionData] + public IDictionary> AdditionalProperties { get; set; } + + /// + /// Gets or sets the term for the billing SKU is available for. + /// Possible values include: 'P1Y', 'P3Y' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PaymentDetail.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PaymentDetail.cs new file mode 100644 index 000000000000..4a9ef974ad37 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PaymentDetail.cs @@ -0,0 +1,110 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information about payment related to a reservation order. + /// + public partial class PaymentDetail + { + /// + /// Initializes a new instance of the PaymentDetail class. + /// + public PaymentDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PaymentDetail class. + /// + /// Date when the payment needs to be + /// done. + /// Date when the transaction is completed. + /// Is null when it is scheduled. + /// Amount in pricing currency. Tax + /// not included. + /// Amount charged in Billing + /// currency. Tax not included. Is null for future payments + /// Shows the Account that is charged for + /// this payment. + /// Possible values include: 'Succeeded', + /// 'Failed', 'Scheduled', 'Cancelled' + public PaymentDetail(System.DateTime? dueDate = default(System.DateTime?), System.DateTime? paymentDate = default(System.DateTime?), Price pricingCurrencyTotal = default(Price), Price billingCurrencyTotal = default(Price), string billingAccount = default(string), string status = default(string), ExtendedStatusInfo extendedStatusInfo = default(ExtendedStatusInfo)) + { + DueDate = dueDate; + PaymentDate = paymentDate; + PricingCurrencyTotal = pricingCurrencyTotal; + BillingCurrencyTotal = billingCurrencyTotal; + BillingAccount = billingAccount; + Status = status; + ExtendedStatusInfo = extendedStatusInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets date when the payment needs to be done. + /// + [JsonConverter(typeof(DateJsonConverter))] + [JsonProperty(PropertyName = "dueDate")] + public System.DateTime? DueDate { get; set; } + + /// + /// Gets or sets date when the transaction is completed. Is null when + /// it is scheduled. + /// + [JsonConverter(typeof(DateJsonConverter))] + [JsonProperty(PropertyName = "paymentDate")] + public System.DateTime? PaymentDate { get; set; } + + /// + /// Gets or sets amount in pricing currency. Tax not included. + /// + [JsonProperty(PropertyName = "pricingCurrencyTotal")] + public Price PricingCurrencyTotal { get; set; } + + /// + /// Gets or sets amount charged in Billing currency. Tax not included. + /// Is null for future payments + /// + [JsonProperty(PropertyName = "billingCurrencyTotal")] + public Price BillingCurrencyTotal { get; set; } + + /// + /// Gets or sets shows the Account that is charged for this payment. + /// + [JsonProperty(PropertyName = "billingAccount")] + public string BillingAccount { get; set; } + + /// + /// Gets or sets possible values include: 'Succeeded', 'Failed', + /// 'Scheduled', 'Cancelled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// + [JsonProperty(PropertyName = "extendedStatusInfo")] + public ExtendedStatusInfo ExtendedStatusInfo { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PaymentStatus.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PaymentStatus.cs new file mode 100644 index 000000000000..e1b20c52b4d7 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PaymentStatus.cs @@ -0,0 +1,24 @@ +// +// 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.Reservations.Models +{ + + /// + /// Defines values for PaymentStatus. + /// + public static class PaymentStatus + { + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Scheduled = "Scheduled"; + public const string Cancelled = "Cancelled"; + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/Price.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/Price.cs new file mode 100644 index 000000000000..50caf0250d0c --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/Price.cs @@ -0,0 +1,56 @@ +// +// 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.Reservations.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class Price + { + /// + /// Initializes a new instance of the Price class. + /// + public Price() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Price class. + /// + /// The ISO 4217 3-letter currency code for + /// the currency used by this purchase record. + public Price(string currencyCode = default(string), double? amount = default(double?)) + { + CurrencyCode = currencyCode; + Amount = amount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ISO 4217 3-letter currency code for the currency + /// used by this purchase record. + /// + [JsonProperty(PropertyName = "currencyCode")] + public string CurrencyCode { get; set; } + + /// + /// + [JsonProperty(PropertyName = "amount")] + public double? Amount { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PurchaseRequest.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PurchaseRequest.cs index 7cbd2adc06c9..c45f7bead93c 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PurchaseRequest.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/PurchaseRequest.cs @@ -38,19 +38,22 @@ public PurchaseRequest() /// 'RedHat', 'SqlDataWarehouse', 'VMwareCloudSimple', /// 'RedHatOsa' /// Possible values include: 'P1Y', 'P3Y' + /// Possible values include: 'Upfront', + /// 'Monthly' /// Friendly name of the Reservation /// Possible values include: 'Single', /// 'Shared' /// Properties specific to /// each reserved resource type. Not required if not /// applicable. - public PurchaseRequest(SkuName sku = default(SkuName), string location = default(string), string reservedResourceType = default(string), string billingScopeId = default(string), string term = default(string), int? quantity = default(int?), string displayName = default(string), string appliedScopeType = default(string), IList appliedScopes = default(IList), bool? renew = default(bool?), PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties = default(PurchaseRequestPropertiesReservedResourceProperties)) + public PurchaseRequest(SkuName sku = default(SkuName), string location = default(string), string reservedResourceType = default(string), string billingScopeId = default(string), string term = default(string), string billingPlan = default(string), int? quantity = default(int?), string displayName = default(string), string appliedScopeType = default(string), IList appliedScopes = default(IList), bool? renew = default(bool?), PurchaseRequestPropertiesReservedResourceProperties reservedResourceProperties = default(PurchaseRequestPropertiesReservedResourceProperties)) { Sku = sku; Location = location; ReservedResourceType = reservedResourceType; BillingScopeId = billingScopeId; Term = term; + BillingPlan = billingPlan; Quantity = quantity; DisplayName = displayName; AppliedScopeType = appliedScopeType; @@ -95,6 +98,12 @@ public PurchaseRequest() [JsonProperty(PropertyName = "properties.term")] public string Term { get; set; } + /// + /// Gets or sets possible values include: 'Upfront', 'Monthly' + /// + [JsonProperty(PropertyName = "properties.billingPlan")] + public string BillingPlan { get; set; } + /// /// [JsonProperty(PropertyName = "properties.quantity")] diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationBillingPlan.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationBillingPlan.cs new file mode 100644 index 000000000000..e6040030cda5 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationBillingPlan.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.Reservations.Models +{ + + /// + /// Defines values for ReservationBillingPlan. + /// + public static class ReservationBillingPlan + { + public const string Upfront = "Upfront"; + public const string Monthly = "Monthly"; + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationOrderBillingPlanInformation.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationOrderBillingPlanInformation.cs new file mode 100644 index 000000000000..04bde4f417e1 --- /dev/null +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationOrderBillingPlanInformation.cs @@ -0,0 +1,87 @@ +// +// 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.Reservations.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Information describing the type of billing plan for this reservation. + /// + public partial class ReservationOrderBillingPlanInformation + { + /// + /// Initializes a new instance of the + /// ReservationOrderBillingPlanInformation class. + /// + public ReservationOrderBillingPlanInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ReservationOrderBillingPlanInformation class. + /// + /// Amount of money to be paid for + /// the Order. Tax is not included. + /// Date when the billing plan has + /// started. + /// For recurring billing plans, + /// indicates the date when next payment will be processed. Null when + /// total is paid off. + public ReservationOrderBillingPlanInformation(Price pricingCurrencyTotal = default(Price), System.DateTime? startDate = default(System.DateTime?), System.DateTime? nextPaymentDueDate = default(System.DateTime?), IList transactions = default(IList)) + { + PricingCurrencyTotal = pricingCurrencyTotal; + StartDate = startDate; + NextPaymentDueDate = nextPaymentDueDate; + Transactions = transactions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets amount of money to be paid for the Order. Tax is not + /// included. + /// + [JsonProperty(PropertyName = "pricingCurrencyTotal")] + public Price PricingCurrencyTotal { get; set; } + + /// + /// Gets or sets date when the billing plan has started. + /// + [JsonConverter(typeof(DateJsonConverter))] + [JsonProperty(PropertyName = "startDate")] + public System.DateTime? StartDate { get; set; } + + /// + /// Gets or sets for recurring billing plans, indicates the date when + /// next payment will be processed. Null when total is paid off. + /// + [JsonConverter(typeof(DateJsonConverter))] + [JsonProperty(PropertyName = "nextPaymentDueDate")] + public System.DateTime? NextPaymentDueDate { get; set; } + + /// + /// + [JsonProperty(PropertyName = "transactions")] + public IList Transactions { get; set; } + + } +} diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationOrderResponse.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationOrderResponse.cs index 494de3e7327f..444e190d96df 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationOrderResponse.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationOrderResponse.cs @@ -45,9 +45,11 @@ public ReservationOrderResponse() /// Possible values include: 'P1Y', 'P3Y' /// Current state of the /// reservation. + /// Possible values include: 'Upfront', + /// 'Monthly' /// Type of resource. /// "Microsoft.Capacity/reservations" - public ReservationOrderResponse(int? etag = default(int?), string id = default(string), string name = default(string), string displayName = default(string), System.DateTime? requestDateTime = default(System.DateTime?), System.DateTime? createdDateTime = default(System.DateTime?), System.DateTime? expiryDate = default(System.DateTime?), int? originalQuantity = default(int?), string term = default(string), string provisioningState = default(string), IList reservationsProperty = default(IList), string type = default(string)) + public ReservationOrderResponse(int? etag = default(int?), string id = default(string), string name = default(string), string displayName = default(string), System.DateTime? requestDateTime = default(System.DateTime?), System.DateTime? createdDateTime = default(System.DateTime?), System.DateTime? expiryDate = default(System.DateTime?), int? originalQuantity = default(int?), string term = default(string), string provisioningState = default(string), string billingPlan = default(string), ReservationOrderBillingPlanInformation planInformation = default(ReservationOrderBillingPlanInformation), IList reservationsProperty = default(IList), string type = default(string)) { Etag = etag; Id = id; @@ -59,6 +61,8 @@ public ReservationOrderResponse() OriginalQuantity = originalQuantity; Term = term; ProvisioningState = provisioningState; + BillingPlan = billingPlan; + PlanInformation = planInformation; ReservationsProperty = reservationsProperty; Type = type; CustomInit(); @@ -130,6 +134,17 @@ public ReservationOrderResponse() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; set; } + /// + /// Gets or sets possible values include: 'Upfront', 'Monthly' + /// + [JsonProperty(PropertyName = "properties.billingPlan")] + public string BillingPlan { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties.planInformation")] + public ReservationOrderBillingPlanInformation PlanInformation { get; set; } + /// /// [JsonProperty(PropertyName = "properties.reservations")] diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationProperties.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationProperties.cs index 555b5627814c..688e0f7ed4f9 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationProperties.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/Models/ReservationProperties.cs @@ -50,6 +50,8 @@ public ReservationProperties() /// expire. /// Description of the SKU in /// english. + /// Possible values include: 'Upfront', + /// 'Monthly' /// Reservation Id of the reservation from /// which this reservation is renewed. Format of the resource Id is /// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. @@ -57,7 +59,7 @@ public ReservationProperties() /// which is purchased because of renew. Format of the resource Id is /// /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}. /// Possible values include: 'P1Y', 'P3Y' - public ReservationProperties(string reservedResourceType = default(string), string instanceFlexibility = default(string), string displayName = default(string), IList appliedScopes = default(IList), string appliedScopeType = default(string), int? quantity = default(int?), string provisioningState = default(string), System.DateTime? effectiveDateTime = default(System.DateTime?), System.DateTime? lastUpdatedDateTime = default(System.DateTime?), System.DateTime? expiryDate = default(System.DateTime?), string skuDescription = default(string), ExtendedStatusInfo extendedStatusInfo = default(ExtendedStatusInfo), ReservationSplitProperties splitProperties = default(ReservationSplitProperties), ReservationMergeProperties mergeProperties = default(ReservationMergeProperties), string billingScopeId = default(string), bool? renew = default(bool?), string renewSource = default(string), string renewDestination = default(string), RenewPropertiesResponse renewProperties = default(RenewPropertiesResponse), string term = default(string)) + public ReservationProperties(string reservedResourceType = default(string), string instanceFlexibility = default(string), string displayName = default(string), IList appliedScopes = default(IList), string appliedScopeType = default(string), int? quantity = default(int?), string provisioningState = default(string), System.DateTime? effectiveDateTime = default(System.DateTime?), System.DateTime? lastUpdatedDateTime = default(System.DateTime?), System.DateTime? expiryDate = default(System.DateTime?), string skuDescription = default(string), ExtendedStatusInfo extendedStatusInfo = default(ExtendedStatusInfo), string billingPlan = default(string), ReservationSplitProperties splitProperties = default(ReservationSplitProperties), ReservationMergeProperties mergeProperties = default(ReservationMergeProperties), string billingScopeId = default(string), bool? renew = default(bool?), string renewSource = default(string), string renewDestination = default(string), RenewPropertiesResponse renewProperties = default(RenewPropertiesResponse), string term = default(string)) { ReservedResourceType = reservedResourceType; InstanceFlexibility = instanceFlexibility; @@ -71,6 +73,7 @@ public ReservationProperties() ExpiryDate = expiryDate; SkuDescription = skuDescription; ExtendedStatusInfo = extendedStatusInfo; + BillingPlan = billingPlan; SplitProperties = splitProperties; MergeProperties = mergeProperties; BillingScopeId = billingScopeId; @@ -161,6 +164,12 @@ public ReservationProperties() [JsonProperty(PropertyName = "extendedStatusInfo")] public ExtendedStatusInfo ExtendedStatusInfo { get; set; } + /// + /// Gets or sets possible values include: 'Upfront', 'Monthly' + /// + [JsonProperty(PropertyName = "billingPlan")] + public string BillingPlan { get; set; } + /// /// [JsonProperty(PropertyName = "splitProperties")] diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperations.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperations.cs index 0e4c1b59795c..12d8ae75c963 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperations.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperations.cs @@ -80,7 +80,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CalculateWithHttpMessagesAsync(PurchaseRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CalculatePriceWithHttpMessagesAsync(PurchaseRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -99,7 +99,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Calculate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CalculatePrice", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -441,6 +441,9 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) /// /// Order Id of the reservation /// + /// + /// May be used to expand the planInformation. + /// /// /// Headers that will be added to request. /// @@ -462,7 +465,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string reservationOrderId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string reservationOrderId, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (reservationOrderId == null) { @@ -480,6 +483,7 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("reservationOrderId", reservationOrderId); + tracingParameters.Add("expand", expand); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -492,6 +496,10 @@ internal ReservationOrderOperations(AzureReservationAPIClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperationsExtensions.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperationsExtensions.cs index c3388109e7de..8d51312c3280 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperationsExtensions.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/ReservationOrderOperationsExtensions.cs @@ -33,9 +33,9 @@ public static partial class ReservationOrderOperationsExtensions /// /// Information needed for calculate or purchase reservation /// - public static CalculatePriceResponse Calculate(this IReservationOrderOperations operations, PurchaseRequest body) + public static CalculatePriceResponse CalculatePrice(this IReservationOrderOperations operations, PurchaseRequest body) { - return operations.CalculateAsync(body).GetAwaiter().GetResult(); + return operations.CalculatePriceAsync(body).GetAwaiter().GetResult(); } /// @@ -53,9 +53,9 @@ public static CalculatePriceResponse Calculate(this IReservationOrderOperations /// /// The cancellation token. /// - public static async Task CalculateAsync(this IReservationOrderOperations operations, PurchaseRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CalculatePriceAsync(this IReservationOrderOperations operations, PurchaseRequest body, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CalculateWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CalculatePriceWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -155,9 +155,12 @@ public static ReservationOrderResponse Purchase(this IReservationOrderOperations /// /// Order Id of the reservation /// - public static ReservationOrderResponse Get(this IReservationOrderOperations operations, string reservationOrderId) + /// + /// May be used to expand the planInformation. + /// + public static ReservationOrderResponse Get(this IReservationOrderOperations operations, string reservationOrderId, string expand = default(string)) { - return operations.GetAsync(reservationOrderId).GetAwaiter().GetResult(); + return operations.GetAsync(reservationOrderId, expand).GetAwaiter().GetResult(); } /// @@ -172,12 +175,15 @@ public static ReservationOrderResponse Get(this IReservationOrderOperations oper /// /// Order Id of the reservation /// + /// + /// May be used to expand the planInformation. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IReservationOrderOperations operations, string reservationOrderId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IReservationOrderOperations operations, string reservationOrderId, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(reservationOrderId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(reservationOrderId, expand, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/SdkInfo_AzureReservationAPI.cs b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/SdkInfo_AzureReservationAPI.cs index 692c86e4194b..0d3ec05fb76b 100644 --- a/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/SdkInfo_AzureReservationAPI.cs +++ b/sdk/reservations/Microsoft.Azure.Management.Reservations/src/Generated/SdkInfo_AzureReservationAPI.cs @@ -27,16 +27,5 @@ public static IEnumerable> ApiInfo_AzureReservatio }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/reservations/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\rd\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "543e24fb91a603ac8395d767824ad6deddd1d20a"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - From f66a46bc848f841cd286080d36b958b82c03eae5 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2019 05:07:02 +0000 Subject: [PATCH 11/23] [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo --- .../src/Generated/Models/CommandProperties.cs | 1 - .../src/Generated/Models/ConnectionInfo.cs | 1 - .../src/Generated/Models/MigrationEligibilityInfo.cs | 12 ++++++------ .../src/Generated/Models/ProjectTaskProperties.cs | 1 - .../SdkInfo_DataMigrationManagementClient.cs | 11 ----------- 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/CommandProperties.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/CommandProperties.cs index 54ae9281bea1..90355f383357 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/CommandProperties.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/CommandProperties.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Management.DataMigration.Models /// Base class for all types of DMS command properties. If command is not /// supported by current client, this object is returned. /// - [Newtonsoft.Json.JsonObject("Unknown")] public partial class CommandProperties { /// diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectionInfo.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectionInfo.cs index 581ac23dbf30..3bd51dd50c37 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectionInfo.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ConnectionInfo.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataMigration.Models /// /// Defines the connection properties of a server /// - [Newtonsoft.Json.JsonObject("Unknown")] public partial class ConnectionInfo { /// diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/MigrationEligibilityInfo.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/MigrationEligibilityInfo.cs index 39d8ed1fbd1d..37e60ecf2b87 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/MigrationEligibilityInfo.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/MigrationEligibilityInfo.cs @@ -31,13 +31,13 @@ public MigrationEligibilityInfo() /// /// Initializes a new instance of the MigrationEligibilityInfo class. /// - /// Whether object is eligible - /// for migration or not. + /// Whether object is eligible for + /// migration or not. /// Information about eligibility /// failure for the server object. - public MigrationEligibilityInfo(bool? isEligibileForMigration = default(bool?), IList validationMessages = default(IList)) + public MigrationEligibilityInfo(bool? isEligibleForMigration = default(bool?), IList validationMessages = default(IList)) { - IsEligibileForMigration = isEligibileForMigration; + IsEligibleForMigration = isEligibleForMigration; ValidationMessages = validationMessages; CustomInit(); } @@ -50,8 +50,8 @@ public MigrationEligibilityInfo() /// /// Gets whether object is eligible for migration or not. /// - [JsonProperty(PropertyName = "isEligibileForMigration")] - public bool? IsEligibileForMigration { get; private set; } + [JsonProperty(PropertyName = "isEligibleForMigration")] + public bool? IsEligibleForMigration { get; private set; } /// /// Gets information about eligibility failure for the server object. diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ProjectTaskProperties.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ProjectTaskProperties.cs index f8378be9a3ea..ba0a714d4aa5 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ProjectTaskProperties.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/ProjectTaskProperties.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Management.DataMigration.Models /// Base class for all types of DMS task properties. If task is not /// supported by current client, this object is returned. /// - [Newtonsoft.Json.JsonObject("Unknown")] public partial class ProjectTaskProperties { /// diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/SdkInfo_DataMigrationManagementClient.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/SdkInfo_DataMigrationManagementClient.cs index ba72d06751d1..137ba383fd2c 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/SdkInfo_DataMigrationManagementClient.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/SdkInfo_DataMigrationManagementClient.cs @@ -30,16 +30,5 @@ public static IEnumerable> ApiInfo_DataMigrationMa }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datamigration/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\Dev\\Git\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "e9b03021559994e2988fd977d465685795c2f70d"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - From afe09645e985ac7e9734bbfe142e2f268a7cb4d8 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2019 17:26:27 +0000 Subject: [PATCH 12/23] [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path --- .../src/Generated/AgentPoolsOperations.cs | 456 +++++++++++++++++- .../AgentPoolsOperationsExtensions.cs | 100 ++++ .../Generated/ContainerServicesOperations.cs | 2 +- .../src/Generated/IAgentPoolsOperations.cs | 60 +++ .../Generated/ManagedClustersOperations.cs | 24 +- .../src/Generated/Models/AgentPool.cs | 45 +- .../Models/AgentPoolAvailableVersions.cs | 83 ++++ ...VersionsPropertiesAgentPoolVersionsItem.cs | 70 +++ .../Models/AgentPoolUpgradeProfile.cs | 120 +++++ ...oolUpgradeProfilePropertiesUpgradesItem.cs | 60 +++ .../Models/ContainerServiceNetworkProfile.cs | 15 +- .../src/Generated/Models/ManagedCluster.cs | 15 +- .../ManagedClusterAPIServerAccessProfile.cs | 66 +++ .../Models/ManagedClusterAgentPoolProfile.cs | 14 +- ...anagedClusterAgentPoolProfileProperties.cs | 45 +- .../ManagedClusterLoadBalancerProfile.cs | 100 ++++ ...erLoadBalancerProfileManagedOutboundIPs.cs | 75 +++ ...erLoadBalancerProfileOutboundIPPrefixes.cs | 56 +++ ...edClusterLoadBalancerProfileOutboundIPs.cs | 55 +++ .../src/Generated/Models/ResourceReference.cs | 51 ++ .../Models/ScaleSetEvictionPolicy.cs | 22 + .../src/Generated/Models/ScaleSetPriority.cs | 22 + .../src/Generated/Operations.cs | 2 +- .../SdkInfo_ContainerServiceClient.cs | 8 +- 24 files changed, 1531 insertions(+), 35 deletions(-) create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs create mode 100644 sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs index 50bf7e4b6b92..63687ae3488d 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperations.cs @@ -120,7 +120,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -557,6 +557,454 @@ internal AgentPoolsOperations(ContainerServiceClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Gets upgrade profile for an agent pool. + /// + /// + /// Gets the details of the upgrade profile for an agent pool with a specified + /// resource group and managed cluster name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> GetUpgradeProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + if (agentPoolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); + } + string apiVersion = "2019-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("agentPoolName", agentPoolName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUpgradeProfile", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{agentPoolName}", System.Uri.EscapeDataString(agentPoolName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 list of supported versions for the specified agent pool. + /// + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// 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> GetAvailableAgentPoolVersionsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + if (resourceName != null) + { + if (resourceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceName", 63); + } + if (resourceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceName, "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); + } + } + string apiVersion = "2019-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetAvailableAgentPoolVersions", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + /// /// Creates or updates an agent pool. /// @@ -644,7 +1092,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -894,7 +1342,7 @@ internal AgentPoolsOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "agentPoolName"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs index 333bc9802a1a..fac6394a3939 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/AgentPoolsOperationsExtensions.cs @@ -228,6 +228,106 @@ public static void Delete(this IAgentPoolsOperations operations, string resource (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Gets upgrade profile for an agent pool. + /// + /// + /// Gets the details of the upgrade profile for an agent pool with a specified + /// resource group and managed cluster name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + public static AgentPoolUpgradeProfile GetUpgradeProfile(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName) + { + return operations.GetUpgradeProfileAsync(resourceGroupName, resourceName, agentPoolName).GetAwaiter().GetResult(); + } + + /// + /// Gets upgrade profile for an agent pool. + /// + /// + /// Gets the details of the upgrade profile for an agent pool with a specified + /// resource group and managed cluster name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// The cancellation token. + /// + public static async Task GetUpgradeProfileAsync(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, string agentPoolName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUpgradeProfileWithHttpMessagesAsync(resourceGroupName, resourceName, agentPoolName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + public static AgentPoolAvailableVersions GetAvailableAgentPoolVersions(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName) + { + return operations.GetAvailableAgentPoolVersionsAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAvailableAgentPoolVersionsAsync(this IAgentPoolsOperations operations, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetAvailableAgentPoolVersionsWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates an agent pool. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs index b8ec9621329d..564aab684620 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ContainerServicesOperations.cs @@ -735,7 +735,7 @@ internal ContainerServicesOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs index fe31c66be91b..40bf792cb96b 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/IAgentPoolsOperations.cs @@ -148,6 +148,66 @@ public partial interface IAgentPoolsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets upgrade profile for an agent pool. + /// + /// + /// Gets the details of the upgrade profile for an agent pool with a + /// specified resource group and managed cluster name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// The name of the agent pool. + /// + /// + /// 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> GetUpgradeProfileWithHttpMessagesAsync(string resourceGroupName, string resourceName, string agentPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// Gets a list of supported versions for the specified agent pool. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the managed cluster resource. + /// + /// + /// 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> GetAvailableAgentPoolVersionsWithHttpMessagesAsync(string resourceGroupName, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates or updates an agent pool. /// /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs index b42496c1c241..f4c6fb41f833 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/ManagedClustersOperations.cs @@ -84,7 +84,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -278,7 +278,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -496,7 +496,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -723,7 +723,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "roleName"); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -945,7 +945,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1165,7 +1165,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1385,7 +1385,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1756,7 +1756,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2003,7 +2003,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; TagsObject parameters = new TagsObject(); if (tags != null) { @@ -2231,7 +2231,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) throw new ValidationException(ValidationRules.Pattern, "resourceName", "^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"); } } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2441,7 +2441,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2658,7 +2658,7 @@ internal ManagedClustersOperations(ContainerServiceClient client) { parameters.Validate(); } - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs index 62d800ddd453..17ca5dc61071 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPool.cs @@ -123,7 +123,17 @@ public AgentPool() /// provisioning state, which only appears in the response. /// (PREVIEW) Availability zones for /// nodes. Must use VirtualMachineScaleSets AgentPoolType. - public AgentPool(int count, string vmSize, string id = default(string), string name = default(string), string type = default(string), int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string agentPoolType = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList)) + /// Enable public IP for nodes + /// ScaleSetPriority to be used to + /// specify virtual machine scale set priority. Default to regular. + /// Possible values include: 'Low', 'Regular' + /// ScaleSetEvictionPolicy to be + /// used to specify eviction policy for low priority virtual machine + /// scale set. Default to Delete. Possible values include: 'Delete', + /// 'Deallocate' + /// Taints added to new nodes during node pool + /// create and scale. For example, key=value:NoSchedule. + public AgentPool(int count, string vmSize, string id = default(string), string name = default(string), string type = default(string), int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string agentPoolType = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList)) : base(id, name, type) { Count = count; @@ -139,6 +149,10 @@ public AgentPool() OrchestratorVersion = orchestratorVersion; ProvisioningState = provisioningState; AvailabilityZones = availabilityZones; + EnableNodePublicIP = enableNodePublicIP; + ScaleSetPriority = scaleSetPriority; + ScaleSetEvictionPolicy = scaleSetEvictionPolicy; + NodeTaints = nodeTaints; CustomInit(); } @@ -291,6 +305,35 @@ public AgentPool() [JsonProperty(PropertyName = "properties.availabilityZones")] public IList AvailabilityZones { get; set; } + /// + /// Gets or sets enable public IP for nodes + /// + [JsonProperty(PropertyName = "properties.enableNodePublicIP")] + public bool? EnableNodePublicIP { get; set; } + + /// + /// Gets or sets scaleSetPriority to be used to specify virtual machine + /// scale set priority. Default to regular. Possible values include: + /// 'Low', 'Regular' + /// + [JsonProperty(PropertyName = "properties.scaleSetPriority")] + public string ScaleSetPriority { get; set; } + + /// + /// Gets or sets scaleSetEvictionPolicy to be used to specify eviction + /// policy for low priority virtual machine scale set. Default to + /// Delete. Possible values include: 'Delete', 'Deallocate' + /// + [JsonProperty(PropertyName = "properties.scaleSetEvictionPolicy")] + public string ScaleSetEvictionPolicy { get; set; } + + /// + /// Gets or sets taints added to new nodes during node pool create and + /// scale. For example, key=value:NoSchedule. + /// + [JsonProperty(PropertyName = "properties.nodeTaints")] + public IList NodeTaints { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs new file mode 100644 index 000000000000..aef063574593 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersions.cs @@ -0,0 +1,83 @@ +// +// 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.ContainerService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The list of available versions for an agent pool. + /// + [Rest.Serialization.JsonTransformation] + public partial class AgentPoolAvailableVersions + { + /// + /// Initializes a new instance of the AgentPoolAvailableVersions class. + /// + public AgentPoolAvailableVersions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AgentPoolAvailableVersions class. + /// + /// Id of the agent pool available versions. + /// Name of the agent pool available + /// versions. + /// Type of the agent pool available + /// versions. + /// List of versions available for + /// agent pool. + public AgentPoolAvailableVersions(string id = default(string), string name = default(string), string type = default(string), IList agentPoolVersions = default(IList)) + { + Id = id; + Name = name; + Type = type; + AgentPoolVersions = agentPoolVersions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets id of the agent pool available versions. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets name of the agent pool available versions. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets type of the agent pool available versions. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets list of versions available for agent pool. + /// + [JsonProperty(PropertyName = "properties.agentPoolVersions")] + public IList AgentPoolVersions { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.cs new file mode 100644 index 000000000000..8642c1dbda4c --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem.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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem + { + /// + /// Initializes a new instance of the + /// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem class. + /// + public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem class. + /// + /// Whether this version is the default + /// agent pool version. + /// Kubernetes version (major, minor, + /// patch). + /// Whether Kubernetes version is currently in + /// preview. + public AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(bool? defaultProperty = default(bool?), string kubernetesVersion = default(string), bool? isPreview = default(bool?)) + { + DefaultProperty = defaultProperty; + KubernetesVersion = kubernetesVersion; + IsPreview = isPreview; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether this version is the default agent pool + /// version. + /// + [JsonProperty(PropertyName = "default")] + public bool? DefaultProperty { get; set; } + + /// + /// Gets or sets kubernetes version (major, minor, patch). + /// + [JsonProperty(PropertyName = "kubernetesVersion")] + public string KubernetesVersion { get; set; } + + /// + /// Gets or sets whether Kubernetes version is currently in preview. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs new file mode 100644 index 000000000000..7e876988de79 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfile.cs @@ -0,0 +1,120 @@ +// +// 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.ContainerService.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The list of available upgrades for an agent pool. + /// + [Rest.Serialization.JsonTransformation] + public partial class AgentPoolUpgradeProfile + { + /// + /// Initializes a new instance of the AgentPoolUpgradeProfile class. + /// + public AgentPoolUpgradeProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AgentPoolUpgradeProfile class. + /// + /// Kubernetes version (major, minor, + /// patch). + /// OsType to be used to specify os type. Choose + /// from Linux and Windows. Default to Linux. Possible values include: + /// 'Linux', 'Windows' + /// Id of the agent pool upgrade profile. + /// Name of the agent pool upgrade profile. + /// Type of the agent pool upgrade profile. + /// List of orchestrator types and versions + /// available for upgrade. + public AgentPoolUpgradeProfile(string kubernetesVersion, string osType, string id = default(string), string name = default(string), string type = default(string), IList upgrades = default(IList)) + { + Id = id; + Name = name; + Type = type; + KubernetesVersion = kubernetesVersion; + OsType = osType; + Upgrades = upgrades; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets id of the agent pool upgrade profile. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets name of the agent pool upgrade profile. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets type of the agent pool upgrade profile. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets kubernetes version (major, minor, patch). + /// + [JsonProperty(PropertyName = "properties.kubernetesVersion")] + public string KubernetesVersion { get; set; } + + /// + /// Gets or sets osType to be used to specify os type. Choose from + /// Linux and Windows. Default to Linux. Possible values include: + /// 'Linux', 'Windows' + /// + [JsonProperty(PropertyName = "properties.osType")] + public string OsType { get; set; } + + /// + /// Gets or sets list of orchestrator types and versions available for + /// upgrade. + /// + [JsonProperty(PropertyName = "properties.upgrades")] + public IList Upgrades { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (KubernetesVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KubernetesVersion"); + } + if (OsType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "OsType"); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs new file mode 100644 index 000000000000..e449e974e445 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/AgentPoolUpgradeProfilePropertiesUpgradesItem.cs @@ -0,0 +1,60 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AgentPoolUpgradeProfilePropertiesUpgradesItem + { + /// + /// Initializes a new instance of the + /// AgentPoolUpgradeProfilePropertiesUpgradesItem class. + /// + public AgentPoolUpgradeProfilePropertiesUpgradesItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AgentPoolUpgradeProfilePropertiesUpgradesItem class. + /// + /// Kubernetes version (major, minor, + /// patch). + /// Whether Kubernetes version is currently in + /// preview. + public AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion = default(string), bool? isPreview = default(bool?)) + { + KubernetesVersion = kubernetesVersion; + IsPreview = isPreview; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets kubernetes version (major, minor, patch). + /// + [JsonProperty(PropertyName = "kubernetesVersion")] + public string KubernetesVersion { get; set; } + + /// + /// Gets or sets whether Kubernetes version is currently in preview. + /// + [JsonProperty(PropertyName = "isPreview")] + public bool? IsPreview { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs index 311110d17c1a..0d1e3604982b 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ContainerServiceNetworkProfile.cs @@ -51,7 +51,9 @@ public ContainerServiceNetworkProfile() /// ranges or the Kubernetes service address range. /// The load balancer sku for the managed /// cluster. Possible values include: 'standard', 'basic' - public ContainerServiceNetworkProfile(string networkPlugin = default(string), string networkPolicy = default(string), string podCidr = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string), string loadBalancerSku = default(string)) + /// Profile of the cluster load + /// balancer. + public ContainerServiceNetworkProfile(string networkPlugin = default(string), string networkPolicy = default(string), string podCidr = default(string), string serviceCidr = default(string), string dnsServiceIP = default(string), string dockerBridgeCidr = default(string), string loadBalancerSku = default(string), ManagedClusterLoadBalancerProfile loadBalancerProfile = default(ManagedClusterLoadBalancerProfile)) { NetworkPlugin = networkPlugin; NetworkPolicy = networkPolicy; @@ -60,6 +62,7 @@ public ContainerServiceNetworkProfile() DnsServiceIP = dnsServiceIP; DockerBridgeCidr = dockerBridgeCidr; LoadBalancerSku = loadBalancerSku; + LoadBalancerProfile = loadBalancerProfile; CustomInit(); } @@ -119,6 +122,12 @@ public ContainerServiceNetworkProfile() [JsonProperty(PropertyName = "loadBalancerSku")] public string LoadBalancerSku { get; set; } + /// + /// Gets or sets profile of the cluster load balancer. + /// + [JsonProperty(PropertyName = "loadBalancerProfile")] + public ManagedClusterLoadBalancerProfile LoadBalancerProfile { get; set; } + /// /// Validate the object. /// @@ -155,6 +164,10 @@ public virtual void Validate() throw new ValidationException(ValidationRules.Pattern, "DockerBridgeCidr", "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\/([0-9]|[1-2][0-9]|3[0-2]))?$"); } } + if (LoadBalancerProfile != null) + { + LoadBalancerProfile.Validate(); + } } } } diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs index 7a4181186b42..7fa8fc43785a 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedCluster.cs @@ -69,11 +69,11 @@ public ManagedCluster() /// configuration. /// Profile of Azure Active Directory /// configuration. - /// (PREVIEW) Authorized IP - /// Ranges to kubernetes API server. + /// Access profile for managed + /// cluster API server. /// The identity of the managed cluster, if /// configured. - public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdn = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), IList apiServerAuthorizedIPRanges = default(IList), ManagedClusterIdentity identity = default(ManagedClusterIdentity)) + public ManagedCluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), int? maxAgentPools = default(int?), string kubernetesVersion = default(string), string dnsPrefix = default(string), string fqdn = default(string), IList agentPoolProfiles = default(IList), ContainerServiceLinuxProfile linuxProfile = default(ContainerServiceLinuxProfile), ManagedClusterWindowsProfile windowsProfile = default(ManagedClusterWindowsProfile), ManagedClusterServicePrincipalProfile servicePrincipalProfile = default(ManagedClusterServicePrincipalProfile), IDictionary addonProfiles = default(IDictionary), string nodeResourceGroup = default(string), bool? enableRBAC = default(bool?), bool? enablePodSecurityPolicy = default(bool?), ContainerServiceNetworkProfile networkProfile = default(ContainerServiceNetworkProfile), ManagedClusterAADProfile aadProfile = default(ManagedClusterAADProfile), ManagedClusterAPIServerAccessProfile apiServerAccessProfile = default(ManagedClusterAPIServerAccessProfile), ManagedClusterIdentity identity = default(ManagedClusterIdentity)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; @@ -91,7 +91,7 @@ public ManagedCluster() EnablePodSecurityPolicy = enablePodSecurityPolicy; NetworkProfile = networkProfile; AadProfile = aadProfile; - ApiServerAuthorizedIPRanges = apiServerAuthorizedIPRanges; + ApiServerAccessProfile = apiServerAccessProfile; Identity = identity; CustomInit(); } @@ -201,11 +201,10 @@ public ManagedCluster() public ManagedClusterAADProfile AadProfile { get; set; } /// - /// Gets or sets (PREVIEW) Authorized IP Ranges to kubernetes API - /// server. + /// Gets or sets access profile for managed cluster API server. /// - [JsonProperty(PropertyName = "properties.apiServerAuthorizedIPRanges")] - public IList ApiServerAuthorizedIPRanges { get; set; } + [JsonProperty(PropertyName = "properties.apiServerAccessProfile")] + public ManagedClusterAPIServerAccessProfile ApiServerAccessProfile { get; set; } /// /// Gets or sets the identity of the managed cluster, if configured. diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs new file mode 100644 index 000000000000..a950f33365d1 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAPIServerAccessProfile.cs @@ -0,0 +1,66 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Access profile for managed cluster API server. + /// + public partial class ManagedClusterAPIServerAccessProfile + { + /// + /// Initializes a new instance of the + /// ManagedClusterAPIServerAccessProfile class. + /// + public ManagedClusterAPIServerAccessProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterAPIServerAccessProfile class. + /// + /// Authorized IP Ranges to kubernetes + /// API server. + /// Whether to create the cluster as + /// a private cluster or not. + public ManagedClusterAPIServerAccessProfile(IList authorizedIPRanges = default(IList), bool? enablePrivateCluster = default(bool?)) + { + AuthorizedIPRanges = authorizedIPRanges; + EnablePrivateCluster = enablePrivateCluster; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets authorized IP Ranges to kubernetes API server. + /// + [JsonProperty(PropertyName = "authorizedIPRanges")] + public IList AuthorizedIPRanges { get; set; } + + /// + /// Gets or sets whether to create the cluster as a private cluster or + /// not. + /// + [JsonProperty(PropertyName = "enablePrivateCluster")] + public bool? EnablePrivateCluster { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs index 357545428fe3..107edfb3be3d 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfile.cs @@ -120,8 +120,18 @@ public ManagedClusterAgentPoolProfile() /// provisioning state, which only appears in the response. /// (PREVIEW) Availability zones for /// nodes. Must use VirtualMachineScaleSets AgentPoolType. - public ManagedClusterAgentPoolProfile(int count, string vmSize, string name, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList)) - : base(count, vmSize, osDiskSizeGB, vnetSubnetID, maxPods, osType, maxCount, minCount, enableAutoScaling, type, orchestratorVersion, provisioningState, availabilityZones) + /// Enable public IP for nodes + /// ScaleSetPriority to be used to + /// specify virtual machine scale set priority. Default to regular. + /// Possible values include: 'Low', 'Regular' + /// ScaleSetEvictionPolicy to be + /// used to specify eviction policy for low priority virtual machine + /// scale set. Default to Delete. Possible values include: 'Delete', + /// 'Deallocate' + /// Taints added to new nodes during node pool + /// create and scale. For example, key=value:NoSchedule. + public ManagedClusterAgentPoolProfile(int count, string vmSize, string name, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList)) + : base(count, vmSize, osDiskSizeGB, vnetSubnetID, maxPods, osType, maxCount, minCount, enableAutoScaling, type, orchestratorVersion, provisioningState, availabilityZones, enableNodePublicIP, scaleSetPriority, scaleSetEvictionPolicy, nodeTaints) { Name = name; CustomInit(); diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs index 6e86f0cc9df6..a99b90999b08 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterAgentPoolProfileProperties.cs @@ -118,7 +118,17 @@ public ManagedClusterAgentPoolProfileProperties() /// provisioning state, which only appears in the response. /// (PREVIEW) Availability zones for /// nodes. Must use VirtualMachineScaleSets AgentPoolType. - public ManagedClusterAgentPoolProfileProperties(int count, string vmSize, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList)) + /// Enable public IP for nodes + /// ScaleSetPriority to be used to + /// specify virtual machine scale set priority. Default to regular. + /// Possible values include: 'Low', 'Regular' + /// ScaleSetEvictionPolicy to be + /// used to specify eviction policy for low priority virtual machine + /// scale set. Default to Delete. Possible values include: 'Delete', + /// 'Deallocate' + /// Taints added to new nodes during node pool + /// create and scale. For example, key=value:NoSchedule. + public ManagedClusterAgentPoolProfileProperties(int count, string vmSize, int? osDiskSizeGB = default(int?), string vnetSubnetID = default(string), int? maxPods = default(int?), string osType = default(string), int? maxCount = default(int?), int? minCount = default(int?), bool? enableAutoScaling = default(bool?), string type = default(string), string orchestratorVersion = default(string), string provisioningState = default(string), IList availabilityZones = default(IList), bool? enableNodePublicIP = default(bool?), string scaleSetPriority = default(string), string scaleSetEvictionPolicy = default(string), IList nodeTaints = default(IList)) { Count = count; VmSize = vmSize; @@ -133,6 +143,10 @@ public ManagedClusterAgentPoolProfileProperties() OrchestratorVersion = orchestratorVersion; ProvisioningState = provisioningState; AvailabilityZones = availabilityZones; + EnableNodePublicIP = enableNodePublicIP; + ScaleSetPriority = scaleSetPriority; + ScaleSetEvictionPolicy = scaleSetEvictionPolicy; + NodeTaints = nodeTaints; CustomInit(); } @@ -285,6 +299,35 @@ public ManagedClusterAgentPoolProfileProperties() [JsonProperty(PropertyName = "availabilityZones")] public IList AvailabilityZones { get; set; } + /// + /// Gets or sets enable public IP for nodes + /// + [JsonProperty(PropertyName = "enableNodePublicIP")] + public bool? EnableNodePublicIP { get; set; } + + /// + /// Gets or sets scaleSetPriority to be used to specify virtual machine + /// scale set priority. Default to regular. Possible values include: + /// 'Low', 'Regular' + /// + [JsonProperty(PropertyName = "scaleSetPriority")] + public string ScaleSetPriority { get; set; } + + /// + /// Gets or sets scaleSetEvictionPolicy to be used to specify eviction + /// policy for low priority virtual machine scale set. Default to + /// Delete. Possible values include: 'Delete', 'Deallocate' + /// + [JsonProperty(PropertyName = "scaleSetEvictionPolicy")] + public string ScaleSetEvictionPolicy { get; set; } + + /// + /// Gets or sets taints added to new nodes during node pool create and + /// scale. For example, key=value:NoSchedule. + /// + [JsonProperty(PropertyName = "nodeTaints")] + public IList NodeTaints { get; set; } + /// /// Validate the object. /// diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs new file mode 100644 index 000000000000..2c9728a8cd0d --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfile.cs @@ -0,0 +1,100 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Profile of the managed cluster load balancer + /// + public partial class ManagedClusterLoadBalancerProfile + { + /// + /// Initializes a new instance of the ManagedClusterLoadBalancerProfile + /// class. + /// + public ManagedClusterLoadBalancerProfile() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterLoadBalancerProfile + /// class. + /// + /// Desired managed outbound IPs for + /// the cluster load balancer. + /// Desired outbound IP Prefix + /// resources for the cluster load balancer. + /// Desired outbound IP resources for the + /// cluster load balancer. + /// The effective outbound IP + /// resources of the cluster load balancer. + public ManagedClusterLoadBalancerProfile(ManagedClusterLoadBalancerProfileManagedOutboundIPs managedOutboundIPs = default(ManagedClusterLoadBalancerProfileManagedOutboundIPs), ManagedClusterLoadBalancerProfileOutboundIPPrefixes outboundIPPrefixes = default(ManagedClusterLoadBalancerProfileOutboundIPPrefixes), ManagedClusterLoadBalancerProfileOutboundIPs outboundIPs = default(ManagedClusterLoadBalancerProfileOutboundIPs), IList effectiveOutboundIPs = default(IList)) + { + ManagedOutboundIPs = managedOutboundIPs; + OutboundIPPrefixes = outboundIPPrefixes; + OutboundIPs = outboundIPs; + EffectiveOutboundIPs = effectiveOutboundIPs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets desired managed outbound IPs for the cluster load + /// balancer. + /// + [JsonProperty(PropertyName = "managedOutboundIPs")] + public ManagedClusterLoadBalancerProfileManagedOutboundIPs ManagedOutboundIPs { get; set; } + + /// + /// Gets or sets desired outbound IP Prefix resources for the cluster + /// load balancer. + /// + [JsonProperty(PropertyName = "outboundIPPrefixes")] + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes OutboundIPPrefixes { get; set; } + + /// + /// Gets or sets desired outbound IP resources for the cluster load + /// balancer. + /// + [JsonProperty(PropertyName = "outboundIPs")] + public ManagedClusterLoadBalancerProfileOutboundIPs OutboundIPs { get; set; } + + /// + /// Gets or sets the effective outbound IP resources of the cluster + /// load balancer. + /// + [JsonProperty(PropertyName = "effectiveOutboundIPs")] + public IList EffectiveOutboundIPs { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ManagedOutboundIPs != null) + { + ManagedOutboundIPs.Validate(); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs new file mode 100644 index 000000000000..d72f7f793e37 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileManagedOutboundIPs.cs @@ -0,0 +1,75 @@ +// +// 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.ContainerService.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Desired managed outbound IPs for the cluster load balancer. + /// + public partial class ManagedClusterLoadBalancerProfileManagedOutboundIPs + { + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileManagedOutboundIPs class. + /// + public ManagedClusterLoadBalancerProfileManagedOutboundIPs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileManagedOutboundIPs class. + /// + /// Desired number of outbound IP created/managed + /// by Azure for the cluster load balancer. Allowed values must be in + /// the range of 1 to 100 (inclusive). The default value is 1. + public ManagedClusterLoadBalancerProfileManagedOutboundIPs(int? count = default(int?)) + { + Count = count; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets desired number of outbound IP created/managed by Azure + /// for the cluster load balancer. Allowed values must be in the range + /// of 1 to 100 (inclusive). The default value is 1. + /// + [JsonProperty(PropertyName = "count")] + public int? Count { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Count > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Count", 100); + } + if (Count < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Count", 1); + } + } + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs new file mode 100644 index 000000000000..e4220de6974b --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPPrefixes.cs @@ -0,0 +1,56 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Desired outbound IP Prefix resources for the cluster load balancer. + /// + public partial class ManagedClusterLoadBalancerProfileOutboundIPPrefixes + { + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileOutboundIPPrefixes class. + /// + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileOutboundIPPrefixes class. + /// + /// A list of public IP prefix + /// resources. + public ManagedClusterLoadBalancerProfileOutboundIPPrefixes(IList publicIPPrefixes = default(IList)) + { + PublicIPPrefixes = publicIPPrefixes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of public IP prefix resources. + /// + [JsonProperty(PropertyName = "publicIPPrefixes")] + public IList PublicIPPrefixes { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs new file mode 100644 index 000000000000..8c6863afa7cb --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ManagedClusterLoadBalancerProfileOutboundIPs.cs @@ -0,0 +1,55 @@ +// +// 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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Desired outbound IP resources for the cluster load balancer. + /// + public partial class ManagedClusterLoadBalancerProfileOutboundIPs + { + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileOutboundIPs class. + /// + public ManagedClusterLoadBalancerProfileOutboundIPs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ManagedClusterLoadBalancerProfileOutboundIPs class. + /// + /// A list of public IP resources. + public ManagedClusterLoadBalancerProfileOutboundIPs(IList publicIPs = default(IList)) + { + PublicIPs = publicIPs; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of public IP resources. + /// + [JsonProperty(PropertyName = "publicIPs")] + public IList PublicIPs { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.cs new file mode 100644 index 000000000000..d272c94add12 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ResourceReference.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.ContainerService.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A reference to an Azure resource. + /// + public partial class ResourceReference + { + /// + /// Initializes a new instance of the ResourceReference class. + /// + public ResourceReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceReference class. + /// + /// The fully qualified Azure resource id. + public ResourceReference(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the fully qualified Azure resource id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.cs new file mode 100644 index 000000000000..25bd3db49c44 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetEvictionPolicy.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.ContainerService.Models +{ + + /// + /// Defines values for ScaleSetEvictionPolicy. + /// + public static class ScaleSetEvictionPolicy + { + public const string Delete = "Delete"; + public const string Deallocate = "Deallocate"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.cs new file mode 100644 index 000000000000..5edcae14e830 --- /dev/null +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Models/ScaleSetPriority.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.ContainerService.Models +{ + + /// + /// Defines values for ScaleSetPriority. + /// + public static class ScaleSetPriority + { + public const string Low = "Low"; + public const string Regular = "Regular"; + } +} diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs index ec90823197fa..33c25ec737fe 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(ContainerServiceClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2019-04-01"; + string apiVersion = "2019-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs index e35757d72020..2330060e78a7 100644 --- a/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs +++ b/sdk/containerservice/Microsoft.Azure.Management.ContainerService/src/Generated/SdkInfo_ContainerServiceClient.cs @@ -19,12 +19,12 @@ public static IEnumerable> ApiInfo_ContainerServic { return new Tuple[] { - new Tuple("ContainerService", "AgentPools", "2019-04-01"), + new Tuple("ContainerService", "AgentPools", "2019-08-01"), new Tuple("ContainerService", "ContainerServices", "2017-07-01"), - new Tuple("ContainerService", "ContainerServices", "2019-04-01"), - new Tuple("ContainerService", "ManagedClusters", "2019-04-01"), + new Tuple("ContainerService", "ContainerServices", "2019-08-01"), + new Tuple("ContainerService", "ManagedClusters", "2019-08-01"), new Tuple("ContainerService", "OpenShiftManagedClusters", "2019-04-30"), - new Tuple("ContainerService", "Operations", "2019-04-01"), + new Tuple("ContainerService", "Operations", "2019-08-01"), }.AsEnumerable(); } } From 84a417cca6b0ed6f540bf389fd8d2d1623fba81c Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2019 21:44:23 +0000 Subject: [PATCH 13/23] [AutoPR Microsoft.Azure.Management.FrontDoor] Remove unsupported REST APIs from frontdoor (#218) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from 5c5a9743d699fe0a4ba6d07b69d696f490ae50a0 Delete unused example json files --- .../src/Generated/BackendPoolsOperations.cs | 1255 ----------------- .../BackendPoolsOperationsExtensions.cs | 341 ----- .../Generated/FrontDoorManagementClient.cs | 24 - .../Generated/FrontendEndpointsOperations.cs | 574 -------- .../FrontendEndpointsOperationsExtensions.cs | 194 --- .../HealthProbeSettingsOperations.cs | 1255 ----------------- ...HealthProbeSettingsOperationsExtensions.cs | 341 ----- .../src/Generated/IBackendPoolsOperations.cs | 217 --- .../Generated/IFrontDoorManagementClient.cs | 20 - .../Generated/IFrontendEndpointsOperations.cs | 120 -- .../IHealthProbeSettingsOperations.cs | 224 --- .../ILoadBalancingSettingsOperations.cs | 224 --- .../src/Generated/IRoutingRulesOperations.cs | 217 --- .../LoadBalancingSettingsOperations.cs | 1255 ----------------- ...adBalancingSettingsOperationsExtensions.cs | 341 ----- .../Generated/Models/BackendPoolListResult.cs | 65 + .../Models/HealthProbeSettingsListResult.cs | 68 + .../Models/LoadBalancingSettingsListResult.cs | 68 + .../Generated/Models/RoutingRuleListResult.cs | 65 + .../src/Generated/RoutingRulesOperations.cs | 1255 ----------------- .../RoutingRulesOperationsExtensions.cs | 341 ----- .../SdkInfo_FrontDoorManagementClient.cs | 4 - 22 files changed, 266 insertions(+), 8202 deletions(-) delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/BackendPoolsOperations.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/BackendPoolsOperationsExtensions.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/HealthProbeSettingsOperations.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/HealthProbeSettingsOperationsExtensions.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IBackendPoolsOperations.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IHealthProbeSettingsOperations.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/ILoadBalancingSettingsOperations.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IRoutingRulesOperations.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/LoadBalancingSettingsOperations.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/LoadBalancingSettingsOperationsExtensions.cs create mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/BackendPoolListResult.cs create mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/HealthProbeSettingsListResult.cs create mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/LoadBalancingSettingsListResult.cs create mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/RoutingRuleListResult.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/RoutingRulesOperations.cs delete mode 100644 sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/RoutingRulesOperationsExtensions.cs diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/BackendPoolsOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/BackendPoolsOperations.cs deleted file mode 100644 index febf5b0cb527..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/BackendPoolsOperations.cs +++ /dev/null @@ -1,1255 +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.FrontDoor -{ - 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; - - /// - /// BackendPoolsOperations operations. - /// - internal partial class BackendPoolsOperations : IServiceOperations, IBackendPoolsOperations - { - /// - /// Initializes a new instance of the BackendPoolsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BackendPoolsOperations(FrontDoorManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the FrontDoorManagementClient - /// - public FrontDoorManagementClient Client { get; private set; } - - /// - /// Lists all of the Backend Pools within a Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// 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>> ListByFrontDoorWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByFrontDoor", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 Backend Pool with the specified Pool name within the specified Front - /// Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string backendPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (backendPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backendPoolName"); - } - if (backendPoolName != null) - { - if (backendPoolName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "backendPoolName", 90); - } - if (backendPoolName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "backendPoolName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(backendPoolName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "backendPoolName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("backendPoolName", backendPoolName); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{backendPoolName}", System.Uri.EscapeDataString(backendPoolName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; - } - - /// - /// Creates a new Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Backend Pool properties needed to create a new Pool. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string backendPoolName, BackendPool backendPoolParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Backend Pool with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string backendPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, backendPoolName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates a new Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Backend Pool properties needed to create a new Pool. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string backendPoolName, BackendPool backendPoolParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (backendPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backendPoolName"); - } - if (backendPoolName != null) - { - if (backendPoolName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "backendPoolName", 90); - } - if (backendPoolName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "backendPoolName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(backendPoolName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "backendPoolName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - if (backendPoolParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backendPoolParameters"); - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("backendPoolName", backendPoolName); - tracingParameters.Add("backendPoolParameters", backendPoolParameters); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{backendPoolName}", System.Uri.EscapeDataString(backendPoolName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(backendPoolParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(backendPoolParameters, 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 != 201 && (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); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _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); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _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; - } - - /// - /// Deletes an existing Backend Pool with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string backendPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (backendPoolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "backendPoolName"); - } - if (backendPoolName != null) - { - if (backendPoolName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "backendPoolName", 90); - } - if (backendPoolName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "backendPoolName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(backendPoolName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "backendPoolName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("backendPoolName", backendPoolName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/backendPools/{backendPoolName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{backendPoolName}", System.Uri.EscapeDataString(backendPoolName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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("DELETE"); - _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 != 202 && (int)_statusCode != 204) - { - 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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all of the Backend Pools within a Front Door. - /// - /// - /// 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>> ListByFrontDoorNextWithHttpMessagesAsync(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, "ListByFrontDoorNext", 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/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/BackendPoolsOperationsExtensions.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/BackendPoolsOperationsExtensions.cs deleted file mode 100644 index 0fffad0a5e17..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/BackendPoolsOperationsExtensions.cs +++ /dev/null @@ -1,341 +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.FrontDoor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for BackendPoolsOperations. - /// - public static partial class BackendPoolsOperationsExtensions - { - /// - /// Lists all of the Backend Pools within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - public static IPage ListByFrontDoor(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName) - { - return operations.ListByFrontDoorAsync(resourceGroupName, frontDoorName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the Backend Pools within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByFrontDoorAsync(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByFrontDoorWithHttpMessagesAsync(resourceGroupName, frontDoorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a Backend Pool with the specified Pool name within the specified Front - /// Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - public static BackendPool Get(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName) - { - return operations.GetAsync(resourceGroupName, frontDoorName, backendPoolName).GetAwaiter().GetResult(); - } - - /// - /// Gets a Backend Pool with the specified Pool name within the specified Front - /// Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, frontDoorName, backendPoolName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a new Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Backend Pool properties needed to create a new Pool. - /// - public static BackendPool CreateOrUpdate(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName, BackendPool backendPoolParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Backend Pool properties needed to create a new Pool. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName, BackendPool backendPoolParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing Backend Pool with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - public static void Delete(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName) - { - operations.DeleteAsync(resourceGroupName, frontDoorName, backendPoolName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing Backend Pool with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, backendPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a new Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Backend Pool properties needed to create a new Pool. - /// - public static BackendPool BeginCreateOrUpdate(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName, BackendPool backendPoolParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Backend Pool properties needed to create a new Pool. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName, BackendPool backendPoolParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, backendPoolName, backendPoolParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing Backend Pool with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - public static void BeginDelete(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName) - { - operations.BeginDeleteAsync(resourceGroupName, frontDoorName, backendPoolName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing Backend Pool with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IBackendPoolsOperations operations, string resourceGroupName, string frontDoorName, string backendPoolName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, backendPoolName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all of the Backend Pools within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByFrontDoorNext(this IBackendPoolsOperations operations, string nextPageLink) - { - return operations.ListByFrontDoorNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the Backend Pools within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByFrontDoorNextAsync(this IBackendPoolsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByFrontDoorNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontDoorManagementClient.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontDoorManagementClient.cs index 89ee16d4a0c3..22f72317f36b 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontDoorManagementClient.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontDoorManagementClient.cs @@ -78,26 +78,6 @@ public partial class FrontDoorManagementClient : ServiceClient public virtual IFrontDoorsOperations FrontDoors { get; private set; } - /// - /// Gets the IRoutingRulesOperations. - /// - public virtual IRoutingRulesOperations RoutingRules { get; private set; } - - /// - /// Gets the IHealthProbeSettingsOperations. - /// - public virtual IHealthProbeSettingsOperations HealthProbeSettings { get; private set; } - - /// - /// Gets the ILoadBalancingSettingsOperations. - /// - public virtual ILoadBalancingSettingsOperations LoadBalancingSettings { get; private set; } - - /// - /// Gets the IBackendPoolsOperations. - /// - public virtual IBackendPoolsOperations BackendPools { get; private set; } - /// /// Gets the IFrontendEndpointsOperations. /// @@ -360,10 +340,6 @@ public FrontDoorManagementClient(System.Uri baseUri, ServiceClientCredentials cr private void Initialize() { FrontDoors = new FrontDoorsOperations(this); - RoutingRules = new RoutingRulesOperations(this); - HealthProbeSettings = new HealthProbeSettingsOperations(this); - LoadBalancingSettings = new LoadBalancingSettingsOperations(this); - BackendPools = new BackendPoolsOperations(this); FrontendEndpoints = new FrontendEndpointsOperations(this); Endpoints = new EndpointsOperations(this); Policies = new PoliciesOperations(this); diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontendEndpointsOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontendEndpointsOperations.cs index 8b1570eba458..2b83d9a00ca5 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontendEndpointsOperations.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontendEndpointsOperations.cs @@ -513,60 +513,6 @@ internal FrontendEndpointsOperations(FrontDoorManagementClient client) return _result; } - /// - /// Creates a new frontend endpoint with the specified host name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// Frontend endpoint properties needed to create a new endpoint. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string frontendEndpointName, FrontendEndpoint frontendEndpointParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing frontend endpoint with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string frontendEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, frontendEndpointName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Enables a frontendEndpoint for HTTPS traffic /// @@ -620,526 +566,6 @@ internal FrontendEndpointsOperations(FrontDoorManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } - /// - /// Creates a new frontend endpoint with the specified host name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// Frontend endpoint properties needed to create a new endpoint. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string frontendEndpointName, FrontendEndpoint frontendEndpointParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (frontendEndpointName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontendEndpointName"); - } - if (frontendEndpointName != null) - { - if (frontendEndpointName.Length > 255) - { - throw new ValidationException(ValidationRules.MaxLength, "frontendEndpointName", 255); - } - if (frontendEndpointName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "frontendEndpointName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontendEndpointName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontendEndpointName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - if (frontendEndpointParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontendEndpointParameters"); - } - if (frontendEndpointParameters != null) - { - frontendEndpointParameters.Validate(); - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("frontendEndpointName", frontendEndpointName); - tracingParameters.Add("frontendEndpointParameters", frontendEndpointParameters); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{frontendEndpointName}", System.Uri.EscapeDataString(frontendEndpointName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(frontendEndpointParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(frontendEndpointParameters, 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 != 201 && (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); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _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); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _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; - } - - /// - /// Deletes an existing frontend endpoint with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string frontendEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (frontendEndpointName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontendEndpointName"); - } - if (frontendEndpointName != null) - { - if (frontendEndpointName.Length > 255) - { - throw new ValidationException(ValidationRules.MaxLength, "frontendEndpointName", 255); - } - if (frontendEndpointName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "frontendEndpointName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontendEndpointName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontendEndpointName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("frontendEndpointName", frontendEndpointName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{frontendEndpointName}", System.Uri.EscapeDataString(frontendEndpointName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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("DELETE"); - _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 != 202 && (int)_statusCode != 204) - { - 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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - /// /// Enables a frontendEndpoint for HTTPS traffic /// diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontendEndpointsOperationsExtensions.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontendEndpointsOperationsExtensions.cs index a9c27ec14fd3..1056b4320b73 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontendEndpointsOperationsExtensions.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/FrontendEndpointsOperationsExtensions.cs @@ -109,103 +109,6 @@ public static FrontendEndpoint Get(this IFrontendEndpointsOperations operations, } } - /// - /// Creates a new frontend endpoint with the specified host name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// Frontend endpoint properties needed to create a new endpoint. - /// - public static FrontendEndpoint CreateOrUpdate(this IFrontendEndpointsOperations operations, string resourceGroupName, string frontDoorName, string frontendEndpointName, FrontendEndpoint frontendEndpointParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new frontend endpoint with the specified host name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// Frontend endpoint properties needed to create a new endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IFrontendEndpointsOperations operations, string resourceGroupName, string frontDoorName, string frontendEndpointName, FrontendEndpoint frontendEndpointParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing frontend endpoint with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - public static void Delete(this IFrontendEndpointsOperations operations, string resourceGroupName, string frontDoorName, string frontendEndpointName) - { - operations.DeleteAsync(resourceGroupName, frontDoorName, frontendEndpointName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing frontend endpoint with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IFrontendEndpointsOperations operations, string resourceGroupName, string frontDoorName, string frontendEndpointName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, frontendEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Enables a frontendEndpoint for HTTPS traffic /// @@ -298,103 +201,6 @@ public static void DisableHttps(this IFrontendEndpointsOperations operations, st (await operations.DisableHttpsWithHttpMessagesAsync(resourceGroupName, frontDoorName, frontendEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Creates a new frontend endpoint with the specified host name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// Frontend endpoint properties needed to create a new endpoint. - /// - public static FrontendEndpoint BeginCreateOrUpdate(this IFrontendEndpointsOperations operations, string resourceGroupName, string frontDoorName, string frontendEndpointName, FrontendEndpoint frontendEndpointParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new frontend endpoint with the specified host name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// Frontend endpoint properties needed to create a new endpoint. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IFrontendEndpointsOperations operations, string resourceGroupName, string frontDoorName, string frontendEndpointName, FrontendEndpoint frontendEndpointParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, frontendEndpointName, frontendEndpointParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing frontend endpoint with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - public static void BeginDelete(this IFrontendEndpointsOperations operations, string resourceGroupName, string frontDoorName, string frontendEndpointName) - { - operations.BeginDeleteAsync(resourceGroupName, frontDoorName, frontendEndpointName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing frontend endpoint with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IFrontendEndpointsOperations operations, string resourceGroupName, string frontDoorName, string frontendEndpointName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, frontendEndpointName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Enables a frontendEndpoint for HTTPS traffic /// diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/HealthProbeSettingsOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/HealthProbeSettingsOperations.cs deleted file mode 100644 index 30c437cd0c90..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/HealthProbeSettingsOperations.cs +++ /dev/null @@ -1,1255 +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.FrontDoor -{ - 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; - - /// - /// HealthProbeSettingsOperations operations. - /// - internal partial class HealthProbeSettingsOperations : IServiceOperations, IHealthProbeSettingsOperations - { - /// - /// Initializes a new instance of the HealthProbeSettingsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal HealthProbeSettingsOperations(FrontDoorManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the FrontDoorManagementClient - /// - public FrontDoorManagementClient Client { get; private set; } - - /// - /// Lists all of the HealthProbeSettings within a Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// 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>> ListByFrontDoorWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByFrontDoor", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string healthProbeSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (healthProbeSettingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "healthProbeSettingsName"); - } - if (healthProbeSettingsName != null) - { - if (healthProbeSettingsName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "healthProbeSettingsName", 90); - } - if (healthProbeSettingsName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "healthProbeSettingsName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(healthProbeSettingsName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "healthProbeSettingsName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("healthProbeSettingsName", healthProbeSettingsName); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{healthProbeSettingsName}", System.Uri.EscapeDataString(healthProbeSettingsName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; - } - - /// - /// Creates a new HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// HealthProbeSettings properties needed to create a new Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string healthProbeSettingsName, HealthProbeSettingsModel healthProbeSettingsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing HealthProbeSettings with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string healthProbeSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates a new HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// HealthProbeSettings properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string healthProbeSettingsName, HealthProbeSettingsModel healthProbeSettingsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (healthProbeSettingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "healthProbeSettingsName"); - } - if (healthProbeSettingsName != null) - { - if (healthProbeSettingsName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "healthProbeSettingsName", 90); - } - if (healthProbeSettingsName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "healthProbeSettingsName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(healthProbeSettingsName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "healthProbeSettingsName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - if (healthProbeSettingsParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "healthProbeSettingsParameters"); - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("healthProbeSettingsName", healthProbeSettingsName); - tracingParameters.Add("healthProbeSettingsParameters", healthProbeSettingsParameters); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{healthProbeSettingsName}", System.Uri.EscapeDataString(healthProbeSettingsName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(healthProbeSettingsParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(healthProbeSettingsParameters, 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 != 201 && (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); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _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); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _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; - } - - /// - /// Deletes an existing HealthProbeSettings with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string healthProbeSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (healthProbeSettingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "healthProbeSettingsName"); - } - if (healthProbeSettingsName != null) - { - if (healthProbeSettingsName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "healthProbeSettingsName", 90); - } - if (healthProbeSettingsName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "healthProbeSettingsName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(healthProbeSettingsName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "healthProbeSettingsName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("healthProbeSettingsName", healthProbeSettingsName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/healthProbeSettings/{healthProbeSettingsName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{healthProbeSettingsName}", System.Uri.EscapeDataString(healthProbeSettingsName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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("DELETE"); - _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 != 202 && (int)_statusCode != 204) - { - 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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all of the HealthProbeSettings within a Front Door. - /// - /// - /// 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>> ListByFrontDoorNextWithHttpMessagesAsync(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, "ListByFrontDoorNext", 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/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/HealthProbeSettingsOperationsExtensions.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/HealthProbeSettingsOperationsExtensions.cs deleted file mode 100644 index b31018a44ccb..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/HealthProbeSettingsOperationsExtensions.cs +++ /dev/null @@ -1,341 +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.FrontDoor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for HealthProbeSettingsOperations. - /// - public static partial class HealthProbeSettingsOperationsExtensions - { - /// - /// Lists all of the HealthProbeSettings within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - public static IPage ListByFrontDoor(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName) - { - return operations.ListByFrontDoorAsync(resourceGroupName, frontDoorName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the HealthProbeSettings within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByFrontDoorAsync(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByFrontDoorWithHttpMessagesAsync(resourceGroupName, frontDoorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - public static HealthProbeSettingsModel Get(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName) - { - return operations.GetAsync(resourceGroupName, frontDoorName, healthProbeSettingsName).GetAwaiter().GetResult(); - } - - /// - /// Gets a HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a new HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// HealthProbeSettings properties needed to create a new Front Door. - /// - public static HealthProbeSettingsModel CreateOrUpdate(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName, HealthProbeSettingsModel healthProbeSettingsParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// HealthProbeSettings properties needed to create a new Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName, HealthProbeSettingsModel healthProbeSettingsParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing HealthProbeSettings with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - public static void Delete(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName) - { - operations.DeleteAsync(resourceGroupName, frontDoorName, healthProbeSettingsName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing HealthProbeSettings with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a new HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// HealthProbeSettings properties needed to create a new Front Door. - /// - public static HealthProbeSettingsModel BeginCreateOrUpdate(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName, HealthProbeSettingsModel healthProbeSettingsParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// HealthProbeSettings properties needed to create a new Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName, HealthProbeSettingsModel healthProbeSettingsParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, healthProbeSettingsParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing HealthProbeSettings with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - public static void BeginDelete(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName) - { - operations.BeginDeleteAsync(resourceGroupName, frontDoorName, healthProbeSettingsName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing HealthProbeSettings with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IHealthProbeSettingsOperations operations, string resourceGroupName, string frontDoorName, string healthProbeSettingsName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, healthProbeSettingsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all of the HealthProbeSettings within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByFrontDoorNext(this IHealthProbeSettingsOperations operations, string nextPageLink) - { - return operations.ListByFrontDoorNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the HealthProbeSettings within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByFrontDoorNextAsync(this IHealthProbeSettingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByFrontDoorNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IBackendPoolsOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IBackendPoolsOperations.cs deleted file mode 100644 index 2e842abc28a1..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IBackendPoolsOperations.cs +++ /dev/null @@ -1,217 +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.FrontDoor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// BackendPoolsOperations operations. - /// - public partial interface IBackendPoolsOperations - { - /// - /// Lists all of the Backend Pools within a Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// 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>> ListByFrontDoorWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string backendPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Backend Pool properties needed to create a new Pool. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string backendPoolName, BackendPool backendPoolParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing Backend Pool with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string backendPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new Backend Pool with the specified Pool name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// Backend Pool properties needed to create a new Pool. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string backendPoolName, BackendPool backendPoolParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing Backend Pool with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Backend Pool which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string backendPoolName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the Backend Pools within a Front Door. - /// - /// - /// 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>> ListByFrontDoorNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IFrontDoorManagementClient.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IFrontDoorManagementClient.cs index 7056083a2841..e0fdb183490c 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IFrontDoorManagementClient.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IFrontDoorManagementClient.cs @@ -75,26 +75,6 @@ public partial interface IFrontDoorManagementClient : System.IDisposable /// IFrontDoorsOperations FrontDoors { get; } - /// - /// Gets the IRoutingRulesOperations. - /// - IRoutingRulesOperations RoutingRules { get; } - - /// - /// Gets the IHealthProbeSettingsOperations. - /// - IHealthProbeSettingsOperations HealthProbeSettings { get; } - - /// - /// Gets the ILoadBalancingSettingsOperations. - /// - ILoadBalancingSettingsOperations LoadBalancingSettings { get; } - - /// - /// Gets the IBackendPoolsOperations. - /// - IBackendPoolsOperations BackendPools { get; } - /// /// Gets the IFrontendEndpointsOperations. /// diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IFrontendEndpointsOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IFrontendEndpointsOperations.cs index c6018ca5fb04..b72f6e2046e8 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IFrontendEndpointsOperations.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IFrontendEndpointsOperations.cs @@ -79,66 +79,6 @@ public partial interface IFrontendEndpointsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string frontendEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a new frontend endpoint with the specified host name within - /// the specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front - /// Door. - /// - /// - /// Frontend endpoint properties needed to create a new endpoint. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string frontendEndpointName, FrontendEndpoint frontendEndpointParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing frontend endpoint with the specified - /// parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front - /// Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string frontendEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Enables a frontendEndpoint for HTTPS traffic /// /// @@ -194,66 +134,6 @@ public partial interface IFrontendEndpointsOperations /// Task DisableHttpsWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string frontendEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a new frontend endpoint with the specified host name within - /// the specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front - /// Door. - /// - /// - /// Frontend endpoint properties needed to create a new endpoint. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string frontendEndpointName, FrontendEndpoint frontendEndpointParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing frontend endpoint with the specified - /// parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Frontend endpoint which is unique within the Front - /// Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string frontendEndpointName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Enables a frontendEndpoint for HTTPS traffic /// /// diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IHealthProbeSettingsOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IHealthProbeSettingsOperations.cs deleted file mode 100644 index cfe1548c3386..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IHealthProbeSettingsOperations.cs +++ /dev/null @@ -1,224 +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.FrontDoor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// HealthProbeSettingsOperations operations. - /// - public partial interface IHealthProbeSettingsOperations - { - /// - /// Lists all of the HealthProbeSettings within a Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// 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>> ListByFrontDoorWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a HealthProbeSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front - /// Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string healthProbeSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new HealthProbeSettings with the specified Rule name - /// within the specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front - /// Door. - /// - /// - /// HealthProbeSettings properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string healthProbeSettingsName, HealthProbeSettingsModel healthProbeSettingsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing HealthProbeSettings with the specified - /// parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front - /// Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string healthProbeSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new HealthProbeSettings with the specified Rule name - /// within the specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front - /// Door. - /// - /// - /// HealthProbeSettings properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string healthProbeSettingsName, HealthProbeSettingsModel healthProbeSettingsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing HealthProbeSettings with the specified - /// parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the health probe settings which is unique within the Front - /// Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string healthProbeSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the HealthProbeSettings within a Front Door. - /// - /// - /// 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>> ListByFrontDoorNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/ILoadBalancingSettingsOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/ILoadBalancingSettingsOperations.cs deleted file mode 100644 index 2a415ece748a..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/ILoadBalancingSettingsOperations.cs +++ /dev/null @@ -1,224 +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.FrontDoor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// LoadBalancingSettingsOperations operations. - /// - public partial interface ILoadBalancingSettingsOperations - { - /// - /// Lists all of the LoadBalancingSettings within a Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// 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>> ListByFrontDoorWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a LoadBalancingSettings with the specified Rule name within - /// the specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the - /// Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string loadBalancingSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new LoadBalancingSettings with the specified Rule name - /// within the specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the - /// Front Door. - /// - /// - /// LoadBalancingSettings properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string loadBalancingSettingsName, LoadBalancingSettingsModel loadBalancingSettingsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing LoadBalancingSettings with the specified - /// parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the - /// Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new LoadBalancingSettings with the specified Rule name - /// within the specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the - /// Front Door. - /// - /// - /// LoadBalancingSettings properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string loadBalancingSettingsName, LoadBalancingSettingsModel loadBalancingSettingsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing LoadBalancingSettings with the specified - /// parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the - /// Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the LoadBalancingSettings within a Front Door. - /// - /// - /// 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>> ListByFrontDoorNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IRoutingRulesOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IRoutingRulesOperations.cs deleted file mode 100644 index 1054d2eec3c7..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/IRoutingRulesOperations.cs +++ /dev/null @@ -1,217 +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.FrontDoor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// RoutingRulesOperations operations. - /// - public partial interface IRoutingRulesOperations - { - /// - /// Lists all of the Routing Rules within a Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// 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>> ListByFrontDoorWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string routingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Routing Rule properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string routingRuleName, RoutingRule routingRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing Routing Rule with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string routingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a new Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Routing Rule properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string routingRuleName, RoutingRule routingRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an existing Routing Rule with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string routingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all of the Routing Rules within a Front Door. - /// - /// - /// 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>> ListByFrontDoorNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/LoadBalancingSettingsOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/LoadBalancingSettingsOperations.cs deleted file mode 100644 index 78bff1e498ec..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/LoadBalancingSettingsOperations.cs +++ /dev/null @@ -1,1255 +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.FrontDoor -{ - 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; - - /// - /// LoadBalancingSettingsOperations operations. - /// - internal partial class LoadBalancingSettingsOperations : IServiceOperations, ILoadBalancingSettingsOperations - { - /// - /// Initializes a new instance of the LoadBalancingSettingsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal LoadBalancingSettingsOperations(FrontDoorManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the FrontDoorManagementClient - /// - public FrontDoorManagementClient Client { get; private set; } - - /// - /// Lists all of the LoadBalancingSettings within a Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// 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>> ListByFrontDoorWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByFrontDoor", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (loadBalancingSettingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancingSettingsName"); - } - if (loadBalancingSettingsName != null) - { - if (loadBalancingSettingsName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "loadBalancingSettingsName", 90); - } - if (loadBalancingSettingsName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "loadBalancingSettingsName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(loadBalancingSettingsName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "loadBalancingSettingsName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("loadBalancingSettingsName", loadBalancingSettingsName); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{loadBalancingSettingsName}", System.Uri.EscapeDataString(loadBalancingSettingsName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; - } - - /// - /// Creates a new LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// LoadBalancingSettings properties needed to create a new Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, LoadBalancingSettingsModel loadBalancingSettingsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing LoadBalancingSettings with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates a new LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// LoadBalancingSettings properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string loadBalancingSettingsName, LoadBalancingSettingsModel loadBalancingSettingsParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (loadBalancingSettingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancingSettingsName"); - } - if (loadBalancingSettingsName != null) - { - if (loadBalancingSettingsName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "loadBalancingSettingsName", 90); - } - if (loadBalancingSettingsName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "loadBalancingSettingsName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(loadBalancingSettingsName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "loadBalancingSettingsName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - if (loadBalancingSettingsParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancingSettingsParameters"); - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("loadBalancingSettingsName", loadBalancingSettingsName); - tracingParameters.Add("loadBalancingSettingsParameters", loadBalancingSettingsParameters); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{loadBalancingSettingsName}", System.Uri.EscapeDataString(loadBalancingSettingsName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(loadBalancingSettingsParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(loadBalancingSettingsParameters, 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 != 201 && (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); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _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); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _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; - } - - /// - /// Deletes an existing LoadBalancingSettings with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (loadBalancingSettingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "loadBalancingSettingsName"); - } - if (loadBalancingSettingsName != null) - { - if (loadBalancingSettingsName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "loadBalancingSettingsName", 90); - } - if (loadBalancingSettingsName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "loadBalancingSettingsName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(loadBalancingSettingsName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "loadBalancingSettingsName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("loadBalancingSettingsName", loadBalancingSettingsName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/loadBalancingSettings/{loadBalancingSettingsName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{loadBalancingSettingsName}", System.Uri.EscapeDataString(loadBalancingSettingsName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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("DELETE"); - _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 != 202 && (int)_statusCode != 204) - { - 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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all of the LoadBalancingSettings within a Front Door. - /// - /// - /// 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>> ListByFrontDoorNextWithHttpMessagesAsync(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, "ListByFrontDoorNext", 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/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/LoadBalancingSettingsOperationsExtensions.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/LoadBalancingSettingsOperationsExtensions.cs deleted file mode 100644 index 0f6435bd3e59..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/LoadBalancingSettingsOperationsExtensions.cs +++ /dev/null @@ -1,341 +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.FrontDoor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for LoadBalancingSettingsOperations. - /// - public static partial class LoadBalancingSettingsOperationsExtensions - { - /// - /// Lists all of the LoadBalancingSettings within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - public static IPage ListByFrontDoor(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName) - { - return operations.ListByFrontDoorAsync(resourceGroupName, frontDoorName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the LoadBalancingSettings within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByFrontDoorAsync(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByFrontDoorWithHttpMessagesAsync(resourceGroupName, frontDoorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - public static LoadBalancingSettingsModel Get(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName) - { - return operations.GetAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName).GetAwaiter().GetResult(); - } - - /// - /// Gets a LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a new LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// LoadBalancingSettings properties needed to create a new Front Door. - /// - public static LoadBalancingSettingsModel CreateOrUpdate(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, LoadBalancingSettingsModel loadBalancingSettingsParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// LoadBalancingSettings properties needed to create a new Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, LoadBalancingSettingsModel loadBalancingSettingsParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing LoadBalancingSettings with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - public static void Delete(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName) - { - operations.DeleteAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing LoadBalancingSettings with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a new LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// LoadBalancingSettings properties needed to create a new Front Door. - /// - public static LoadBalancingSettingsModel BeginCreateOrUpdate(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, LoadBalancingSettingsModel loadBalancingSettingsParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new LoadBalancingSettings with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// LoadBalancingSettings properties needed to create a new Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, LoadBalancingSettingsModel loadBalancingSettingsParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, loadBalancingSettingsParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing LoadBalancingSettings with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - public static void BeginDelete(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName) - { - operations.BeginDeleteAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing LoadBalancingSettings with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the load balancing settings which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this ILoadBalancingSettingsOperations operations, string resourceGroupName, string frontDoorName, string loadBalancingSettingsName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, loadBalancingSettingsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all of the LoadBalancingSettings within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByFrontDoorNext(this ILoadBalancingSettingsOperations operations, string nextPageLink) - { - return operations.ListByFrontDoorNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the LoadBalancingSettings within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByFrontDoorNextAsync(this ILoadBalancingSettingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByFrontDoorNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/BackendPoolListResult.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/BackendPoolListResult.cs new file mode 100644 index 000000000000..af6c1c79b07e --- /dev/null +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/BackendPoolListResult.cs @@ -0,0 +1,65 @@ +// +// 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.FrontDoor.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list Backend Pools. It contains a list of + /// Backend Pools objects and a URL link to get the next set of results. + /// + public partial class BackendPoolListResult + { + /// + /// Initializes a new instance of the BackendPoolListResult class. + /// + public BackendPoolListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackendPoolListResult class. + /// + /// List of Backend Pools within a Front + /// Door. + /// URL to get the next set of BackendPool + /// objects if there are any. + public BackendPoolListResult(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 list of Backend Pools within a Front Door. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets or sets URL to get the next set of BackendPool objects if + /// there are any. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/HealthProbeSettingsListResult.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/HealthProbeSettingsListResult.cs new file mode 100644 index 000000000000..c279c07d5f84 --- /dev/null +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/HealthProbeSettingsListResult.cs @@ -0,0 +1,68 @@ +// +// 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.FrontDoor.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list HealthProbeSettings. It contains a list + /// of HealthProbeSettings objects and a URL link to get the next set of + /// results. + /// + public partial class HealthProbeSettingsListResult + { + /// + /// Initializes a new instance of the HealthProbeSettingsListResult + /// class. + /// + public HealthProbeSettingsListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HealthProbeSettingsListResult + /// class. + /// + /// List of HealthProbeSettings within a Front + /// Door. + /// URL to get the next set of + /// HealthProbeSettings objects if there are any. + public HealthProbeSettingsListResult(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 list of HealthProbeSettings within a Front Door. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets or sets URL to get the next set of HealthProbeSettings objects + /// if there are any. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/LoadBalancingSettingsListResult.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/LoadBalancingSettingsListResult.cs new file mode 100644 index 000000000000..54dea6049de5 --- /dev/null +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/LoadBalancingSettingsListResult.cs @@ -0,0 +1,68 @@ +// +// 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.FrontDoor.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list load balancing settings. It contains a + /// list of load balancing settings objects and a URL link to get the next + /// set of results. + /// + public partial class LoadBalancingSettingsListResult + { + /// + /// Initializes a new instance of the LoadBalancingSettingsListResult + /// class. + /// + public LoadBalancingSettingsListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LoadBalancingSettingsListResult + /// class. + /// + /// List of Backend Pools within a Front + /// Door. + /// URL to get the next set of + /// LoadBalancingSettings objects if there are any. + public LoadBalancingSettingsListResult(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 list of Backend Pools within a Front Door. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets or sets URL to get the next set of LoadBalancingSettings + /// objects if there are any. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/RoutingRuleListResult.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/RoutingRuleListResult.cs new file mode 100644 index 000000000000..bd4ac0d519f6 --- /dev/null +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/Models/RoutingRuleListResult.cs @@ -0,0 +1,65 @@ +// +// 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.FrontDoor.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list Routing Rules. It contains a list of + /// Routing Rule objects and a URL link to get the next set of results. + /// + public partial class RoutingRuleListResult + { + /// + /// Initializes a new instance of the RoutingRuleListResult class. + /// + public RoutingRuleListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RoutingRuleListResult class. + /// + /// List of Routing Rules within a Front + /// Door. + /// URL to get the next set of RoutingRule + /// objects if there are any. + public RoutingRuleListResult(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 list of Routing Rules within a Front Door. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets or sets URL to get the next set of RoutingRule objects if + /// there are any. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/RoutingRulesOperations.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/RoutingRulesOperations.cs deleted file mode 100644 index 1d640542e393..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/RoutingRulesOperations.cs +++ /dev/null @@ -1,1255 +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.FrontDoor -{ - 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; - - /// - /// RoutingRulesOperations operations. - /// - internal partial class RoutingRulesOperations : IServiceOperations, IRoutingRulesOperations - { - /// - /// Initializes a new instance of the RoutingRulesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal RoutingRulesOperations(FrontDoorManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the FrontDoorManagementClient - /// - public FrontDoorManagementClient Client { get; private set; } - - /// - /// Lists all of the Routing Rules within a Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// 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>> ListByFrontDoorWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByFrontDoor", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 Routing Rule with the specified Rule name within the specified Front - /// Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string routingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (routingRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routingRuleName"); - } - if (routingRuleName != null) - { - if (routingRuleName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "routingRuleName", 90); - } - if (routingRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "routingRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(routingRuleName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "routingRuleName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("routingRuleName", routingRuleName); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{routingRuleName}", System.Uri.EscapeDataString(routingRuleName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; - } - - /// - /// Creates a new Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Routing Rule properties needed to create a new Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string routingRuleName, RoutingRule routingRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes an existing Routing Rule with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string routingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, routingRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Creates a new Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Routing Rule properties needed to create a new Front Door. - /// - /// - /// 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 resourceGroupName, string frontDoorName, string routingRuleName, RoutingRule routingRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (routingRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routingRuleName"); - } - if (routingRuleName != null) - { - if (routingRuleName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "routingRuleName", 90); - } - if (routingRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "routingRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(routingRuleName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "routingRuleName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - if (routingRuleParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routingRuleParameters"); - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("routingRuleName", routingRuleName); - tracingParameters.Add("routingRuleParameters", routingRuleParameters); - tracingParameters.Add("apiVersion", apiVersion); - 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{routingRuleName}", System.Uri.EscapeDataString(routingRuleName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(routingRuleParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(routingRuleParameters, 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 != 201 && (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); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _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); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _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; - } - - /// - /// Deletes an existing Routing Rule with the specified parameters. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string frontDoorName, string routingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 80) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"); - } - } - if (frontDoorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "frontDoorName"); - } - if (frontDoorName != null) - { - if (frontDoorName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "frontDoorName", 64); - } - if (frontDoorName.Length < 5) - { - throw new ValidationException(ValidationRules.MinLength, "frontDoorName", 5); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(frontDoorName, "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "frontDoorName", "^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$"); - } - } - if (routingRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "routingRuleName"); - } - if (routingRuleName != null) - { - if (routingRuleName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "routingRuleName", 90); - } - if (routingRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "routingRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(routingRuleName, "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$")) - { - throw new ValidationException(ValidationRules.Pattern, "routingRuleName", "^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$"); - } - } - string apiVersion = "2019-05-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("frontDoorName", frontDoorName); - tracingParameters.Add("routingRuleName", routingRuleName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/routingRules/{routingRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{frontDoorName}", System.Uri.EscapeDataString(frontDoorName)); - _url = _url.Replace("{routingRuleName}", System.Uri.EscapeDataString(routingRuleName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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("DELETE"); - _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 != 202 && (int)_statusCode != 204) - { - 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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all of the Routing Rules within a Front Door. - /// - /// - /// 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>> ListByFrontDoorNextWithHttpMessagesAsync(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, "ListByFrontDoorNext", 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/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/RoutingRulesOperationsExtensions.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/RoutingRulesOperationsExtensions.cs deleted file mode 100644 index 79a1131ba92d..000000000000 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/RoutingRulesOperationsExtensions.cs +++ /dev/null @@ -1,341 +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.FrontDoor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for RoutingRulesOperations. - /// - public static partial class RoutingRulesOperationsExtensions - { - /// - /// Lists all of the Routing Rules within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - public static IPage ListByFrontDoor(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName) - { - return operations.ListByFrontDoorAsync(resourceGroupName, frontDoorName).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the Routing Rules within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByFrontDoorAsync(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByFrontDoorWithHttpMessagesAsync(resourceGroupName, frontDoorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a Routing Rule with the specified Rule name within the specified Front - /// Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - public static RoutingRule Get(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName) - { - return operations.GetAsync(resourceGroupName, frontDoorName, routingRuleName).GetAwaiter().GetResult(); - } - - /// - /// Gets a Routing Rule with the specified Rule name within the specified Front - /// Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, frontDoorName, routingRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates a new Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Routing Rule properties needed to create a new Front Door. - /// - public static RoutingRule CreateOrUpdate(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName, RoutingRule routingRuleParameters) - { - return operations.CreateOrUpdateAsync(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Routing Rule properties needed to create a new Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName, RoutingRule routingRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing Routing Rule with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - public static void Delete(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName) - { - operations.DeleteAsync(resourceGroupName, frontDoorName, routingRuleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing Routing Rule with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, routingRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a new Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Routing Rule properties needed to create a new Front Door. - /// - public static RoutingRule BeginCreateOrUpdate(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName, RoutingRule routingRuleParameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters).GetAwaiter().GetResult(); - } - - /// - /// Creates a new Routing Rule with the specified Rule name within the - /// specified Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// Routing Rule properties needed to create a new Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName, RoutingRule routingRuleParameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, frontDoorName, routingRuleName, routingRuleParameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an existing Routing Rule with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - public static void BeginDelete(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName) - { - operations.BeginDeleteAsync(resourceGroupName, frontDoorName, routingRuleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an existing Routing Rule with the specified parameters. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the Resource group within the Azure subscription. - /// - /// - /// Name of the Front Door which is globally unique. - /// - /// - /// Name of the Routing Rule which is unique within the Front Door. - /// - /// - /// The cancellation token. - /// - public static async Task BeginDeleteAsync(this IRoutingRulesOperations operations, string resourceGroupName, string frontDoorName, string routingRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, frontDoorName, routingRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all of the Routing Rules within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByFrontDoorNext(this IRoutingRulesOperations operations, string nextPageLink) - { - return operations.ListByFrontDoorNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all of the Routing Rules within a Front Door. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByFrontDoorNextAsync(this IRoutingRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByFrontDoorNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/SdkInfo_FrontDoorManagementClient.cs b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/SdkInfo_FrontDoorManagementClient.cs index bed136bbe781..c258c1770414 100644 --- a/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/SdkInfo_FrontDoorManagementClient.cs +++ b/sdk/frontdoor/Microsoft.Azure.Management.FrontDoor/src/Generated/SdkInfo_FrontDoorManagementClient.cs @@ -19,17 +19,13 @@ public static IEnumerable> ApiInfo_FrontDoorManage { return new Tuple[] { - new Tuple("Network", "BackendPools", "2019-05-01"), new Tuple("Network", "CheckFrontDoorNameAvailability", "2019-05-01"), new Tuple("Network", "CheckFrontDoorNameAvailabilityWithSubscription", "2019-05-01"), new Tuple("Network", "Endpoints", "2019-05-01"), new Tuple("Network", "FrontDoors", "2019-05-01"), new Tuple("Network", "FrontendEndpoints", "2019-05-01"), - new Tuple("Network", "HealthProbeSettings", "2019-05-01"), - new Tuple("Network", "LoadBalancingSettings", "2019-05-01"), new Tuple("Network", "ManagedRuleSets", "2019-03-01"), new Tuple("Network", "Policies", "2019-03-01"), - new Tuple("Network", "RoutingRules", "2019-05-01"), }.AsEnumerable(); } } From 7ce402a917b3bc7528f3ab3029bee0faa72f9f9e Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2019 01:42:17 +0000 Subject: [PATCH 14/23] [AutoPR Microsoft.Azure.Management.Logic] [LogicApps] New Api version (#140) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * Generated from 56286b280dda0ebf76f171c8e4f7288e5ea5141b Fixed Resubmit trigger histories --- ...IIntegrationAccountAgreementsOperations.cs | 12 +- ...IIntegrationAccountAssembliesOperations.cs | 10 +- ...ionAccountBatchConfigurationsOperations.cs | 8 +- ...ntegrationAccountCertificatesOperations.cs | 10 +- .../IIntegrationAccountMapsOperations.cs | 12 +- .../IIntegrationAccountPartnersOperations.cs | 12 +- .../IIntegrationAccountSchemasOperations.cs | 12 +- .../IIntegrationAccountSessionsOperations.cs | 10 +- .../IIntegrationAccountsOperations.cs | 24 +- ...nServiceEnvironmentManagedApiOperations.cs | 77 + ...ServiceEnvironmentManagedApisOperations.cs | 208 ++ ...rviceEnvironmentNetworkHealthOperations.cs | 52 + ...grationServiceEnvironmentSkusOperations.cs | 74 + ...ntegrationServiceEnvironmentsOperations.cs | 299 +++ .../src/Generated/ILogicManagementClient.cs | 25 + ...IWorkflowRunActionRepetitionsOperations.cs | 6 +- ...flowRunActionScopeRepetitionsOperations.cs | 6 +- .../IWorkflowRunActionsOperations.cs | 8 +- .../src/Generated/IWorkflowRunOperations.cs | 2 +- .../src/Generated/IWorkflowRunsOperations.cs | 8 +- .../IWorkflowTriggerHistoriesOperations.cs | 37 +- .../Generated/IWorkflowTriggersOperations.cs | 14 +- .../IWorkflowVersionTriggersOperations.cs | 2 +- .../Generated/IWorkflowVersionsOperations.cs | 6 +- .../src/Generated/IWorkflowsOperations.cs | 62 +- .../IntegrationAccountAgreementsOperations.cs | 66 +- .../IntegrationAccountAssembliesOperations.cs | 55 +- ...ionAccountBatchConfigurationsOperations.cs | 44 +- ...ntegrationAccountCertificatesOperations.cs | 55 +- .../IntegrationAccountMapsOperations.cs | 66 +- .../IntegrationAccountPartnersOperations.cs | 66 +- .../IntegrationAccountSchemasOperations.cs | 66 +- .../IntegrationAccountSessionsOperations.cs | 55 +- .../IntegrationAccountsOperations.cs | 132 +- ...nServiceEnvironmentManagedApiOperations.cs | 422 ++++ ...vironmentManagedApiOperationsExtensions.cs | 105 + ...ServiceEnvironmentManagedApisOperations.cs | 1060 ++++++++++ ...ironmentManagedApisOperationsExtensions.cs | 323 +++ ...rviceEnvironmentNetworkHealthOperations.cs | 245 +++ ...onmentNetworkHealthOperationsExtensions.cs | 67 + ...grationServiceEnvironmentSkusOperations.cs | 413 ++++ ...viceEnvironmentSkusOperationsExtensions.cs | 99 + ...ntegrationServiceEnvironmentsOperations.cs | 1770 +++++++++++++++++ ...ServiceEnvironmentsOperationsExtensions.cs | 465 +++++ .../src/Generated/LogicManagementClient.cs | 32 +- .../AS2AcknowledgementConnectionSettings.cs | 30 +- .../src/Generated/Models/AS2ErrorSettings.cs | 10 +- .../src/Generated/Models/AS2MdnSettings.cs | 42 +- .../Generated/Models/AS2SecuritySettings.cs | 50 +- .../Models/ApiDeploymentParameterMetadata.cs | 87 + .../ApiDeploymentParameterMetadataSet.cs | 63 + .../ApiDeploymentParameterVisibility.cs | 23 + .../src/Generated/Models/ApiOperation.cs | 57 + .../Models/ApiOperationAnnotation.cs | 69 + .../ApiOperationPropertiesDefinition.cs | 152 ++ .../src/Generated/Models/ApiReference.cs | 106 + .../Models/ApiResourceBackendService.cs | 51 + .../Models/ApiResourceDefinitions.cs | 59 + .../Models/ApiResourceGeneralInformation.cs | 95 + .../Generated/Models/ApiResourceMetadata.cs | 139 ++ .../Generated/Models/ApiResourcePolicies.cs | 60 + .../Generated/Models/ApiResourceProperties.cs | 162 ++ .../src/Generated/Models/ApiTier.cs | 24 + .../src/Generated/Models/ApiType.cs | 23 + .../Models/AzureAsyncOperationState.cs | 24 + .../Models/EdifactValidationOverride.cs | 18 +- .../Models/EdifactValidationSettings.cs | 18 +- .../src/Generated/Models/ErrorResponseCode.cs | 24 + .../src/Generated/Models/Expression.cs | 7 + .../src/Generated/Models/ExpressionRoot.cs | 5 + .../src/Generated/Models/ExtendedErrorInfo.cs | 109 + .../src/Generated/Models/FlowEndpoints.cs | 62 + .../Models/FlowEndpointsConfiguration.cs | 59 + .../Generated/Models/IntegrationAccount.cs | 31 +- .../Models/IntegrationServiceEnvironment.cs | 70 + ...rationServiceEnvironmentAccessEndpoint.cs} | 24 +- ...ionServiceEnvironmentAccessEndpointType.cs | 23 + ...tionServiceEnvironmentNetworkDependency.cs | 82 + ...nvironmentNetworkDependencyCategoryType.cs | 33 + ...rviceEnvironmentNetworkDependencyHealth.cs | 78 + ...EnvironmentNetworkDependencyHealthState.cs | 25 + ...onmentNetworkEndPointAccessibilityState.cs | 25 + ...rationServiceEnvironmentNetworkEndpoint.cs | 74 + ...IntegrationServiceEnvironmentProperties.cs | 100 + .../IntegrationServiceEnvironmentSku.cs | 63 + ...ntegrationServiceEnvironmentSkuCapacity.cs | 79 + ...egrationServiceEnvironmentSkuDefinition.cs | 69 + ...ationServiceEnvironmentSkuDefinitionSku.cs | 63 + .../IntegrationServiceEnvironmentSkuName.cs | 23 + ...tegrationServiceEnvironmentSkuScaleType.cs | 23 + ...onServiceEnvironmentSubnetNetworkHealth.cs | 95 + .../src/Generated/Models/IpAddress.cs | 51 + .../src/Generated/Models/ManagedApi.cs | 59 + .../Generated/Models/NetworkConfiguration.cs | 70 + .../Models/SetTriggerStateActionDefinition.cs | 5 + .../src/Generated/Models/StatusAnnotation.cs | 23 + .../Models/SwaggerCustomDynamicList.cs | 102 + .../Models/SwaggerCustomDynamicProperties.cs | 74 + .../Models/SwaggerCustomDynamicSchema.cs | 72 + .../Models/SwaggerCustomDynamicTree.cs | 67 + .../Models/SwaggerCustomDynamicTreeCommand.cs | 123 ++ .../SwaggerCustomDynamicTreeParameter.cs | 81 + .../SwaggerCustomDynamicTreeSettings.cs | 63 + .../Models/SwaggerExternalDocumentation.cs | 71 + .../src/Generated/Models/SwaggerSchema.cs | 222 +++ .../src/Generated/Models/SwaggerSchemaType.cs | 28 + .../src/Generated/Models/SwaggerXml.cs | 97 + .../src/Generated/Models/TrackingEvent.cs | 28 +- .../Models/TrackingEventErrorInfo.cs | 7 + .../Models/TrackingEventsDefinition.cs | 15 +- .../src/Generated/Models/Workflow.cs | 20 +- .../Models/WorkflowTriggerHistory.cs | 4 +- .../src/Generated/Models/WsdlImportMethod.cs | 23 + .../src/Generated/Models/WsdlService.cs | 62 + .../Generated/Models/X12ValidationOverride.cs | 18 +- .../Generated/Models/X12ValidationSettings.cs | 18 +- .../SdkInfo_LogicManagementClient.cs | 60 +- .../WorkflowRunActionRepetitionsOperations.cs | 33 +- ...flowRunActionScopeRepetitionsOperations.cs | 28 +- ...ionScopeRepetitionsOperationsExtensions.cs | 6 +- .../Generated/WorkflowRunActionsOperations.cs | 44 +- .../src/Generated/WorkflowRunOperations.cs | 11 +- .../src/Generated/WorkflowRunsOperations.cs | 44 +- .../WorkflowTriggerHistoriesOperations.cs | 77 +- ...lowTriggerHistoriesOperationsExtensions.cs | 51 + .../Generated/WorkflowTriggersOperations.cs | 77 +- .../WorkflowVersionTriggersOperations.cs | 11 +- .../Generated/WorkflowVersionsOperations.cs | 33 +- .../src/Generated/WorkflowsOperations.cs | 336 ++-- .../WorkflowsOperationsExtensions.cs | 55 +- 130 files changed, 10306 insertions(+), 1173 deletions(-) create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentManagedApiOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentManagedApisOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentNetworkHealthOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentSkusOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentsOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApiOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApiOperationsExtensions.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApisOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApisOperationsExtensions.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentNetworkHealthOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentNetworkHealthOperationsExtensions.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentSkusOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentSkusOperationsExtensions.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentsOperations.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentsOperationsExtensions.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterMetadata.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterMetadataSet.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterVisibility.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperation.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperationAnnotation.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperationPropertiesDefinition.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiReference.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceBackendService.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceDefinitions.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceGeneralInformation.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceMetadata.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourcePolicies.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceProperties.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiTier.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiType.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AzureAsyncOperationState.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ErrorResponseCode.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ExtendedErrorInfo.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/FlowEndpoints.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/FlowEndpointsConfiguration.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironment.cs rename sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/{WorkflowRunActionRepetitionDefinitionCollection.cs => IntegrationServiceEnvironmentAccessEndpoint.cs} (55%) create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentAccessEndpointType.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependency.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyCategoryType.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyHealth.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyHealthState.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkEndPointAccessibilityState.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkEndpoint.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentProperties.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSku.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuCapacity.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuDefinition.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuDefinitionSku.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuName.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuScaleType.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSubnetNetworkHealth.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IpAddress.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ManagedApi.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/NetworkConfiguration.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/StatusAnnotation.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicList.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicProperties.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicSchema.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTree.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeCommand.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeParameter.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeSettings.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerExternalDocumentation.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerSchema.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerSchemaType.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerXml.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WsdlImportMethod.cs create mode 100644 sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WsdlService.cs diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountAgreementsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountAgreementsOperations.cs index 21a75bf418ac..19017a70318d 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountAgreementsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountAgreementsOperations.cs @@ -42,7 +42,7 @@ public partial interface IIntegrationAccountAgreementsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,7 @@ public partial interface IIntegrationAccountAgreementsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ public partial interface IIntegrationAccountAgreementsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ public partial interface IIntegrationAccountAgreementsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -156,7 +156,7 @@ public partial interface IIntegrationAccountAgreementsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -178,7 +178,7 @@ public partial interface IIntegrationAccountAgreementsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountAssembliesOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountAssembliesOperations.cs index 60eee3d58759..43d1cd68b4ab 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountAssembliesOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountAssembliesOperations.cs @@ -38,7 +38,7 @@ public partial interface IIntegrationAccountAssembliesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -66,7 +66,7 @@ public partial interface IIntegrationAccountAssembliesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,7 @@ public partial interface IIntegrationAccountAssembliesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -125,7 +125,7 @@ public partial interface IIntegrationAccountAssembliesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -150,7 +150,7 @@ public partial interface IIntegrationAccountAssembliesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountBatchConfigurationsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountBatchConfigurationsOperations.cs index eb36e89cf78e..145eda7f63c1 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountBatchConfigurationsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountBatchConfigurationsOperations.cs @@ -38,7 +38,7 @@ public partial interface IIntegrationAccountBatchConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -66,7 +66,7 @@ public partial interface IIntegrationAccountBatchConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,7 @@ public partial interface IIntegrationAccountBatchConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -125,7 +125,7 @@ public partial interface IIntegrationAccountBatchConfigurationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountCertificatesOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountCertificatesOperations.cs index 423ca7004dc3..a16599dfb6d2 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountCertificatesOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountCertificatesOperations.cs @@ -41,7 +41,7 @@ public partial interface IIntegrationAccountCertificatesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -69,7 +69,7 @@ public partial interface IIntegrationAccountCertificatesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -100,7 +100,7 @@ public partial interface IIntegrationAccountCertificatesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -128,7 +128,7 @@ public partial interface IIntegrationAccountCertificatesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -147,7 +147,7 @@ public partial interface IIntegrationAccountCertificatesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountMapsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountMapsOperations.cs index d38e0db763b8..e560f03cd655 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountMapsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountMapsOperations.cs @@ -42,7 +42,7 @@ public partial interface IIntegrationAccountMapsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,7 @@ public partial interface IIntegrationAccountMapsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ public partial interface IIntegrationAccountMapsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ public partial interface IIntegrationAccountMapsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -156,7 +156,7 @@ public partial interface IIntegrationAccountMapsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -178,7 +178,7 @@ public partial interface IIntegrationAccountMapsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountPartnersOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountPartnersOperations.cs index 7adcd632ed9e..e1dbf0aa43b2 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountPartnersOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountPartnersOperations.cs @@ -42,7 +42,7 @@ public partial interface IIntegrationAccountPartnersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,7 @@ public partial interface IIntegrationAccountPartnersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ public partial interface IIntegrationAccountPartnersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ public partial interface IIntegrationAccountPartnersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -156,7 +156,7 @@ public partial interface IIntegrationAccountPartnersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -178,7 +178,7 @@ public partial interface IIntegrationAccountPartnersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountSchemasOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountSchemasOperations.cs index 3784b6590ee8..5d5bad73d6ff 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountSchemasOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountSchemasOperations.cs @@ -42,7 +42,7 @@ public partial interface IIntegrationAccountSchemasOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,7 @@ public partial interface IIntegrationAccountSchemasOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ public partial interface IIntegrationAccountSchemasOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ public partial interface IIntegrationAccountSchemasOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -156,7 +156,7 @@ public partial interface IIntegrationAccountSchemasOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -178,7 +178,7 @@ public partial interface IIntegrationAccountSchemasOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountSessionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountSessionsOperations.cs index 55ecb8781601..6b7fb5de8ef2 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountSessionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountSessionsOperations.cs @@ -42,7 +42,7 @@ public partial interface IIntegrationAccountSessionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,7 @@ public partial interface IIntegrationAccountSessionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ public partial interface IIntegrationAccountSessionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ public partial interface IIntegrationAccountSessionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -148,7 +148,7 @@ public partial interface IIntegrationAccountSessionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountsOperations.cs index 2f9d55ce0062..4c1d89abd615 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationAccountsOperations.cs @@ -35,7 +35,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -60,7 +60,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -85,7 +85,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -113,7 +113,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -141,7 +141,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -166,7 +166,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -191,7 +191,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -219,7 +219,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -247,7 +247,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -272,7 +272,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -294,7 +294,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -316,7 +316,7 @@ public partial interface IIntegrationAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentManagedApiOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentManagedApiOperations.cs new file mode 100644 index 000000000000..6c085591d44f --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentManagedApiOperations.cs @@ -0,0 +1,77 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IntegrationServiceEnvironmentManagedApiOperations operations. + /// + public partial interface IIntegrationServiceEnvironmentManagedApiOperations + { + /// + /// Gets the managed Api operations. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the managed Api operations. + /// + /// + /// 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)); + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentManagedApisOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentManagedApisOperations.cs new file mode 100644 index 000000000000..2026efc0138c --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentManagedApisOperations.cs @@ -0,0 +1,208 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IntegrationServiceEnvironmentManagedApisOperations operations. + /// + public partial interface IIntegrationServiceEnvironmentManagedApisOperations + { + /// + /// Gets the integration service environment managed Apis. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the integration service environment managed Api. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Puts the integration service environment managed Api. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// 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> PutWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the integration service environment managed Api. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Puts the integration service environment managed Api. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// 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> BeginPutWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the integration service environment managed Api. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the integration service environment managed Apis. + /// + /// + /// 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)); + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentNetworkHealthOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentNetworkHealthOperations.cs new file mode 100644 index 000000000000..2a43115ea41b --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentNetworkHealthOperations.cs @@ -0,0 +1,52 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IntegrationServiceEnvironmentNetworkHealthOperations operations. + /// + public partial interface IIntegrationServiceEnvironmentNetworkHealthOperations + { + /// + /// Gets the integration service environment network health. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentSkusOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentSkusOperations.cs new file mode 100644 index 000000000000..f92caad0ebad --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentSkusOperations.cs @@ -0,0 +1,74 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IntegrationServiceEnvironmentSkusOperations operations. + /// + public partial interface IIntegrationServiceEnvironmentSkusOperations + { + /// + /// Gets a list of integration service environment Skus. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of integration service environment Skus. + /// + /// + /// 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)); + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentsOperations.cs new file mode 100644 index 000000000000..9701220aa3a7 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IIntegrationServiceEnvironmentsOperations.cs @@ -0,0 +1,299 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IntegrationServiceEnvironmentsOperations operations. + /// + public partial interface IIntegrationServiceEnvironmentsOperations + { + /// + /// Gets a list of integration service environments by subscription. + /// + /// + /// The number of items to be included in the result. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of integration service environments by resource group. + /// + /// + /// The resource group. + /// + /// + /// The number of items to be included in the result. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroup, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Restarts an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RestartWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of integration service environments by subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of integration service environments by resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/ILogicManagementClient.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/ILogicManagementClient.cs index b784090d0814..bf6c3f33c98c 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/ILogicManagementClient.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/ILogicManagementClient.cs @@ -174,6 +174,31 @@ public partial interface ILogicManagementClient : System.IDisposable /// IIntegrationAccountSessionsOperations IntegrationAccountSessions { get; } + /// + /// Gets the IIntegrationServiceEnvironmentsOperations. + /// + IIntegrationServiceEnvironmentsOperations IntegrationServiceEnvironments { get; } + + /// + /// Gets the IIntegrationServiceEnvironmentSkusOperations. + /// + IIntegrationServiceEnvironmentSkusOperations IntegrationServiceEnvironmentSkus { get; } + + /// + /// Gets the IIntegrationServiceEnvironmentNetworkHealthOperations. + /// + IIntegrationServiceEnvironmentNetworkHealthOperations IntegrationServiceEnvironmentNetworkHealth { get; } + + /// + /// Gets the IIntegrationServiceEnvironmentManagedApisOperations. + /// + IIntegrationServiceEnvironmentManagedApisOperations IntegrationServiceEnvironmentManagedApis { get; } + + /// + /// Gets the IIntegrationServiceEnvironmentManagedApiOperations. + /// + IIntegrationServiceEnvironmentManagedApiOperations IntegrationServiceEnvironmentManagedApiOperations { get; } + /// /// Gets the IOperations. /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionRepetitionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionRepetitionsOperations.cs index cd2e42f24f5d..db56db283c33 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionRepetitionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionRepetitionsOperations.cs @@ -44,7 +44,7 @@ public partial interface IWorkflowRunActionRepetitionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -78,7 +78,7 @@ public partial interface IWorkflowRunActionRepetitionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -112,7 +112,7 @@ public partial interface IWorkflowRunActionRepetitionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionScopeRepetitionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionScopeRepetitionsOperations.cs index cfe3b21fb3e5..e89234647aac 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionScopeRepetitionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionScopeRepetitionsOperations.cs @@ -44,7 +44,7 @@ public partial interface IWorkflowRunActionScopeRepetitionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -53,7 +53,7 @@ public partial interface IWorkflowRunActionScopeRepetitionsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string workflowName, string runName, string actionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workflowName, string runName, string actionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get a workflow run action scoped repetition. /// @@ -78,7 +78,7 @@ public partial interface IWorkflowRunActionScopeRepetitionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionsOperations.cs index 4c588f0e333a..5cd765001408 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunActionsOperations.cs @@ -45,7 +45,7 @@ public partial interface IWorkflowRunActionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,7 +76,7 @@ public partial interface IWorkflowRunActionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -107,7 +107,7 @@ public partial interface IWorkflowRunActionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ public partial interface IWorkflowRunActionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunOperations.cs index 5bbf9ceb55e2..d17e2ed4a221 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunOperations.cs @@ -44,7 +44,7 @@ public partial interface IWorkflowRunOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunsOperations.cs index 0f151d0e3079..36e7366b21b2 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowRunsOperations.cs @@ -42,7 +42,7 @@ public partial interface IWorkflowRunsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,7 @@ public partial interface IWorkflowRunsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -98,7 +98,7 @@ public partial interface IWorkflowRunsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -117,7 +117,7 @@ public partial interface IWorkflowRunsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowTriggerHistoriesOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowTriggerHistoriesOperations.cs index 81b2005df927..e6d7ae73c210 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowTriggerHistoriesOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowTriggerHistoriesOperations.cs @@ -45,7 +45,7 @@ public partial interface IWorkflowTriggerHistoriesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -77,7 +77,7 @@ public partial interface IWorkflowTriggerHistoriesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -109,7 +109,7 @@ public partial interface IWorkflowTriggerHistoriesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -117,6 +117,35 @@ public partial interface IWorkflowTriggerHistoriesOperations /// Task ResubmitWithHttpMessagesAsync(string resourceGroupName, string workflowName, string triggerName, string historyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Resubmits a workflow run based on the trigger history. + /// + /// + /// The resource group name. + /// + /// + /// The workflow name. + /// + /// + /// The workflow trigger name. + /// + /// + /// The workflow trigger history name. Corresponds to the run name for + /// triggers that resulted in a run. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginResubmitWithHttpMessagesAsync(string resourceGroupName, string workflowName, string triggerName, string historyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Gets a list of workflow trigger histories. /// /// @@ -128,7 +157,7 @@ public partial interface IWorkflowTriggerHistoriesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowTriggersOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowTriggersOperations.cs index 407afbbfefe1..0daf9dc43e2f 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowTriggersOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowTriggersOperations.cs @@ -42,7 +42,7 @@ public partial interface IWorkflowTriggersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,7 @@ public partial interface IWorkflowTriggersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -98,7 +98,7 @@ public partial interface IWorkflowTriggersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -148,7 +148,7 @@ public partial interface IWorkflowTriggersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -179,7 +179,7 @@ public partial interface IWorkflowTriggersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -204,7 +204,7 @@ public partial interface IWorkflowTriggersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -226,7 +226,7 @@ public partial interface IWorkflowTriggersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowVersionTriggersOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowVersionTriggersOperations.cs index e81be1742f2d..622ef174c2a9 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowVersionTriggersOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowVersionTriggersOperations.cs @@ -47,7 +47,7 @@ public partial interface IWorkflowVersionTriggersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowVersionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowVersionsOperations.cs index f071e4eacf13..936a08712ffb 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowVersionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowVersionsOperations.cs @@ -41,7 +41,7 @@ public partial interface IWorkflowVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -69,7 +69,7 @@ public partial interface IWorkflowVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -91,7 +91,7 @@ public partial interface IWorkflowVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowsOperations.cs index 704498aa5bc4..5f10fe8699e3 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IWorkflowsOperations.cs @@ -36,7 +36,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -61,7 +61,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -86,7 +86,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -114,7 +114,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -142,7 +142,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -167,7 +167,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -189,7 +189,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -211,7 +211,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -236,7 +236,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -264,7 +264,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -289,7 +289,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -317,7 +317,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -342,7 +342,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -367,7 +367,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -386,8 +386,30 @@ public partial interface IWorkflowsOperations /// /// The workflow name. /// - /// - /// The workflow definition. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ValidateByLocationWithHttpMessagesAsync(string resourceGroupName, string location, string workflowName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Moves an existing workflow. + /// + /// + /// The resource group name. + /// + /// + /// The workflow name. + /// + /// + /// The workflow to move. /// /// /// The headers that will be added to request. @@ -395,13 +417,13 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// - Task ValidateByLocationWithHttpMessagesAsync(string resourceGroupName, string location, string workflowName, Workflow workflow, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginMoveWithHttpMessagesAsync(string resourceGroupName, string workflowName, Workflow move, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a list of workflows by subscription. /// @@ -414,7 +436,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -436,7 +458,7 @@ public partial interface IWorkflowsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountAgreementsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountAgreementsOperations.cs index dd257a6f0dc8..37c0a88e7fa5 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountAgreementsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountAgreementsOperations.cs @@ -69,7 +69,7 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -194,14 +194,13 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +210,6 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -277,7 +272,7 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -399,14 +394,13 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -416,10 +410,6 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -485,7 +475,7 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -622,14 +612,13 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -639,10 +628,6 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -723,7 +708,7 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -842,14 +827,13 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -859,10 +843,6 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -909,7 +889,7 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1042,14 +1022,13 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1059,10 +1038,6 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1119,7 +1094,7 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1215,14 +1190,13 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1232,10 +1206,6 @@ internal IntegrationAccountAgreementsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountAssembliesOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountAssembliesOperations.cs index f8ae35d8add5..2430b1b772cc 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountAssembliesOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountAssembliesOperations.cs @@ -65,7 +65,7 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -181,14 +181,13 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -198,10 +197,6 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -264,7 +259,7 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -386,14 +381,13 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -403,10 +397,6 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -472,7 +462,7 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -609,14 +599,13 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -626,10 +615,6 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -710,7 +695,7 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -829,14 +814,13 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -846,10 +830,6 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -894,7 +874,7 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1016,14 +996,13 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1033,10 +1012,6 @@ internal IntegrationAccountAssembliesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountBatchConfigurationsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountBatchConfigurationsOperations.cs index 6027949f6568..1ad05480800c 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountBatchConfigurationsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountBatchConfigurationsOperations.cs @@ -65,7 +65,7 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -181,14 +181,13 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -198,10 +197,6 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -264,7 +259,7 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -386,14 +381,13 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -403,10 +397,6 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -472,7 +462,7 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -609,14 +599,13 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -626,10 +615,6 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -710,7 +695,7 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -829,14 +814,13 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -846,10 +830,6 @@ internal IntegrationAccountBatchConfigurationsOperations(LogicManagementClient c } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountCertificatesOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountCertificatesOperations.cs index 8ce50ba5d997..1ac9ea2ff879 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountCertificatesOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountCertificatesOperations.cs @@ -68,7 +68,7 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -189,14 +189,13 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -206,10 +205,6 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -272,7 +267,7 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -394,14 +389,13 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -411,10 +405,6 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -480,7 +470,7 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -617,14 +607,13 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -634,10 +623,6 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -718,7 +703,7 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -837,14 +822,13 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -854,10 +838,6 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -896,7 +876,7 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -992,14 +972,13 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1009,10 +988,6 @@ internal IntegrationAccountCertificatesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountMapsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountMapsOperations.cs index 93afbc6d0539..ea53f52adc83 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountMapsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountMapsOperations.cs @@ -69,7 +69,7 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -194,14 +194,13 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +210,6 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -277,7 +272,7 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -399,14 +394,13 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -416,10 +410,6 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -485,7 +475,7 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -622,14 +612,13 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -639,10 +628,6 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -723,7 +708,7 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -842,14 +827,13 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -859,10 +843,6 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -909,7 +889,7 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1042,14 +1022,13 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1059,10 +1038,6 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1119,7 +1094,7 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1215,14 +1190,13 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1232,10 +1206,6 @@ internal IntegrationAccountMapsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountPartnersOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountPartnersOperations.cs index 9d055dfac25d..d2757bc0b1a7 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountPartnersOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountPartnersOperations.cs @@ -69,7 +69,7 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -194,14 +194,13 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +210,6 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -277,7 +272,7 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -399,14 +394,13 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -416,10 +410,6 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -485,7 +475,7 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -622,14 +612,13 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -639,10 +628,6 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -723,7 +708,7 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -842,14 +827,13 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -859,10 +843,6 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -909,7 +889,7 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1042,14 +1022,13 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1059,10 +1038,6 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1119,7 +1094,7 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1215,14 +1190,13 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1232,10 +1206,6 @@ internal IntegrationAccountPartnersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountSchemasOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountSchemasOperations.cs index 7a753e8ed044..257548df37b7 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountSchemasOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountSchemasOperations.cs @@ -69,7 +69,7 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -194,14 +194,13 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +210,6 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -277,7 +272,7 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -399,14 +394,13 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -416,10 +410,6 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -485,7 +475,7 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -622,14 +612,13 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -639,10 +628,6 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -723,7 +708,7 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -842,14 +827,13 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -859,10 +843,6 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -909,7 +889,7 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1042,14 +1022,13 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1059,10 +1038,6 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1119,7 +1094,7 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1215,14 +1190,13 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1232,10 +1206,6 @@ internal IntegrationAccountSchemasOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountSessionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountSessionsOperations.cs index f2d60300c51a..88067fce9a2c 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountSessionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountSessionsOperations.cs @@ -69,7 +69,7 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -194,14 +194,13 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +210,6 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -277,7 +272,7 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -399,14 +394,13 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -416,10 +410,6 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -485,7 +475,7 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -618,14 +608,13 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -635,10 +624,6 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -719,7 +704,7 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -838,14 +823,13 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -855,10 +839,6 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -897,7 +877,7 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -993,14 +973,13 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1010,10 +989,6 @@ internal IntegrationAccountSessionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountsOperations.cs index c3ba4844be32..31799683b64d 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationAccountsOperations.cs @@ -62,7 +62,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -171,14 +171,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -188,10 +187,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -251,7 +246,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -366,14 +361,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -383,10 +377,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -446,7 +436,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -562,14 +552,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -579,10 +568,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -645,7 +630,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -776,14 +761,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -793,10 +777,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -877,7 +857,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1004,14 +984,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1021,10 +1000,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1084,7 +1059,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1197,14 +1172,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1214,10 +1188,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1262,7 +1232,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1389,14 +1359,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1406,10 +1375,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1472,7 +1437,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1603,14 +1568,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1620,10 +1584,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1686,7 +1646,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1814,14 +1774,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1831,10 +1790,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1879,7 +1834,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2006,14 +1961,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2023,10 +1977,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2083,7 +2033,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2179,14 +2129,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2196,10 +2145,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2256,7 +2201,7 @@ internal IntegrationAccountsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2352,14 +2297,13 @@ internal IntegrationAccountsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2369,10 +2313,6 @@ internal IntegrationAccountsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApiOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApiOperations.cs new file mode 100644 index 000000000000..b69f1a4f883b --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApiOperations.cs @@ -0,0 +1,422 @@ +// +// 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.Logic +{ + 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; + + /// + /// IntegrationServiceEnvironmentManagedApiOperations operations. + /// + internal partial class IntegrationServiceEnvironmentManagedApiOperations : IServiceOperations, IIntegrationServiceEnvironmentManagedApiOperations + { + /// + /// Initializes a new instance of the IntegrationServiceEnvironmentManagedApiOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IntegrationServiceEnvironmentManagedApiOperations(LogicManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the LogicManagementClient + /// + public LogicManagementClient Client { get; private set; } + + /// + /// Gets the managed Api operations. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (apiName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "apiName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("apiName", apiName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + _url = _url.Replace("{apiName}", System.Uri.EscapeDataString(apiName)); + 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 the managed Api operations. + /// + /// + /// 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; + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApiOperationsExtensions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApiOperationsExtensions.cs new file mode 100644 index 000000000000..2dabb0bbbb27 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApiOperationsExtensions.cs @@ -0,0 +1,105 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for IntegrationServiceEnvironmentManagedApiOperations. + /// + public static partial class IntegrationServiceEnvironmentManagedApiOperationsExtensions + { + /// + /// Gets the managed Api operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + public static IPage List(this IIntegrationServiceEnvironmentManagedApiOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName) + { + return operations.ListAsync(resourceGroup, integrationServiceEnvironmentName, apiName).GetAwaiter().GetResult(); + } + + /// + /// Gets the managed Api operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IIntegrationServiceEnvironmentManagedApiOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, apiName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the managed Api operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IIntegrationServiceEnvironmentManagedApiOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the managed Api operations. + /// + /// + /// 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 IIntegrationServiceEnvironmentManagedApiOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApisOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApisOperations.cs new file mode 100644 index 000000000000..7ca5bdcd0224 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApisOperations.cs @@ -0,0 +1,1060 @@ +// +// 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.Logic +{ + 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; + + /// + /// IntegrationServiceEnvironmentManagedApisOperations operations. + /// + internal partial class IntegrationServiceEnvironmentManagedApisOperations : IServiceOperations, IIntegrationServiceEnvironmentManagedApisOperations + { + /// + /// Initializes a new instance of the IntegrationServiceEnvironmentManagedApisOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IntegrationServiceEnvironmentManagedApisOperations(LogicManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the LogicManagementClient + /// + public LogicManagementClient Client { get; private set; } + + /// + /// Gets the integration service environment managed Apis. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + 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 the integration service environment managed Api. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (apiName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "apiName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("apiName", apiName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + _url = _url.Replace("{apiName}", System.Uri.EscapeDataString(apiName)); + 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; + } + + /// + /// Puts the integration service environment managed Api. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> PutWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginPutWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, apiName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the integration service environment managed Api. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, apiName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Puts the integration service environment managed Api. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// 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> BeginPutWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (apiName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "apiName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("apiName", apiName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginPut", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + _url = _url.Replace("{apiName}", System.Uri.EscapeDataString(apiName)); + 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; + // 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 != 201) + { + 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _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; + } + + /// + /// Deletes the integration service environment managed Api. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, string apiName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (apiName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "apiName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("apiName", apiName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + _url = _url.Replace("{apiName}", System.Uri.EscapeDataString(apiName)); + 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("DELETE"); + _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 != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the integration service environment managed Apis. + /// + /// + /// 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; + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApisOperationsExtensions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApisOperationsExtensions.cs new file mode 100644 index 000000000000..5e499ea16c5d --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentManagedApisOperationsExtensions.cs @@ -0,0 +1,323 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for IntegrationServiceEnvironmentManagedApisOperations. + /// + public static partial class IntegrationServiceEnvironmentManagedApisOperationsExtensions + { + /// + /// Gets the integration service environment managed Apis. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + public static IPage List(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName) + { + return operations.ListAsync(resourceGroup, integrationServiceEnvironmentName).GetAwaiter().GetResult(); + } + + /// + /// Gets the integration service environment managed Apis. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + public static ManagedApi Get(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName) + { + return operations.GetAsync(resourceGroup, integrationServiceEnvironmentName, apiName).GetAwaiter().GetResult(); + } + + /// + /// Gets the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, apiName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Puts the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + public static ManagedApi Put(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName) + { + return operations.PutAsync(resourceGroup, integrationServiceEnvironmentName, apiName).GetAwaiter().GetResult(); + } + + /// + /// Puts the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The cancellation token. + /// + public static async Task PutAsync(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, apiName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + public static void Delete(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName) + { + operations.DeleteAsync(resourceGroup, integrationServiceEnvironmentName, apiName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, apiName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Puts the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + public static ManagedApi BeginPut(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName) + { + return operations.BeginPutAsync(resourceGroup, integrationServiceEnvironmentName, apiName).GetAwaiter().GetResult(); + } + + /// + /// Puts the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginPutAsync(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginPutWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, apiName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + public static void BeginDelete(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName) + { + operations.BeginDeleteAsync(resourceGroup, integrationServiceEnvironmentName, apiName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the integration service environment managed Api. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The api name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IIntegrationServiceEnvironmentManagedApisOperations operations, string resourceGroup, string integrationServiceEnvironmentName, string apiName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, apiName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the integration service environment managed Apis. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IIntegrationServiceEnvironmentManagedApisOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the integration service environment managed Apis. + /// + /// + /// 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 IIntegrationServiceEnvironmentManagedApisOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentNetworkHealthOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentNetworkHealthOperations.cs new file mode 100644 index 000000000000..076cdc27d32f --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentNetworkHealthOperations.cs @@ -0,0 +1,245 @@ +// +// 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.Logic +{ + 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; + + /// + /// IntegrationServiceEnvironmentNetworkHealthOperations operations. + /// + internal partial class IntegrationServiceEnvironmentNetworkHealthOperations : IServiceOperations, IIntegrationServiceEnvironmentNetworkHealthOperations + { + /// + /// Initializes a new instance of the IntegrationServiceEnvironmentNetworkHealthOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IntegrationServiceEnvironmentNetworkHealthOperations(LogicManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the LogicManagementClient + /// + public LogicManagementClient Client { get; private set; } + + /// + /// Gets the integration service environment network health. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// 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>> GetWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + 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; + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentNetworkHealthOperationsExtensions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentNetworkHealthOperationsExtensions.cs new file mode 100644 index 000000000000..cfb2e6213a08 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentNetworkHealthOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for IntegrationServiceEnvironmentNetworkHealthOperations. + /// + public static partial class IntegrationServiceEnvironmentNetworkHealthOperationsExtensions + { + /// + /// Gets the integration service environment network health. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + public static IDictionary Get(this IIntegrationServiceEnvironmentNetworkHealthOperations operations, string resourceGroup, string integrationServiceEnvironmentName) + { + return operations.GetAsync(resourceGroup, integrationServiceEnvironmentName).GetAwaiter().GetResult(); + } + + /// + /// Gets the integration service environment network health. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The cancellation token. + /// + public static async Task> GetAsync(this IIntegrationServiceEnvironmentNetworkHealthOperations operations, string resourceGroup, string integrationServiceEnvironmentName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentSkusOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentSkusOperations.cs new file mode 100644 index 000000000000..cf82316ae70c --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentSkusOperations.cs @@ -0,0 +1,413 @@ +// +// 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.Logic +{ + 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; + + /// + /// IntegrationServiceEnvironmentSkusOperations operations. + /// + internal partial class IntegrationServiceEnvironmentSkusOperations : IServiceOperations, IIntegrationServiceEnvironmentSkusOperations + { + /// + /// Initializes a new instance of the IntegrationServiceEnvironmentSkusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IntegrationServiceEnvironmentSkusOperations(LogicManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the LogicManagementClient + /// + public LogicManagementClient Client { get; private set; } + + /// + /// Gets a list of integration service environment Skus. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + 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 list of integration service environment Skus. + /// + /// + /// 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; + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentSkusOperationsExtensions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentSkusOperationsExtensions.cs new file mode 100644 index 000000000000..86dff7a85e80 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentSkusOperationsExtensions.cs @@ -0,0 +1,99 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for IntegrationServiceEnvironmentSkusOperations. + /// + public static partial class IntegrationServiceEnvironmentSkusOperationsExtensions + { + /// + /// Gets a list of integration service environment Skus. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + public static IPage List(this IIntegrationServiceEnvironmentSkusOperations operations, string resourceGroup, string integrationServiceEnvironmentName) + { + return operations.ListAsync(resourceGroup, integrationServiceEnvironmentName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of integration service environment Skus. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IIntegrationServiceEnvironmentSkusOperations operations, string resourceGroup, string integrationServiceEnvironmentName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of integration service environment Skus. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IIntegrationServiceEnvironmentSkusOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of integration service environment Skus. + /// + /// + /// 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 IIntegrationServiceEnvironmentSkusOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentsOperations.cs new file mode 100644 index 000000000000..04c202ca93b7 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentsOperations.cs @@ -0,0 +1,1770 @@ +// +// 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.Logic +{ + 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; + + /// + /// IntegrationServiceEnvironmentsOperations operations. + /// + internal partial class IntegrationServiceEnvironmentsOperations : IServiceOperations, IIntegrationServiceEnvironmentsOperations + { + /// + /// Initializes a new instance of the IntegrationServiceEnvironmentsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IntegrationServiceEnvironmentsOperations(LogicManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the LogicManagementClient + /// + public LogicManagementClient Client { get; private set; } + + /// + /// Gets a list of integration service environments by subscription. + /// + /// + /// The number of items to be included in the result. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), 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"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("top", top); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments").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 (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + 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 list of integration service environments by resource group. + /// + /// + /// The resource group. + /// + /// + /// The number of items to be included in the result. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroup, int? top = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("top", top); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + 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 an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + 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; + } + + /// + /// Creates or updates an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + 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("DELETE"); + _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 != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Restarts an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 RestartWithHttpMessagesAsync(string resourceGroup, string integrationServiceEnvironmentName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Restart", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + 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) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (integrationServiceEnvironment == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironment"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("integrationServiceEnvironment", integrationServiceEnvironment); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + 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(integrationServiceEnvironment != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(integrationServiceEnvironment, 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 != 201) + { + 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _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; + } + + /// + /// Updates an integration service environment. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// 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 resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroup"); + } + if (integrationServiceEnvironmentName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironmentName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (integrationServiceEnvironment == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "integrationServiceEnvironment"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroup", resourceGroup); + tracingParameters.Add("integrationServiceEnvironmentName", integrationServiceEnvironmentName); + tracingParameters.Add("integrationServiceEnvironment", integrationServiceEnvironment); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroup}", System.Uri.EscapeDataString(resourceGroup)); + _url = _url.Replace("{integrationServiceEnvironmentName}", System.Uri.EscapeDataString(integrationServiceEnvironmentName)); + 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(integrationServiceEnvironment != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(integrationServiceEnvironment, 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; + } + + /// + /// Gets a list of integration service environments by subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", 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; + } + + /// + /// Gets a list of integration service environments by resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", 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/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentsOperationsExtensions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentsOperationsExtensions.cs new file mode 100644 index 000000000000..19c23e32864c --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/IntegrationServiceEnvironmentsOperationsExtensions.cs @@ -0,0 +1,465 @@ +// +// 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.Logic +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for IntegrationServiceEnvironmentsOperations. + /// + public static partial class IntegrationServiceEnvironmentsOperationsExtensions + { + /// + /// Gets a list of integration service environments by subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The number of items to be included in the result. + /// + public static IPage ListBySubscription(this IIntegrationServiceEnvironmentsOperations operations, int? top = default(int?)) + { + return operations.ListBySubscriptionAsync(top).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of integration service environments by subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The number of items to be included in the result. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IIntegrationServiceEnvironmentsOperations operations, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of integration service environments by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The number of items to be included in the result. + /// + public static IPage ListByResourceGroup(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, int? top = default(int?)) + { + return operations.ListByResourceGroupAsync(resourceGroup, top).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of integration service environments by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The number of items to be included in the result. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, int? top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroup, top, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + public static IntegrationServiceEnvironment Get(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName) + { + return operations.GetAsync(resourceGroup, integrationServiceEnvironmentName).GetAwaiter().GetResult(); + } + + /// + /// Gets an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + public static IntegrationServiceEnvironment CreateOrUpdate(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment) + { + return operations.CreateOrUpdateAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + public static IntegrationServiceEnvironment Update(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment) + { + return operations.UpdateAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment).GetAwaiter().GetResult(); + } + + /// + /// Updates an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + public static void Delete(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName) + { + operations.DeleteAsync(resourceGroup, integrationServiceEnvironmentName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Restarts an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + public static void Restart(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName) + { + operations.RestartAsync(resourceGroup, integrationServiceEnvironmentName).GetAwaiter().GetResult(); + } + + /// + /// Restarts an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The cancellation token. + /// + public static async Task RestartAsync(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + public static IntegrationServiceEnvironment BeginCreateOrUpdate(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment) + { + return operations.BeginCreateOrUpdateAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + public static IntegrationServiceEnvironment BeginUpdate(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment) + { + return operations.BeginUpdateAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment).GetAwaiter().GetResult(); + } + + /// + /// Updates an integration service environment. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group. + /// + /// + /// The integration service environment name. + /// + /// + /// The integration service environment. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IIntegrationServiceEnvironmentsOperations operations, string resourceGroup, string integrationServiceEnvironmentName, IntegrationServiceEnvironment integrationServiceEnvironment, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroup, integrationServiceEnvironmentName, integrationServiceEnvironment, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of integration service environments by subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IIntegrationServiceEnvironmentsOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of integration service environments by subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IIntegrationServiceEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a list of integration service environments by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IIntegrationServiceEnvironmentsOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of integration service environments by resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IIntegrationServiceEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/LogicManagementClient.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/LogicManagementClient.cs index 8bb15ae6d202..c8f5dd839716 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/LogicManagementClient.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/LogicManagementClient.cs @@ -179,6 +179,31 @@ public partial class LogicManagementClient : ServiceClient public virtual IIntegrationAccountSessionsOperations IntegrationAccountSessions { get; private set; } + /// + /// Gets the IIntegrationServiceEnvironmentsOperations. + /// + public virtual IIntegrationServiceEnvironmentsOperations IntegrationServiceEnvironments { get; private set; } + + /// + /// Gets the IIntegrationServiceEnvironmentSkusOperations. + /// + public virtual IIntegrationServiceEnvironmentSkusOperations IntegrationServiceEnvironmentSkus { get; private set; } + + /// + /// Gets the IIntegrationServiceEnvironmentNetworkHealthOperations. + /// + public virtual IIntegrationServiceEnvironmentNetworkHealthOperations IntegrationServiceEnvironmentNetworkHealth { get; private set; } + + /// + /// Gets the IIntegrationServiceEnvironmentManagedApisOperations. + /// + public virtual IIntegrationServiceEnvironmentManagedApisOperations IntegrationServiceEnvironmentManagedApis { get; private set; } + + /// + /// Gets the IIntegrationServiceEnvironmentManagedApiOperations. + /// + public virtual IIntegrationServiceEnvironmentManagedApiOperations IntegrationServiceEnvironmentManagedApiOperations { get; private set; } + /// /// Gets the IOperations. /// @@ -446,9 +471,14 @@ private void Initialize() IntegrationAccountAgreements = new IntegrationAccountAgreementsOperations(this); IntegrationAccountCertificates = new IntegrationAccountCertificatesOperations(this); IntegrationAccountSessions = new IntegrationAccountSessionsOperations(this); + IntegrationServiceEnvironments = new IntegrationServiceEnvironmentsOperations(this); + IntegrationServiceEnvironmentSkus = new IntegrationServiceEnvironmentSkusOperations(this); + IntegrationServiceEnvironmentNetworkHealth = new IntegrationServiceEnvironmentNetworkHealthOperations(this); + IntegrationServiceEnvironmentManagedApis = new IntegrationServiceEnvironmentManagedApisOperations(this); + IntegrationServiceEnvironmentManagedApiOperations = new IntegrationServiceEnvironmentManagedApiOperations(this); Operations = new Operations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2018-07-01-preview"; + ApiVersion = "2019-05-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2AcknowledgementConnectionSettings.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2AcknowledgementConnectionSettings.cs index e4713157d8fb..7c78a6d51bbd 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2AcknowledgementConnectionSettings.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2AcknowledgementConnectionSettings.cs @@ -31,14 +31,14 @@ public AS2AcknowledgementConnectionSettings() /// Initializes a new instance of the /// AS2AcknowledgementConnectionSettings class. /// - /// The value indicating - /// whether to ignore mismatch in certificate name. - /// The value indicating - /// whether to support HTTP status code 'CONTINUE'. - /// The value indicating whether - /// to keep the connection alive. - /// The value indicating whether to - /// unfold the HTTP headers. + /// Indicates whether to + /// ignore mismatch in certificate name. + /// Indicates whether to + /// support HTTP status code 'CONTINUE'. + /// Indicates whether to keep the + /// connection alive. + /// Indicates whether to unfold the + /// HTTP headers. public AS2AcknowledgementConnectionSettings(bool ignoreCertificateNameMismatch, bool supportHttpStatusCodeContinue, bool keepHttpConnectionAlive, bool unfoldHttpHeaders) { IgnoreCertificateNameMismatch = ignoreCertificateNameMismatch; @@ -54,29 +54,27 @@ public AS2AcknowledgementConnectionSettings(bool ignoreCertificateNameMismatch, partial void CustomInit(); /// - /// Gets or sets the value indicating whether to ignore mismatch in - /// certificate name. + /// Gets or sets indicates whether to ignore mismatch in certificate + /// name. /// [JsonProperty(PropertyName = "ignoreCertificateNameMismatch")] public bool IgnoreCertificateNameMismatch { get; set; } /// - /// Gets or sets the value indicating whether to support HTTP status - /// code 'CONTINUE'. + /// Gets or sets indicates whether to support HTTP status code + /// 'CONTINUE'. /// [JsonProperty(PropertyName = "supportHttpStatusCodeContinue")] public bool SupportHttpStatusCodeContinue { get; set; } /// - /// Gets or sets the value indicating whether to keep the connection - /// alive. + /// Gets or sets indicates whether to keep the connection alive. /// [JsonProperty(PropertyName = "keepHttpConnectionAlive")] public bool KeepHttpConnectionAlive { get; set; } /// - /// Gets or sets the value indicating whether to unfold the HTTP - /// headers. + /// Gets or sets indicates whether to unfold the HTTP headers. /// [JsonProperty(PropertyName = "unfoldHttpHeaders")] public bool UnfoldHttpHeaders { get; set; } diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2ErrorSettings.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2ErrorSettings.cs index 6b87becd9e4f..8ef61c1bdb51 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2ErrorSettings.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2ErrorSettings.cs @@ -31,12 +31,12 @@ public AS2ErrorSettings() /// /// The value indicating whether /// to suspend duplicate message. - /// The value indicating whether + /// The value indicating whether /// to resend message If MDN is not received. - public AS2ErrorSettings(bool suspendDuplicateMessage, bool resendIfMdnNotReceived) + public AS2ErrorSettings(bool suspendDuplicateMessage, bool resendIfMDNNotReceived) { SuspendDuplicateMessage = suspendDuplicateMessage; - ResendIfMdnNotReceived = resendIfMdnNotReceived; + ResendIfMDNNotReceived = resendIfMDNNotReceived; CustomInit(); } @@ -56,8 +56,8 @@ public AS2ErrorSettings(bool suspendDuplicateMessage, bool resendIfMdnNotReceive /// Gets or sets the value indicating whether to resend message If MDN /// is not received. /// - [JsonProperty(PropertyName = "resendIfMdnNotReceived")] - public bool ResendIfMdnNotReceived { get; set; } + [JsonProperty(PropertyName = "resendIfMDNNotReceived")] + public bool ResendIfMDNNotReceived { get; set; } /// /// Validate the object. diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2MdnSettings.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2MdnSettings.cs index 3cc8eb78121b..9cef3e92d094 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2MdnSettings.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2MdnSettings.cs @@ -30,15 +30,15 @@ public AS2MdnSettings() /// /// Initializes a new instance of the AS2MdnSettings class. /// - /// The value indicating whether to send or + /// The value indicating whether to send or /// request a MDN. - /// The value indicating whether the MDN needs to + /// The value indicating whether the MDN needs to /// be signed or not. - /// The value indicating whether to + /// The value indicating whether to /// send the asynchronous MDN. - /// The value indicating + /// The value indicating /// whether to sign the outbound MDN if optional. - /// The value indicating + /// The value indicating /// whether to send inbound MDN to message box. /// The signing or hashing algorithm. /// Possible values include: 'NotSpecified', 'None', 'MD5', 'SHA1', @@ -47,16 +47,16 @@ public AS2MdnSettings() /// The disposition /// notification to header value. /// The MDN text. - public AS2MdnSettings(bool needMdn, bool signMdn, bool sendMdnAsynchronously, bool signOutboundMdnIfOptional, bool sendInboundMdnToMessageBox, string micHashingAlgorithm, string receiptDeliveryUrl = default(string), string dispositionNotificationTo = default(string), string mdnText = default(string)) + public AS2MdnSettings(bool needMDN, bool signMDN, bool sendMDNAsynchronously, bool signOutboundMDNIfOptional, bool sendInboundMDNToMessageBox, string micHashingAlgorithm, string receiptDeliveryUrl = default(string), string dispositionNotificationTo = default(string), string mdnText = default(string)) { - NeedMdn = needMdn; - SignMdn = signMdn; - SendMdnAsynchronously = sendMdnAsynchronously; + NeedMDN = needMDN; + SignMDN = signMDN; + SendMDNAsynchronously = sendMDNAsynchronously; ReceiptDeliveryUrl = receiptDeliveryUrl; DispositionNotificationTo = dispositionNotificationTo; - SignOutboundMdnIfOptional = signOutboundMdnIfOptional; + SignOutboundMDNIfOptional = signOutboundMDNIfOptional; MdnText = mdnText; - SendInboundMdnToMessageBox = sendInboundMdnToMessageBox; + SendInboundMDNToMessageBox = sendInboundMDNToMessageBox; MicHashingAlgorithm = micHashingAlgorithm; CustomInit(); } @@ -69,22 +69,22 @@ public AS2MdnSettings() /// /// Gets or sets the value indicating whether to send or request a MDN. /// - [JsonProperty(PropertyName = "needMdn")] - public bool NeedMdn { get; set; } + [JsonProperty(PropertyName = "needMDN")] + public bool NeedMDN { get; set; } /// /// Gets or sets the value indicating whether the MDN needs to be /// signed or not. /// - [JsonProperty(PropertyName = "signMdn")] - public bool SignMdn { get; set; } + [JsonProperty(PropertyName = "signMDN")] + public bool SignMDN { get; set; } /// /// Gets or sets the value indicating whether to send the asynchronous /// MDN. /// - [JsonProperty(PropertyName = "sendMdnAsynchronously")] - public bool SendMdnAsynchronously { get; set; } + [JsonProperty(PropertyName = "sendMDNAsynchronously")] + public bool SendMDNAsynchronously { get; set; } /// /// Gets or sets the receipt delivery URL. @@ -102,8 +102,8 @@ public AS2MdnSettings() /// Gets or sets the value indicating whether to sign the outbound MDN /// if optional. /// - [JsonProperty(PropertyName = "signOutboundMdnIfOptional")] - public bool SignOutboundMdnIfOptional { get; set; } + [JsonProperty(PropertyName = "signOutboundMDNIfOptional")] + public bool SignOutboundMDNIfOptional { get; set; } /// /// Gets or sets the MDN text. @@ -115,8 +115,8 @@ public AS2MdnSettings() /// Gets or sets the value indicating whether to send inbound MDN to /// message box. /// - [JsonProperty(PropertyName = "sendInboundMdnToMessageBox")] - public bool SendInboundMdnToMessageBox { get; set; } + [JsonProperty(PropertyName = "sendInboundMDNToMessageBox")] + public bool SendInboundMDNToMessageBox { get; set; } /// /// Gets or sets the signing or hashing algorithm. Possible values diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2SecuritySettings.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2SecuritySettings.cs index e082b18a357c..50ee0d01e99c 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2SecuritySettings.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AS2SecuritySettings.cs @@ -31,21 +31,21 @@ public AS2SecuritySettings() /// /// The value indicating /// whether to send or request a MDN. - /// The value + /// The value /// indicating whether to enable NRR for inbound encoded /// messages. - /// The value + /// The value /// indicating whether to enable NRR for inbound decoded /// messages. - /// The value indicating whether + /// The value indicating whether /// to enable NRR for outbound MDN. - /// The value + /// The value /// indicating whether to enable NRR for outbound encoded /// messages. - /// The value + /// The value /// indicating whether to enable NRR for outbound decoded /// messages. - /// The value indicating whether + /// The value indicating whether /// to enable NRR for inbound MDN. /// The name of the signing /// certificate. @@ -54,17 +54,17 @@ public AS2SecuritySettings() /// The Sha2 algorithm format. Valid /// values are Sha2, ShaHashSize, ShaHyphenHashSize, /// Sha2UnderscoreHashSize. - public AS2SecuritySettings(bool overrideGroupSigningCertificate, bool enableNrrForInboundEncodedMessages, bool enableNrrForInboundDecodedMessages, bool enableNrrForOutboundMdn, bool enableNrrForOutboundEncodedMessages, bool enableNrrForOutboundDecodedMessages, bool enableNrrForInboundMdn, string signingCertificateName = default(string), string encryptionCertificateName = default(string), string sha2AlgorithmFormat = default(string)) + public AS2SecuritySettings(bool overrideGroupSigningCertificate, bool enableNRRForInboundEncodedMessages, bool enableNRRForInboundDecodedMessages, bool enableNRRForOutboundMDN, bool enableNRRForOutboundEncodedMessages, bool enableNRRForOutboundDecodedMessages, bool enableNRRForInboundMDN, string signingCertificateName = default(string), string encryptionCertificateName = default(string), string sha2AlgorithmFormat = default(string)) { OverrideGroupSigningCertificate = overrideGroupSigningCertificate; SigningCertificateName = signingCertificateName; EncryptionCertificateName = encryptionCertificateName; - EnableNrrForInboundEncodedMessages = enableNrrForInboundEncodedMessages; - EnableNrrForInboundDecodedMessages = enableNrrForInboundDecodedMessages; - EnableNrrForOutboundMdn = enableNrrForOutboundMdn; - EnableNrrForOutboundEncodedMessages = enableNrrForOutboundEncodedMessages; - EnableNrrForOutboundDecodedMessages = enableNrrForOutboundDecodedMessages; - EnableNrrForInboundMdn = enableNrrForInboundMdn; + EnableNRRForInboundEncodedMessages = enableNRRForInboundEncodedMessages; + EnableNRRForInboundDecodedMessages = enableNRRForInboundDecodedMessages; + EnableNRRForOutboundMDN = enableNRRForOutboundMDN; + EnableNRRForOutboundEncodedMessages = enableNRRForOutboundEncodedMessages; + EnableNRRForOutboundDecodedMessages = enableNRRForOutboundDecodedMessages; + EnableNRRForInboundMDN = enableNRRForInboundMDN; Sha2AlgorithmFormat = sha2AlgorithmFormat; CustomInit(); } @@ -96,43 +96,43 @@ public AS2SecuritySettings() /// Gets or sets the value indicating whether to enable NRR for inbound /// encoded messages. /// - [JsonProperty(PropertyName = "enableNrrForInboundEncodedMessages")] - public bool EnableNrrForInboundEncodedMessages { get; set; } + [JsonProperty(PropertyName = "enableNRRForInboundEncodedMessages")] + public bool EnableNRRForInboundEncodedMessages { get; set; } /// /// Gets or sets the value indicating whether to enable NRR for inbound /// decoded messages. /// - [JsonProperty(PropertyName = "enableNrrForInboundDecodedMessages")] - public bool EnableNrrForInboundDecodedMessages { get; set; } + [JsonProperty(PropertyName = "enableNRRForInboundDecodedMessages")] + public bool EnableNRRForInboundDecodedMessages { get; set; } /// /// Gets or sets the value indicating whether to enable NRR for /// outbound MDN. /// - [JsonProperty(PropertyName = "enableNrrForOutboundMdn")] - public bool EnableNrrForOutboundMdn { get; set; } + [JsonProperty(PropertyName = "enableNRRForOutboundMDN")] + public bool EnableNRRForOutboundMDN { get; set; } /// /// Gets or sets the value indicating whether to enable NRR for /// outbound encoded messages. /// - [JsonProperty(PropertyName = "enableNrrForOutboundEncodedMessages")] - public bool EnableNrrForOutboundEncodedMessages { get; set; } + [JsonProperty(PropertyName = "enableNRRForOutboundEncodedMessages")] + public bool EnableNRRForOutboundEncodedMessages { get; set; } /// /// Gets or sets the value indicating whether to enable NRR for /// outbound decoded messages. /// - [JsonProperty(PropertyName = "enableNrrForOutboundDecodedMessages")] - public bool EnableNrrForOutboundDecodedMessages { get; set; } + [JsonProperty(PropertyName = "enableNRRForOutboundDecodedMessages")] + public bool EnableNRRForOutboundDecodedMessages { get; set; } /// /// Gets or sets the value indicating whether to enable NRR for inbound /// MDN. /// - [JsonProperty(PropertyName = "enableNrrForInboundMdn")] - public bool EnableNrrForInboundMdn { get; set; } + [JsonProperty(PropertyName = "enableNRRForInboundMDN")] + public bool EnableNRRForInboundMDN { get; set; } /// /// Gets or sets the Sha2 algorithm format. Valid values are Sha2, diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterMetadata.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterMetadata.cs new file mode 100644 index 000000000000..b33f4af0c00e --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterMetadata.cs @@ -0,0 +1,87 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API deployment parameter metadata. + /// + public partial class ApiDeploymentParameterMetadata + { + /// + /// Initializes a new instance of the ApiDeploymentParameterMetadata + /// class. + /// + public ApiDeploymentParameterMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiDeploymentParameterMetadata + /// class. + /// + /// The type. + /// Indicates whether its required. + /// The display name. + /// The description. + /// The visibility. Possible values include: + /// 'NotSpecified', 'Default', 'Internal' + public ApiDeploymentParameterMetadata(string type = default(string), bool? isRequired = default(bool?), string displayName = default(string), string description = default(string), string visibility = default(string)) + { + Type = type; + IsRequired = isRequired; + DisplayName = displayName; + Description = description; + Visibility = visibility; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets indicates whether its required. + /// + [JsonProperty(PropertyName = "isRequired")] + public bool? IsRequired { get; set; } + + /// + /// Gets or sets the display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the visibility. Possible values include: + /// 'NotSpecified', 'Default', 'Internal' + /// + [JsonProperty(PropertyName = "visibility")] + public string Visibility { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterMetadataSet.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterMetadataSet.cs new file mode 100644 index 000000000000..0d1d07dd9e4a --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterMetadataSet.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API deployment parameters metadata. + /// + public partial class ApiDeploymentParameterMetadataSet + { + /// + /// Initializes a new instance of the ApiDeploymentParameterMetadataSet + /// class. + /// + public ApiDeploymentParameterMetadataSet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiDeploymentParameterMetadataSet + /// class. + /// + /// The package content link + /// parameter. + /// The package content link + /// parameter. + public ApiDeploymentParameterMetadataSet(ApiDeploymentParameterMetadata packageContentLink = default(ApiDeploymentParameterMetadata), ApiDeploymentParameterMetadata redisCacheConnectionString = default(ApiDeploymentParameterMetadata)) + { + PackageContentLink = packageContentLink; + RedisCacheConnectionString = redisCacheConnectionString; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the package content link parameter. + /// + [JsonProperty(PropertyName = "packageContentLink")] + public ApiDeploymentParameterMetadata PackageContentLink { get; set; } + + /// + /// Gets or sets the package content link parameter. + /// + [JsonProperty(PropertyName = "redisCacheConnectionString")] + public ApiDeploymentParameterMetadata RedisCacheConnectionString { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterVisibility.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterVisibility.cs new file mode 100644 index 000000000000..48ab66e6ef9c --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiDeploymentParameterVisibility.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.Logic.Models +{ + + /// + /// Defines values for ApiDeploymentParameterVisibility. + /// + public static class ApiDeploymentParameterVisibility + { + public const string NotSpecified = "NotSpecified"; + public const string Default = "Default"; + public const string Internal = "Internal"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperation.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperation.cs new file mode 100644 index 000000000000..76e65d1d4276 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperation.cs @@ -0,0 +1,57 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The api operation. + /// + public partial class ApiOperation : Resource + { + /// + /// Initializes a new instance of the ApiOperation class. + /// + public ApiOperation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiOperation class. + /// + /// The resource id. + /// Gets the resource name. + /// Gets the resource type. + /// The resource location. + /// The resource tags. + public ApiOperation(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ApiOperationPropertiesDefinition properties = default(ApiOperationPropertiesDefinition)) + : base(id, name, type, location, tags) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "properties")] + public ApiOperationPropertiesDefinition Properties { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperationAnnotation.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperationAnnotation.cs new file mode 100644 index 000000000000..ceee6a9a6117 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperationAnnotation.cs @@ -0,0 +1,69 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Api Operation Annotation. + /// + public partial class ApiOperationAnnotation + { + /// + /// Initializes a new instance of the ApiOperationAnnotation class. + /// + public ApiOperationAnnotation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiOperationAnnotation class. + /// + /// Possible values include: 'NotSpecified', + /// 'Preview', 'Production' + /// The family. + /// The revision. + public ApiOperationAnnotation(string status = default(string), string family = default(string), int? revision = default(int?)) + { + Status = status; + Family = family; + Revision = revision; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'NotSpecified', 'Preview', + /// 'Production' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the family. + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; set; } + + /// + /// Gets or sets the revision. + /// + [JsonProperty(PropertyName = "revision")] + public int? Revision { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperationPropertiesDefinition.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperationPropertiesDefinition.cs new file mode 100644 index 000000000000..311cd3249336 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiOperationPropertiesDefinition.cs @@ -0,0 +1,152 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The api operations properties + /// + public partial class ApiOperationPropertiesDefinition + { + /// + /// Initializes a new instance of the ApiOperationPropertiesDefinition + /// class. + /// + public ApiOperationPropertiesDefinition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiOperationPropertiesDefinition + /// class. + /// + /// The summary of the api operation. + /// The description of the api + /// operation. + /// The visibility of the api + /// operation. + /// The trigger type of api operation. + /// The trigger hint for the api + /// operation. + /// Indicates whether the api operation is + /// pageable. + /// The annotation of api operation. + /// The api reference. + /// The operation inputs definition + /// schema. + /// The operation responses + /// definition schemas. + /// Indicates whether the API operation is + /// webhook or not. + /// Indicates whether the API operation is + /// notification or not. + public ApiOperationPropertiesDefinition(string summary = default(string), string description = default(string), string visibility = default(string), string trigger = default(string), string triggerHint = default(string), bool? pageable = default(bool?), ApiOperationAnnotation annotation = default(ApiOperationAnnotation), ApiReference api = default(ApiReference), SwaggerSchema inputsDefinition = default(SwaggerSchema), IDictionary responsesDefinition = default(IDictionary), bool? isWebhook = default(bool?), bool? isNotification = default(bool?)) + { + Summary = summary; + Description = description; + Visibility = visibility; + Trigger = trigger; + TriggerHint = triggerHint; + Pageable = pageable; + Annotation = annotation; + Api = api; + InputsDefinition = inputsDefinition; + ResponsesDefinition = responsesDefinition; + IsWebhook = isWebhook; + IsNotification = isNotification; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the summary of the api operation. + /// + [JsonProperty(PropertyName = "summary")] + public string Summary { get; set; } + + /// + /// Gets or sets the description of the api operation. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the visibility of the api operation. + /// + [JsonProperty(PropertyName = "visibility")] + public string Visibility { get; set; } + + /// + /// Gets or sets the trigger type of api operation. + /// + [JsonProperty(PropertyName = "trigger")] + public string Trigger { get; set; } + + /// + /// Gets or sets the trigger hint for the api operation. + /// + [JsonProperty(PropertyName = "triggerHint")] + public string TriggerHint { get; set; } + + /// + /// Gets or sets indicates whether the api operation is pageable. + /// + [JsonProperty(PropertyName = "pageable")] + public bool? Pageable { get; set; } + + /// + /// Gets or sets the annotation of api operation. + /// + [JsonProperty(PropertyName = "annotation")] + public ApiOperationAnnotation Annotation { get; set; } + + /// + /// Gets or sets the api reference. + /// + [JsonProperty(PropertyName = "api")] + public ApiReference Api { get; set; } + + /// + /// Gets or sets the operation inputs definition schema. + /// + [JsonProperty(PropertyName = "inputsDefinition")] + public SwaggerSchema InputsDefinition { get; set; } + + /// + /// Gets or sets the operation responses definition schemas. + /// + [JsonProperty(PropertyName = "responsesDefinition")] + public IDictionary ResponsesDefinition { get; set; } + + /// + /// Gets or sets indicates whether the API operation is webhook or not. + /// + [JsonProperty(PropertyName = "isWebhook")] + public bool? IsWebhook { get; set; } + + /// + /// Gets or sets indicates whether the API operation is notification or + /// not. + /// + [JsonProperty(PropertyName = "isNotification")] + public bool? IsNotification { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiReference.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiReference.cs new file mode 100644 index 000000000000..9265ddd45a9b --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiReference.cs @@ -0,0 +1,106 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Api reference. + /// + public partial class ApiReference : ResourceReference + { + /// + /// Initializes a new instance of the ApiReference class. + /// + public ApiReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiReference class. + /// + /// The resource id. + /// Gets the resource name. + /// Gets the resource type. + /// The display name of the api. + /// The description of the api. + /// The icon uri of the api. + /// The swagger of the api. + /// The brand color of the api. + /// The tier. Possible values include: + /// 'NotSpecified', 'Enterprise', 'Standard', 'Premium' + /// The integration service + /// environment reference. + public ApiReference(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string description = default(string), string iconUri = default(string), object swagger = default(object), string brandColor = default(string), string category = default(string), ResourceReference integrationServiceEnvironment = default(ResourceReference)) + : base(id, name, type) + { + DisplayName = displayName; + Description = description; + IconUri = iconUri; + Swagger = swagger; + BrandColor = brandColor; + Category = category; + IntegrationServiceEnvironment = integrationServiceEnvironment; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the display name of the api. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the description of the api. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the icon uri of the api. + /// + [JsonProperty(PropertyName = "iconUri")] + public string IconUri { get; set; } + + /// + /// Gets or sets the swagger of the api. + /// + [JsonProperty(PropertyName = "swagger")] + public object Swagger { get; set; } + + /// + /// Gets or sets the brand color of the api. + /// + [JsonProperty(PropertyName = "brandColor")] + public string BrandColor { get; set; } + + /// + /// Gets or sets the tier. Possible values include: 'NotSpecified', + /// 'Enterprise', 'Standard', 'Premium' + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets the integration service environment reference. + /// + [JsonProperty(PropertyName = "integrationServiceEnvironment")] + public ResourceReference IntegrationServiceEnvironment { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceBackendService.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceBackendService.cs new file mode 100644 index 000000000000..336cc73e1b16 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceBackendService.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API backend service. + /// + public partial class ApiResourceBackendService + { + /// + /// Initializes a new instance of the ApiResourceBackendService class. + /// + public ApiResourceBackendService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiResourceBackendService class. + /// + /// The service URL. + public ApiResourceBackendService(string serviceUrl = default(string)) + { + ServiceUrl = serviceUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the service URL. + /// + [JsonProperty(PropertyName = "serviceUrl")] + public string ServiceUrl { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceDefinitions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceDefinitions.cs new file mode 100644 index 000000000000..db7fbc8d91a8 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceDefinitions.cs @@ -0,0 +1,59 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Api resource definition. + /// + public partial class ApiResourceDefinitions + { + /// + /// Initializes a new instance of the ApiResourceDefinitions class. + /// + public ApiResourceDefinitions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiResourceDefinitions class. + /// + /// The original swagger url. + /// The modified swagger url. + public ApiResourceDefinitions(string originalSwaggerUrl = default(string), string modifiedSwaggerUrl = default(string)) + { + OriginalSwaggerUrl = originalSwaggerUrl; + ModifiedSwaggerUrl = modifiedSwaggerUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the original swagger url. + /// + [JsonProperty(PropertyName = "originalSwaggerUrl")] + public string OriginalSwaggerUrl { get; set; } + + /// + /// Gets or sets the modified swagger url. + /// + [JsonProperty(PropertyName = "modifiedSwaggerUrl")] + public string ModifiedSwaggerUrl { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceGeneralInformation.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceGeneralInformation.cs new file mode 100644 index 000000000000..2c89f8db62a2 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceGeneralInformation.cs @@ -0,0 +1,95 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API general information. + /// + public partial class ApiResourceGeneralInformation + { + /// + /// Initializes a new instance of the ApiResourceGeneralInformation + /// class. + /// + public ApiResourceGeneralInformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiResourceGeneralInformation + /// class. + /// + /// The icon url. + /// The display name. + /// The description. + /// The terms of use url. + /// The release tag. + /// The tier. Possible values include: + /// 'NotSpecified', 'Enterprise', 'Standard', 'Premium' + public ApiResourceGeneralInformation(string iconUrl = default(string), string displayName = default(string), string description = default(string), string termsOfUseUrl = default(string), string releaseTag = default(string), string tier = default(string)) + { + IconUrl = iconUrl; + DisplayName = displayName; + Description = description; + TermsOfUseUrl = termsOfUseUrl; + ReleaseTag = releaseTag; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the icon url. + /// + [JsonProperty(PropertyName = "iconUrl")] + public string IconUrl { get; set; } + + /// + /// Gets or sets the display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the terms of use url. + /// + [JsonProperty(PropertyName = "termsOfUseUrl")] + public string TermsOfUseUrl { get; set; } + + /// + /// Gets or sets the release tag. + /// + [JsonProperty(PropertyName = "releaseTag")] + public string ReleaseTag { get; set; } + + /// + /// Gets or sets the tier. Possible values include: 'NotSpecified', + /// 'Enterprise', 'Standard', 'Premium' + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceMetadata.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceMetadata.cs new file mode 100644 index 000000000000..e2305c004dc0 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceMetadata.cs @@ -0,0 +1,139 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The api resource metadata. + /// + public partial class ApiResourceMetadata + { + /// + /// Initializes a new instance of the ApiResourceMetadata class. + /// + public ApiResourceMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiResourceMetadata class. + /// + /// The source. + /// The brand color. + /// The hide key. + /// The tags. + /// The api type. Possible values include: + /// 'NotSpecified', 'Rest', 'Soap' + /// The WSDL service. + /// The WSDL import method. Possible + /// values include: 'NotSpecified', 'SoapToRest', + /// 'SoapPassThrough' + /// The connection type. + /// The provisioning state. Possible + /// values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + /// 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Moving', 'Updating', 'Registering', 'Registered', + /// 'Unregistering', 'Unregistered', 'Completed' + /// The connector deployment + /// parameters metadata. + public ApiResourceMetadata(string source = default(string), string brandColor = default(string), string hideKey = default(string), IDictionary tags = default(IDictionary), string apiType = default(string), WsdlService wsdlService = default(WsdlService), string wsdlImportMethod = default(string), string connectionType = default(string), string provisioningState = default(string), ApiDeploymentParameterMetadataSet deploymentParameters = default(ApiDeploymentParameterMetadataSet)) + { + Source = source; + BrandColor = brandColor; + HideKey = hideKey; + Tags = tags; + ApiType = apiType; + WsdlService = wsdlService; + WsdlImportMethod = wsdlImportMethod; + ConnectionType = connectionType; + ProvisioningState = provisioningState; + DeploymentParameters = deploymentParameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the source. + /// + [JsonProperty(PropertyName = "source")] + public string Source { get; set; } + + /// + /// Gets or sets the brand color. + /// + [JsonProperty(PropertyName = "brandColor")] + public string BrandColor { get; set; } + + /// + /// Gets or sets the hide key. + /// + [JsonProperty(PropertyName = "hideKey")] + public string HideKey { get; set; } + + /// + /// Gets or sets the tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the api type. Possible values include: 'NotSpecified', + /// 'Rest', 'Soap' + /// + [JsonProperty(PropertyName = "ApiType")] + public string ApiType { get; set; } + + /// + /// Gets or sets the WSDL service. + /// + [JsonProperty(PropertyName = "wsdlService")] + public WsdlService WsdlService { get; set; } + + /// + /// Gets or sets the WSDL import method. Possible values include: + /// 'NotSpecified', 'SoapToRest', 'SoapPassThrough' + /// + [JsonProperty(PropertyName = "wsdlImportMethod")] + public string WsdlImportMethod { get; set; } + + /// + /// Gets or sets the connection type. + /// + [JsonProperty(PropertyName = "connectionType")] + public string ConnectionType { get; set; } + + /// + /// Gets or sets the provisioning state. Possible values include: + /// 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', + /// 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Moving', 'Updating', 'Registering', 'Registered', + /// 'Unregistering', 'Unregistered', 'Completed' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets the connector deployment parameters metadata. + /// + [JsonProperty(PropertyName = "deploymentParameters")] + public ApiDeploymentParameterMetadataSet DeploymentParameters { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourcePolicies.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourcePolicies.cs new file mode 100644 index 000000000000..0985bb352ee3 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourcePolicies.cs @@ -0,0 +1,60 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The API resource policies. + /// + public partial class ApiResourcePolicies + { + /// + /// Initializes a new instance of the ApiResourcePolicies class. + /// + public ApiResourcePolicies() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiResourcePolicies class. + /// + /// The API level only policies XML as embedded + /// content. + /// The content link to the policies. + public ApiResourcePolicies(string content = default(string), string contentLink = default(string)) + { + Content = content; + ContentLink = contentLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the API level only policies XML as embedded content. + /// + [JsonProperty(PropertyName = "content")] + public string Content { get; set; } + + /// + /// Gets or sets the content link to the policies. + /// + [JsonProperty(PropertyName = "contentLink")] + public string ContentLink { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceProperties.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceProperties.cs new file mode 100644 index 000000000000..5bf4089f5644 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiResourceProperties.cs @@ -0,0 +1,162 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The API resource properties. + /// + public partial class ApiResourceProperties + { + /// + /// Initializes a new instance of the ApiResourceProperties class. + /// + public ApiResourceProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApiResourceProperties class. + /// + /// The name + /// The connection + /// parameters. + /// The metadata. + /// The runtime urls. + /// The api general + /// information. + /// The capabilities. + /// The backend service. + /// The policies for the API. + /// The API definition. + /// The api definitions. + /// The integration service + /// environment reference. + /// The provisioning state. Possible + /// values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + /// 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Moving', 'Updating', 'Registering', 'Registered', + /// 'Unregistering', 'Unregistered', 'Completed' + /// The category. Possible values include: + /// 'NotSpecified', 'Enterprise', 'Standard', 'Premium' + public ApiResourceProperties(string name = default(string), IDictionary connectionParameters = default(IDictionary), ApiResourceMetadata metadata = default(ApiResourceMetadata), IList runtimeUrls = default(IList), ApiResourceGeneralInformation generalInformation = default(ApiResourceGeneralInformation), IList capabilities = default(IList), ApiResourceBackendService backendService = default(ApiResourceBackendService), ApiResourcePolicies policies = default(ApiResourcePolicies), string apiDefinitionUrl = default(string), ApiResourceDefinitions apiDefinitions = default(ApiResourceDefinitions), ResourceReference integrationServiceEnvironment = default(ResourceReference), string provisioningState = default(string), string category = default(string)) + { + Name = name; + ConnectionParameters = connectionParameters; + Metadata = metadata; + RuntimeUrls = runtimeUrls; + GeneralInformation = generalInformation; + Capabilities = capabilities; + BackendService = backendService; + Policies = policies; + ApiDefinitionUrl = apiDefinitionUrl; + ApiDefinitions = apiDefinitions; + IntegrationServiceEnvironment = integrationServiceEnvironment; + ProvisioningState = provisioningState; + Category = category; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the connection parameters. + /// + [JsonProperty(PropertyName = "connectionParameters")] + public IDictionary ConnectionParameters { get; set; } + + /// + /// Gets or sets the metadata. + /// + [JsonProperty(PropertyName = "metadata")] + public ApiResourceMetadata Metadata { get; set; } + + /// + /// Gets or sets the runtime urls. + /// + [JsonProperty(PropertyName = "runtimeUrls")] + public IList RuntimeUrls { get; set; } + + /// + /// Gets or sets the api general information. + /// + [JsonProperty(PropertyName = "generalInformation")] + public ApiResourceGeneralInformation GeneralInformation { get; set; } + + /// + /// Gets or sets the capabilities. + /// + [JsonProperty(PropertyName = "capabilities")] + public IList Capabilities { get; set; } + + /// + /// Gets or sets the backend service. + /// + [JsonProperty(PropertyName = "backendService")] + public ApiResourceBackendService BackendService { get; set; } + + /// + /// Gets or sets the policies for the API. + /// + [JsonProperty(PropertyName = "policies")] + public ApiResourcePolicies Policies { get; set; } + + /// + /// Gets or sets the API definition. + /// + [JsonProperty(PropertyName = "apiDefinitionUrl")] + public string ApiDefinitionUrl { get; set; } + + /// + /// Gets or sets the api definitions. + /// + [JsonProperty(PropertyName = "apiDefinitions")] + public ApiResourceDefinitions ApiDefinitions { get; set; } + + /// + /// Gets or sets the integration service environment reference. + /// + [JsonProperty(PropertyName = "integrationServiceEnvironment")] + public ResourceReference IntegrationServiceEnvironment { get; set; } + + /// + /// Gets or sets the provisioning state. Possible values include: + /// 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', + /// 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Moving', 'Updating', 'Registering', 'Registered', + /// 'Unregistering', 'Unregistered', 'Completed' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets the category. Possible values include: 'NotSpecified', + /// 'Enterprise', 'Standard', 'Premium' + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiTier.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiTier.cs new file mode 100644 index 000000000000..7a5a30b463c2 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiTier.cs @@ -0,0 +1,24 @@ +// +// 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.Logic.Models +{ + + /// + /// Defines values for ApiTier. + /// + public static class ApiTier + { + public const string NotSpecified = "NotSpecified"; + public const string Enterprise = "Enterprise"; + public const string Standard = "Standard"; + public const string Premium = "Premium"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiType.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiType.cs new file mode 100644 index 000000000000..6fa53b20a0b5 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ApiType.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.Logic.Models +{ + + /// + /// Defines values for ApiType. + /// + public static class ApiType + { + public const string NotSpecified = "NotSpecified"; + public const string Rest = "Rest"; + public const string Soap = "Soap"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AzureAsyncOperationState.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AzureAsyncOperationState.cs new file mode 100644 index 000000000000..59956f780e46 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/AzureAsyncOperationState.cs @@ -0,0 +1,24 @@ +// +// 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.Logic.Models +{ + + /// + /// Defines values for AzureAsyncOperationState. + /// + public static class AzureAsyncOperationState + { + public const string Failed = "Failed"; + public const string Succeeded = "Succeeded"; + public const string Pending = "Pending"; + public const string Canceled = "Canceled"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/EdifactValidationOverride.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/EdifactValidationOverride.cs index 0f604576eb2d..9b75a70526a8 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/EdifactValidationOverride.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/EdifactValidationOverride.cs @@ -34,9 +34,9 @@ public EdifactValidationOverride() /// settings has to be applied. /// The value indicating whether to /// validate character Set. - /// The value indicating whether to + /// The value indicating whether to /// validate EDI types. - /// The value indicating whether to + /// The value indicating whether to /// validate XSD types. /// The value /// indicating whether to allow leading and trailing spaces and @@ -47,12 +47,12 @@ public EdifactValidationOverride() /// The value /// indicating whether to trim leading and trailing spaces and /// zeroes. - public EdifactValidationOverride(string messageId, bool enforceCharacterSet, bool validateEdiTypes, bool validateXsdTypes, bool allowLeadingAndTrailingSpacesAndZeroes, string trailingSeparatorPolicy, bool trimLeadingAndTrailingSpacesAndZeroes) + public EdifactValidationOverride(string messageId, bool enforceCharacterSet, bool validateEDITypes, bool validateXSDTypes, bool allowLeadingAndTrailingSpacesAndZeroes, string trailingSeparatorPolicy, bool trimLeadingAndTrailingSpacesAndZeroes) { MessageId = messageId; EnforceCharacterSet = enforceCharacterSet; - ValidateEdiTypes = validateEdiTypes; - ValidateXsdTypes = validateXsdTypes; + ValidateEDITypes = validateEDITypes; + ValidateXSDTypes = validateXSDTypes; AllowLeadingAndTrailingSpacesAndZeroes = allowLeadingAndTrailingSpacesAndZeroes; TrailingSeparatorPolicy = trailingSeparatorPolicy; TrimLeadingAndTrailingSpacesAndZeroes = trimLeadingAndTrailingSpacesAndZeroes; @@ -81,14 +81,14 @@ public EdifactValidationOverride(string messageId, bool enforceCharacterSet, boo /// /// Gets or sets the value indicating whether to validate EDI types. /// - [JsonProperty(PropertyName = "validateEdiTypes")] - public bool ValidateEdiTypes { get; set; } + [JsonProperty(PropertyName = "validateEDITypes")] + public bool ValidateEDITypes { get; set; } /// /// Gets or sets the value indicating whether to validate XSD types. /// - [JsonProperty(PropertyName = "validateXsdTypes")] - public bool ValidateXsdTypes { get; set; } + [JsonProperty(PropertyName = "validateXSDTypes")] + public bool ValidateXSDTypes { get; set; } /// /// Gets or sets the value indicating whether to allow leading and diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/EdifactValidationSettings.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/EdifactValidationSettings.cs index 3220d3fcc08a..2f2296087615 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/EdifactValidationSettings.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/EdifactValidationSettings.cs @@ -42,9 +42,9 @@ public EdifactValidationSettings() /// The value /// indicating whether to check for duplicate transaction set control /// number. - /// The value indicating whether to + /// The value indicating whether to /// Whether to validate EDI types. - /// The value indicating whether to + /// The value indicating whether to /// Whether to validate XSD types. /// The value /// indicating whether to allow leading and trailing spaces and @@ -55,15 +55,15 @@ public EdifactValidationSettings() /// The trailing separator /// policy. Possible values include: 'NotSpecified', 'NotAllowed', /// 'Optional', 'Mandatory' - public EdifactValidationSettings(bool validateCharacterSet, bool checkDuplicateInterchangeControlNumber, int interchangeControlNumberValidityDays, bool checkDuplicateGroupControlNumber, bool checkDuplicateTransactionSetControlNumber, bool validateEdiTypes, bool validateXsdTypes, bool allowLeadingAndTrailingSpacesAndZeroes, bool trimLeadingAndTrailingSpacesAndZeroes, string trailingSeparatorPolicy) + public EdifactValidationSettings(bool validateCharacterSet, bool checkDuplicateInterchangeControlNumber, int interchangeControlNumberValidityDays, bool checkDuplicateGroupControlNumber, bool checkDuplicateTransactionSetControlNumber, bool validateEDITypes, bool validateXSDTypes, bool allowLeadingAndTrailingSpacesAndZeroes, bool trimLeadingAndTrailingSpacesAndZeroes, string trailingSeparatorPolicy) { ValidateCharacterSet = validateCharacterSet; CheckDuplicateInterchangeControlNumber = checkDuplicateInterchangeControlNumber; InterchangeControlNumberValidityDays = interchangeControlNumberValidityDays; CheckDuplicateGroupControlNumber = checkDuplicateGroupControlNumber; CheckDuplicateTransactionSetControlNumber = checkDuplicateTransactionSetControlNumber; - ValidateEdiTypes = validateEdiTypes; - ValidateXsdTypes = validateXsdTypes; + ValidateEDITypes = validateEDITypes; + ValidateXSDTypes = validateXSDTypes; AllowLeadingAndTrailingSpacesAndZeroes = allowLeadingAndTrailingSpacesAndZeroes; TrimLeadingAndTrailingSpacesAndZeroes = trimLeadingAndTrailingSpacesAndZeroes; TrailingSeparatorPolicy = trailingSeparatorPolicy; @@ -113,15 +113,15 @@ public EdifactValidationSettings(bool validateCharacterSet, bool checkDuplicateI /// Gets or sets the value indicating whether to Whether to validate /// EDI types. /// - [JsonProperty(PropertyName = "validateEdiTypes")] - public bool ValidateEdiTypes { get; set; } + [JsonProperty(PropertyName = "validateEDITypes")] + public bool ValidateEDITypes { get; set; } /// /// Gets or sets the value indicating whether to Whether to validate /// XSD types. /// - [JsonProperty(PropertyName = "validateXsdTypes")] - public bool ValidateXsdTypes { get; set; } + [JsonProperty(PropertyName = "validateXSDTypes")] + public bool ValidateXSDTypes { get; set; } /// /// Gets or sets the value indicating whether to allow leading and diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ErrorResponseCode.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ErrorResponseCode.cs new file mode 100644 index 000000000000..fcc716100920 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ErrorResponseCode.cs @@ -0,0 +1,24 @@ +// +// 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.Logic.Models +{ + + /// + /// Defines values for ErrorResponseCode. + /// + public static class ErrorResponseCode + { + public const string NotSpecified = "NotSpecified"; + public const string IntegrationServiceEnvironmentNotFound = "IntegrationServiceEnvironmentNotFound"; + public const string InternalServerError = "InternalServerError"; + public const string InvalidOperationId = "InvalidOperationId"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/Expression.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/Expression.cs index 0705152a1c64..1f85cc8b8f3b 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/Expression.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/Expression.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.Logic.Models using System.Collections.Generic; using System.Linq; + /// + /// The expression. + /// public partial class Expression { /// @@ -28,6 +31,8 @@ public Expression() /// /// Initializes a new instance of the Expression class. /// + /// The text. + /// The sub expressions. public Expression(string text = default(string), object value = default(object), IList subexpressions = default(IList), AzureResourceErrorInfo error = default(AzureResourceErrorInfo)) { Text = text; @@ -43,6 +48,7 @@ public Expression() partial void CustomInit(); /// + /// Gets or sets the text. /// [JsonProperty(PropertyName = "text")] public string Text { get; set; } @@ -53,6 +59,7 @@ public Expression() public object Value { get; set; } /// + /// Gets or sets the sub expressions. /// [JsonProperty(PropertyName = "subexpressions")] public IList Subexpressions { get; set; } diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ExpressionRoot.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ExpressionRoot.cs index d0f4c595df2d..7c7df9c862ba 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ExpressionRoot.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ExpressionRoot.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.Logic.Models using System.Collections.Generic; using System.Linq; + /// + /// The expression root. + /// public partial class ExpressionRoot : Expression { /// @@ -28,6 +31,8 @@ public ExpressionRoot() /// /// Initializes a new instance of the ExpressionRoot class. /// + /// The text. + /// The sub expressions. /// The path. public ExpressionRoot(string text = default(string), object value = default(object), IList subexpressions = default(IList), AzureResourceErrorInfo error = default(AzureResourceErrorInfo), string path = default(string)) : base(text, value, subexpressions, error) diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ExtendedErrorInfo.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ExtendedErrorInfo.cs new file mode 100644 index 000000000000..4431e905e230 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ExtendedErrorInfo.cs @@ -0,0 +1,109 @@ +// +// 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.Logic.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The extended error info. + /// + public partial class ExtendedErrorInfo + { + /// + /// Initializes a new instance of the ExtendedErrorInfo class. + /// + public ExtendedErrorInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExtendedErrorInfo class. + /// + /// The error code. Possible values include: + /// 'NotSpecified', 'IntegrationServiceEnvironmentNotFound', + /// 'InternalServerError', 'InvalidOperationId' + /// The error message. + /// The error message details. + /// The inner error. + public ExtendedErrorInfo(string code, string message, IList details = default(IList), object innerError = default(object)) + { + Code = code; + Message = message; + Details = details; + InnerError = innerError; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error code. Possible values include: + /// 'NotSpecified', 'IntegrationServiceEnvironmentNotFound', + /// 'InternalServerError', 'InvalidOperationId' + /// + [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 the error message details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; set; } + + /// + /// Gets or sets the inner error. + /// + [JsonProperty(PropertyName = "innerError")] + public object InnerError { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Code == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Code"); + } + if (Message == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Message"); + } + if (Details != null) + { + foreach (var element in Details) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/FlowEndpoints.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/FlowEndpoints.cs new file mode 100644 index 000000000000..ea5ff92e4b42 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/FlowEndpoints.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The flow endpoints configuration. + /// + public partial class FlowEndpoints + { + /// + /// Initializes a new instance of the FlowEndpoints class. + /// + public FlowEndpoints() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FlowEndpoints class. + /// + /// The outgoing ip address. + /// The access endpoint ip + /// address. + public FlowEndpoints(IList outgoingIpAddresses = default(IList), IList accessEndpointIpAddresses = default(IList)) + { + OutgoingIpAddresses = outgoingIpAddresses; + AccessEndpointIpAddresses = accessEndpointIpAddresses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the outgoing ip address. + /// + [JsonProperty(PropertyName = "outgoingIpAddresses")] + public IList OutgoingIpAddresses { get; set; } + + /// + /// Gets or sets the access endpoint ip address. + /// + [JsonProperty(PropertyName = "accessEndpointIpAddresses")] + public IList AccessEndpointIpAddresses { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/FlowEndpointsConfiguration.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/FlowEndpointsConfiguration.cs new file mode 100644 index 000000000000..7f224cafc2ae --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/FlowEndpointsConfiguration.cs @@ -0,0 +1,59 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The endpoints configuration. + /// + public partial class FlowEndpointsConfiguration + { + /// + /// Initializes a new instance of the FlowEndpointsConfiguration class. + /// + public FlowEndpointsConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FlowEndpointsConfiguration class. + /// + /// The workflow endpoints. + /// The connector endpoints. + public FlowEndpointsConfiguration(FlowEndpoints workflow = default(FlowEndpoints), FlowEndpoints connector = default(FlowEndpoints)) + { + Workflow = workflow; + Connector = connector; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the workflow endpoints. + /// + [JsonProperty(PropertyName = "workflow")] + public FlowEndpoints Workflow { get; set; } + + /// + /// Gets or sets the connector endpoints. + /// + [JsonProperty(PropertyName = "connector")] + public FlowEndpoints Connector { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationAccount.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationAccount.cs index c705e1e10f9b..f5a13cd7c25e 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationAccount.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationAccount.cs @@ -10,6 +10,8 @@ namespace Microsoft.Azure.Management.Logic.Models { + using Microsoft.Rest; + using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; @@ -18,6 +20,7 @@ namespace Microsoft.Azure.Management.Logic.Models /// /// The integration account. /// + [Rest.Serialization.JsonTransformation] public partial class IntegrationAccount : Resource { /// @@ -36,13 +39,17 @@ public IntegrationAccount() /// Gets the resource type. /// The resource location. /// The resource tags. - /// The integration account - /// properties. + /// The integration service + /// environment. + /// The workflow state. Possible values include: + /// 'NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', + /// 'Suspended' /// The sku. - public IntegrationAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), object properties = default(object), IntegrationAccountSku sku = default(IntegrationAccountSku)) + public IntegrationAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IntegrationServiceEnvironment integrationServiceEnvironment = default(IntegrationServiceEnvironment), string state = default(string), IntegrationAccountSku sku = default(IntegrationAccountSku)) : base(id, name, type, location, tags) { - Properties = properties; + IntegrationServiceEnvironment = integrationServiceEnvironment; + State = state; Sku = sku; CustomInit(); } @@ -53,10 +60,18 @@ public IntegrationAccount() partial void CustomInit(); /// - /// Gets or sets the integration account properties. + /// Gets or sets the integration service environment. /// - [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } + [JsonProperty(PropertyName = "properties.integrationServiceEnvironment")] + public IntegrationServiceEnvironment IntegrationServiceEnvironment { get; set; } + + /// + /// Gets or sets the workflow state. Possible values include: + /// 'NotSpecified', 'Completed', 'Enabled', 'Disabled', 'Deleted', + /// 'Suspended' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; set; } /// /// Gets or sets the sku. @@ -67,7 +82,7 @@ public IntegrationAccount() /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironment.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironment.cs new file mode 100644 index 000000000000..92db999876cd --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironment.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The integration service environment. + /// + public partial class IntegrationServiceEnvironment : Resource + { + /// + /// Initializes a new instance of the IntegrationServiceEnvironment + /// class. + /// + public IntegrationServiceEnvironment() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IntegrationServiceEnvironment + /// class. + /// + /// The resource id. + /// Gets the resource name. + /// Gets the resource type. + /// The resource location. + /// The resource tags. + /// The integration service environment + /// properties. + /// The sku. + public IntegrationServiceEnvironment(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), IntegrationServiceEnvironmentProperties properties = default(IntegrationServiceEnvironmentProperties), IntegrationServiceEnvironmentSku sku = default(IntegrationServiceEnvironmentSku)) + : base(id, name, type, location, tags) + { + Properties = properties; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the integration service environment properties. + /// + [JsonProperty(PropertyName = "properties")] + public IntegrationServiceEnvironmentProperties Properties { get; set; } + + /// + /// Gets or sets the sku. + /// + [JsonProperty(PropertyName = "sku")] + public IntegrationServiceEnvironmentSku Sku { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WorkflowRunActionRepetitionDefinitionCollection.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentAccessEndpoint.cs similarity index 55% rename from sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WorkflowRunActionRepetitionDefinitionCollection.cs rename to sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentAccessEndpoint.cs index 148ec055cfa1..39186d197390 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WorkflowRunActionRepetitionDefinitionCollection.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentAccessEndpoint.cs @@ -11,31 +11,31 @@ namespace Microsoft.Azure.Management.Logic.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// A collection of workflow run action repetitions. + /// The integration service environment access endpoint. /// - public partial class WorkflowRunActionRepetitionDefinitionCollection + public partial class IntegrationServiceEnvironmentAccessEndpoint { /// /// Initializes a new instance of the - /// WorkflowRunActionRepetitionDefinitionCollection class. + /// IntegrationServiceEnvironmentAccessEndpoint class. /// - public WorkflowRunActionRepetitionDefinitionCollection() + public IntegrationServiceEnvironmentAccessEndpoint() { CustomInit(); } /// /// Initializes a new instance of the - /// WorkflowRunActionRepetitionDefinitionCollection class. + /// IntegrationServiceEnvironmentAccessEndpoint class. /// - public WorkflowRunActionRepetitionDefinitionCollection(IList value = default(IList)) + /// The access endpoint type. Possible values + /// include: 'NotSpecified', 'External', 'Internal' + public IntegrationServiceEnvironmentAccessEndpoint(string type = default(string)) { - Value = value; + Type = type; CustomInit(); } @@ -45,9 +45,11 @@ public WorkflowRunActionRepetitionDefinitionCollection() partial void CustomInit(); /// + /// Gets or sets the access endpoint type. Possible values include: + /// 'NotSpecified', 'External', 'Internal' /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } } } diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentAccessEndpointType.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentAccessEndpointType.cs new file mode 100644 index 000000000000..de9448bde30f --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentAccessEndpointType.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.Logic.Models +{ + + /// + /// Defines values for IntegrationServiceEnvironmentAccessEndpointType. + /// + public static class IntegrationServiceEnvironmentAccessEndpointType + { + public const string NotSpecified = "NotSpecified"; + public const string External = "External"; + public const string Internal = "Internal"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependency.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependency.cs new file mode 100644 index 000000000000..b44e476b4212 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependency.cs @@ -0,0 +1,82 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The azure async operation resource. + /// + public partial class IntegrationServiceEnvironmentNetworkDependency + { + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentNetworkDependency class. + /// + public IntegrationServiceEnvironmentNetworkDependency() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentNetworkDependency class. + /// + /// The network dependency category type. + /// Possible values include: 'NotSpecified', 'AzureStorage', + /// 'AzureManagement', 'AzureActiveDirectory', + /// 'SSLCertificateVerification', 'DiagnosticLogsAndMetrics', + /// 'IntegrationServiceEnvironmentConnectors', 'RedisCache', + /// 'AccessEndpoints', 'RecoveryService', 'SQL', + /// 'RegionalService' + /// The display name. + /// The endpoints. + public IntegrationServiceEnvironmentNetworkDependency(string category = default(string), string displayName = default(string), IList endpoints = default(IList)) + { + Category = category; + DisplayName = displayName; + Endpoints = endpoints; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the network dependency category type. Possible values + /// include: 'NotSpecified', 'AzureStorage', 'AzureManagement', + /// 'AzureActiveDirectory', 'SSLCertificateVerification', + /// 'DiagnosticLogsAndMetrics', + /// 'IntegrationServiceEnvironmentConnectors', 'RedisCache', + /// 'AccessEndpoints', 'RecoveryService', 'SQL', 'RegionalService' + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets the display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the endpoints. + /// + [JsonProperty(PropertyName = "endpoints")] + public IList Endpoints { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyCategoryType.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyCategoryType.cs new file mode 100644 index 000000000000..9fb3caaf0a3b --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyCategoryType.cs @@ -0,0 +1,33 @@ +// +// 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.Logic.Models +{ + + /// + /// Defines values for + /// IntegrationServiceEnvironmentNetworkDependencyCategoryType. + /// + public static class IntegrationServiceEnvironmentNetworkDependencyCategoryType + { + public const string NotSpecified = "NotSpecified"; + public const string AzureStorage = "AzureStorage"; + public const string AzureManagement = "AzureManagement"; + public const string AzureActiveDirectory = "AzureActiveDirectory"; + public const string SSLCertificateVerification = "SSLCertificateVerification"; + public const string DiagnosticLogsAndMetrics = "DiagnosticLogsAndMetrics"; + public const string IntegrationServiceEnvironmentConnectors = "IntegrationServiceEnvironmentConnectors"; + public const string RedisCache = "RedisCache"; + public const string AccessEndpoints = "AccessEndpoints"; + public const string RecoveryService = "RecoveryService"; + public const string SQL = "SQL"; + public const string RegionalService = "RegionalService"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyHealth.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyHealth.cs new file mode 100644 index 000000000000..8e671ee7c290 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyHealth.cs @@ -0,0 +1,78 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The integration service environment subnet network health. + /// + public partial class IntegrationServiceEnvironmentNetworkDependencyHealth + { + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentNetworkDependencyHealth class. + /// + public IntegrationServiceEnvironmentNetworkDependencyHealth() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentNetworkDependencyHealth class. + /// + /// The error if any occurred during the + /// operation. + /// The network dependency health state. Possible + /// values include: 'NotSpecified', 'Healthy', 'Unhealthy', + /// 'Unknown' + public IntegrationServiceEnvironmentNetworkDependencyHealth(ExtendedErrorInfo error = default(ExtendedErrorInfo), string state = default(string)) + { + Error = error; + State = state; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error if any occurred during the operation. + /// + [JsonProperty(PropertyName = "error")] + public ExtendedErrorInfo Error { get; set; } + + /// + /// Gets or sets the network dependency health state. Possible values + /// include: 'NotSpecified', 'Healthy', 'Unhealthy', 'Unknown' + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Error != null) + { + Error.Validate(); + } + } + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyHealthState.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyHealthState.cs new file mode 100644 index 000000000000..126c2dc7cb29 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkDependencyHealthState.cs @@ -0,0 +1,25 @@ +// +// 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.Logic.Models +{ + + /// + /// Defines values for + /// IntegrationServiceEnvironmentNetworkDependencyHealthState. + /// + public static class IntegrationServiceEnvironmentNetworkDependencyHealthState + { + public const string NotSpecified = "NotSpecified"; + public const string Healthy = "Healthy"; + public const string Unhealthy = "Unhealthy"; + public const string Unknown = "Unknown"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkEndPointAccessibilityState.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkEndPointAccessibilityState.cs new file mode 100644 index 000000000000..5df469deac79 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkEndPointAccessibilityState.cs @@ -0,0 +1,25 @@ +// +// 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.Logic.Models +{ + + /// + /// Defines values for + /// IntegrationServiceEnvironmentNetworkEndPointAccessibilityState. + /// + public static class IntegrationServiceEnvironmentNetworkEndPointAccessibilityState + { + public const string NotSpecified = "NotSpecified"; + public const string Unknown = "Unknown"; + public const string Available = "Available"; + public const string NotAvailable = "NotAvailable"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkEndpoint.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkEndpoint.cs new file mode 100644 index 000000000000..930c4acc3c4f --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentNetworkEndpoint.cs @@ -0,0 +1,74 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The network endpoint. + /// + public partial class IntegrationServiceEnvironmentNetworkEndpoint + { + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentNetworkEndpoint class. + /// + public IntegrationServiceEnvironmentNetworkEndpoint() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentNetworkEndpoint class. + /// + /// The accessibility state. Possible + /// values include: 'NotSpecified', 'Unknown', 'Available', + /// 'NotAvailable' + /// The domain name. + /// The ports. + public IntegrationServiceEnvironmentNetworkEndpoint(string accessibility = default(string), string domainName = default(string), IList ports = default(IList)) + { + Accessibility = accessibility; + DomainName = domainName; + Ports = ports; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the accessibility state. Possible values include: + /// 'NotSpecified', 'Unknown', 'Available', 'NotAvailable' + /// + [JsonProperty(PropertyName = "accessibility")] + public string Accessibility { get; set; } + + /// + /// Gets or sets the domain name. + /// + [JsonProperty(PropertyName = "domainName")] + public string DomainName { get; set; } + + /// + /// Gets or sets the ports. + /// + [JsonProperty(PropertyName = "ports")] + public IList Ports { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentProperties.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentProperties.cs new file mode 100644 index 000000000000..5c3ad225dce2 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentProperties.cs @@ -0,0 +1,100 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The integration service environment properties. + /// + public partial class IntegrationServiceEnvironmentProperties + { + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentProperties class. + /// + public IntegrationServiceEnvironmentProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentProperties class. + /// + /// The provisioning state. Possible + /// values include: 'NotSpecified', 'Accepted', 'Running', 'Ready', + /// 'Creating', 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Moving', 'Updating', 'Registering', 'Registered', + /// 'Unregistering', 'Unregistered', 'Completed' + /// The integration service environment state. + /// Possible values include: 'NotSpecified', 'Completed', 'Enabled', + /// 'Disabled', 'Deleted', 'Suspended' + /// Gets the tracking + /// id. + /// The endpoints + /// configuration. + /// The network + /// configuration. + public IntegrationServiceEnvironmentProperties(string provisioningState = default(string), string state = default(string), string integrationServiceEnvironmentId = default(string), FlowEndpointsConfiguration endpointsConfiguration = default(FlowEndpointsConfiguration), NetworkConfiguration networkConfiguration = default(NetworkConfiguration)) + { + ProvisioningState = provisioningState; + State = state; + IntegrationServiceEnvironmentId = integrationServiceEnvironmentId; + EndpointsConfiguration = endpointsConfiguration; + NetworkConfiguration = networkConfiguration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the provisioning state. Possible values include: + /// 'NotSpecified', 'Accepted', 'Running', 'Ready', 'Creating', + /// 'Created', 'Deleting', 'Deleted', 'Canceled', 'Failed', + /// 'Succeeded', 'Moving', 'Updating', 'Registering', 'Registered', + /// 'Unregistering', 'Unregistered', 'Completed' + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + /// + /// Gets or sets the integration service environment state. Possible + /// values include: 'NotSpecified', 'Completed', 'Enabled', 'Disabled', + /// 'Deleted', 'Suspended' + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + /// + /// Gets the tracking id. + /// + [JsonProperty(PropertyName = "integrationServiceEnvironmentId")] + public string IntegrationServiceEnvironmentId { get; set; } + + /// + /// Gets or sets the endpoints configuration. + /// + [JsonProperty(PropertyName = "endpointsConfiguration")] + public FlowEndpointsConfiguration EndpointsConfiguration { get; set; } + + /// + /// Gets or sets the network configuration. + /// + [JsonProperty(PropertyName = "networkConfiguration")] + public NetworkConfiguration NetworkConfiguration { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSku.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSku.cs new file mode 100644 index 000000000000..db90caac5e89 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSku.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The integration service environment sku. + /// + public partial class IntegrationServiceEnvironmentSku + { + /// + /// Initializes a new instance of the IntegrationServiceEnvironmentSku + /// class. + /// + public IntegrationServiceEnvironmentSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IntegrationServiceEnvironmentSku + /// class. + /// + /// The sku name. Possible values include: + /// 'NotSpecified', 'Premium', 'Developer' + /// The sku capacity. + public IntegrationServiceEnvironmentSku(string name = default(string), int? capacity = default(int?)) + { + Name = name; + Capacity = capacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the sku name. Possible values include: 'NotSpecified', + /// 'Premium', 'Developer' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the sku capacity. + /// + [JsonProperty(PropertyName = "capacity")] + public int? Capacity { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuCapacity.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuCapacity.cs new file mode 100644 index 000000000000..eed37fbaeaa6 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuCapacity.cs @@ -0,0 +1,79 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The integration service environment sku capacity. + /// + public partial class IntegrationServiceEnvironmentSkuCapacity + { + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentSkuCapacity class. + /// + public IntegrationServiceEnvironmentSkuCapacity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentSkuCapacity class. + /// + /// The minimum capacity. + /// The maximum capacity. + /// The default capacity. + /// The sku scale type. Possible values + /// include: 'Manual', 'Automatic', 'None' + public IntegrationServiceEnvironmentSkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) + { + Minimum = minimum; + Maximum = maximum; + DefaultProperty = defaultProperty; + ScaleType = scaleType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the minimum capacity. + /// + [JsonProperty(PropertyName = "minimum")] + public int? Minimum { get; set; } + + /// + /// Gets or sets the maximum capacity. + /// + [JsonProperty(PropertyName = "maximum")] + public int? Maximum { get; set; } + + /// + /// Gets or sets the default capacity. + /// + [JsonProperty(PropertyName = "default")] + public int? DefaultProperty { get; set; } + + /// + /// Gets or sets the sku scale type. Possible values include: 'Manual', + /// 'Automatic', 'None' + /// + [JsonProperty(PropertyName = "scaleType")] + public string ScaleType { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuDefinition.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuDefinition.cs new file mode 100644 index 000000000000..86d309183d02 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuDefinition.cs @@ -0,0 +1,69 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The integration service environment sku definition. + /// + public partial class IntegrationServiceEnvironmentSkuDefinition + { + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentSkuDefinition class. + /// + public IntegrationServiceEnvironmentSkuDefinition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentSkuDefinition class. + /// + /// The resource type. + /// The sku. + /// The sku capacity. + public IntegrationServiceEnvironmentSkuDefinition(string resourceType = default(string), IntegrationServiceEnvironmentSkuDefinitionSku sku = default(IntegrationServiceEnvironmentSkuDefinitionSku), IntegrationServiceEnvironmentSkuCapacity capacity = default(IntegrationServiceEnvironmentSkuCapacity)) + { + ResourceType = resourceType; + Sku = sku; + Capacity = capacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the resource type. + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; set; } + + /// + /// Gets or sets the sku. + /// + [JsonProperty(PropertyName = "sku")] + public IntegrationServiceEnvironmentSkuDefinitionSku Sku { get; set; } + + /// + /// Gets or sets the sku capacity. + /// + [JsonProperty(PropertyName = "capacity")] + public IntegrationServiceEnvironmentSkuCapacity Capacity { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuDefinitionSku.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuDefinitionSku.cs new file mode 100644 index 000000000000..b329f2140636 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuDefinitionSku.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The sku. + /// + public partial class IntegrationServiceEnvironmentSkuDefinitionSku + { + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentSkuDefinitionSku class. + /// + public IntegrationServiceEnvironmentSkuDefinitionSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentSkuDefinitionSku class. + /// + /// The sku name. Possible values include: + /// 'NotSpecified', 'Premium', 'Developer' + /// The sku tier. + public IntegrationServiceEnvironmentSkuDefinitionSku(string name = default(string), string tier = default(string)) + { + Name = name; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the sku name. Possible values include: 'NotSpecified', + /// 'Premium', 'Developer' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the sku tier. + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuName.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuName.cs new file mode 100644 index 000000000000..40522e37b13e --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuName.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.Logic.Models +{ + + /// + /// Defines values for IntegrationServiceEnvironmentSkuName. + /// + public static class IntegrationServiceEnvironmentSkuName + { + public const string NotSpecified = "NotSpecified"; + public const string Premium = "Premium"; + public const string Developer = "Developer"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuScaleType.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuScaleType.cs new file mode 100644 index 000000000000..37eb906577ec --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSkuScaleType.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.Logic.Models +{ + + /// + /// Defines values for IntegrationServiceEnvironmentSkuScaleType. + /// + public static class IntegrationServiceEnvironmentSkuScaleType + { + public const string Manual = "Manual"; + public const string Automatic = "Automatic"; + public const string None = "None"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSubnetNetworkHealth.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSubnetNetworkHealth.cs new file mode 100644 index 000000000000..b18c5f0523c6 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IntegrationServiceEnvironmentSubnetNetworkHealth.cs @@ -0,0 +1,95 @@ +// +// 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.Logic.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The integration service environment subnet network health. + /// + public partial class IntegrationServiceEnvironmentSubnetNetworkHealth + { + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentSubnetNetworkHealth class. + /// + public IntegrationServiceEnvironmentSubnetNetworkHealth() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IntegrationServiceEnvironmentSubnetNetworkHealth class. + /// + /// The integration service + /// environment network health state. Possible values include: + /// 'NotSpecified', 'Unknown', 'Available', 'NotAvailable' + /// The outbound network + /// dependencies. + /// The integration service + /// environment network health. + public IntegrationServiceEnvironmentSubnetNetworkHealth(string networkDependencyHealthState, IList outboundNetworkDependencies = default(IList), IntegrationServiceEnvironmentNetworkDependencyHealth outboundNetworkHealth = default(IntegrationServiceEnvironmentNetworkDependencyHealth)) + { + OutboundNetworkDependencies = outboundNetworkDependencies; + OutboundNetworkHealth = outboundNetworkHealth; + NetworkDependencyHealthState = networkDependencyHealthState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the outbound network dependencies. + /// + [JsonProperty(PropertyName = "outboundNetworkDependencies")] + public IList OutboundNetworkDependencies { get; set; } + + /// + /// Gets or sets the integration service environment network health. + /// + [JsonProperty(PropertyName = "outboundNetworkHealth")] + public IntegrationServiceEnvironmentNetworkDependencyHealth OutboundNetworkHealth { get; set; } + + /// + /// Gets or sets the integration service environment network health + /// state. Possible values include: 'NotSpecified', 'Unknown', + /// 'Available', 'NotAvailable' + /// + [JsonProperty(PropertyName = "networkDependencyHealthState")] + public string NetworkDependencyHealthState { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NetworkDependencyHealthState == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NetworkDependencyHealthState"); + } + if (OutboundNetworkHealth != null) + { + OutboundNetworkHealth.Validate(); + } + } + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IpAddress.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IpAddress.cs new file mode 100644 index 000000000000..05996017afb4 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/IpAddress.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The ip address. + /// + public partial class IpAddress + { + /// + /// Initializes a new instance of the IpAddress class. + /// + public IpAddress() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IpAddress class. + /// + /// The address. + public IpAddress(string address = default(string)) + { + Address = address; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the address. + /// + [JsonProperty(PropertyName = "address")] + public string Address { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ManagedApi.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ManagedApi.cs new file mode 100644 index 000000000000..d8591c9a7b13 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/ManagedApi.cs @@ -0,0 +1,59 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The managed api definition. + /// + public partial class ManagedApi : Resource + { + /// + /// Initializes a new instance of the ManagedApi class. + /// + public ManagedApi() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedApi class. + /// + /// The resource id. + /// Gets the resource name. + /// Gets the resource type. + /// The resource location. + /// The resource tags. + /// The api resource properties. + public ManagedApi(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), ApiResourceProperties properties = default(ApiResourceProperties)) + : base(id, name, type, location, tags) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the api resource properties. + /// + [JsonProperty(PropertyName = "properties")] + public ApiResourceProperties Properties { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/NetworkConfiguration.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/NetworkConfiguration.cs new file mode 100644 index 000000000000..06f666c53eb1 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/NetworkConfiguration.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The network configuration. + /// + public partial class NetworkConfiguration + { + /// + /// Initializes a new instance of the NetworkConfiguration class. + /// + public NetworkConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkConfiguration class. + /// + /// Gets the virtual network + /// address space. + /// The access endpoint. + /// The subnets. + public NetworkConfiguration(string virtualNetworkAddressSpace = default(string), IntegrationServiceEnvironmentAccessEndpoint accessEndpoint = default(IntegrationServiceEnvironmentAccessEndpoint), IList subnets = default(IList)) + { + VirtualNetworkAddressSpace = virtualNetworkAddressSpace; + AccessEndpoint = accessEndpoint; + Subnets = subnets; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the virtual network address space. + /// + [JsonProperty(PropertyName = "virtualNetworkAddressSpace")] + public string VirtualNetworkAddressSpace { get; set; } + + /// + /// Gets or sets the access endpoint. + /// + [JsonProperty(PropertyName = "accessEndpoint")] + public IntegrationServiceEnvironmentAccessEndpoint AccessEndpoint { get; set; } + + /// + /// Gets or sets the subnets. + /// + [JsonProperty(PropertyName = "subnets")] + public IList Subnets { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SetTriggerStateActionDefinition.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SetTriggerStateActionDefinition.cs index 8641f12ea201..f18abbbe2086 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SetTriggerStateActionDefinition.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SetTriggerStateActionDefinition.cs @@ -14,6 +14,9 @@ namespace Microsoft.Azure.Management.Logic.Models using Newtonsoft.Json; using System.Linq; + /// + /// The set trigger state action definition. + /// public partial class SetTriggerStateActionDefinition { /// @@ -29,6 +32,7 @@ public SetTriggerStateActionDefinition() /// Initializes a new instance of the SetTriggerStateActionDefinition /// class. /// + /// The source. public SetTriggerStateActionDefinition(WorkflowTrigger source) { Source = source; @@ -41,6 +45,7 @@ public SetTriggerStateActionDefinition(WorkflowTrigger source) partial void CustomInit(); /// + /// Gets or sets the source. /// [JsonProperty(PropertyName = "source")] public WorkflowTrigger Source { get; set; } diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/StatusAnnotation.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/StatusAnnotation.cs new file mode 100644 index 000000000000..41a89600a0de --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/StatusAnnotation.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.Logic.Models +{ + + /// + /// Defines values for StatusAnnotation. + /// + public static class StatusAnnotation + { + public const string NotSpecified = "NotSpecified"; + public const string Preview = "Preview"; + public const string Production = "Production"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicList.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicList.cs new file mode 100644 index 000000000000..5c9b84bfc594 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicList.cs @@ -0,0 +1,102 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The swagger custom dynamic list. + /// + public partial class SwaggerCustomDynamicList + { + /// + /// Initializes a new instance of the SwaggerCustomDynamicList class. + /// + public SwaggerCustomDynamicList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerCustomDynamicList class. + /// + /// The operation id to fetch dynamic + /// schema. + /// The built in operation. + /// The path to a response property (relative + /// to the response object, not the response body) which contains an + /// array of dynamic value items. + /// The path to a property which defines + /// the value which should be used. + /// The path to an item property which + /// defines the display name of the item. + /// The parameters. + public SwaggerCustomDynamicList(string operationId = default(string), string builtInOperation = default(string), string itemsPath = default(string), string itemValuePath = default(string), string itemTitlePath = default(string), IDictionary parameters = default(IDictionary)) + { + OperationId = operationId; + BuiltInOperation = builtInOperation; + ItemsPath = itemsPath; + ItemValuePath = itemValuePath; + ItemTitlePath = itemTitlePath; + Parameters = parameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the operation id to fetch dynamic schema. + /// + [JsonProperty(PropertyName = "operationId")] + public string OperationId { get; set; } + + /// + /// Gets or sets the built in operation. + /// + [JsonProperty(PropertyName = "builtInOperation")] + public string BuiltInOperation { get; set; } + + /// + /// Gets or sets the path to a response property (relative to the + /// response object, not the response body) which contains an array of + /// dynamic value items. + /// + [JsonProperty(PropertyName = "itemsPath")] + public string ItemsPath { get; set; } + + /// + /// Gets or sets the path to a property which defines the value which + /// should be used. + /// + [JsonProperty(PropertyName = "itemValuePath")] + public string ItemValuePath { get; set; } + + /// + /// Gets or sets the path to an item property which defines the display + /// name of the item. + /// + [JsonProperty(PropertyName = "itemTitlePath")] + public string ItemTitlePath { get; set; } + + /// + /// Gets or sets the parameters. + /// + [JsonProperty(PropertyName = "parameters")] + public IDictionary Parameters { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicProperties.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicProperties.cs new file mode 100644 index 000000000000..56a410b26e71 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicProperties.cs @@ -0,0 +1,74 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The swagger custom dynamic properties. + /// + public partial class SwaggerCustomDynamicProperties + { + /// + /// Initializes a new instance of the SwaggerCustomDynamicProperties + /// class. + /// + public SwaggerCustomDynamicProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerCustomDynamicProperties + /// class. + /// + /// The operation id to fetch dynamic + /// schema. + /// Json pointer to the dynamic schema on the + /// response body. + /// The operation parameters. + public SwaggerCustomDynamicProperties(string operationId = default(string), string valuePath = default(string), IDictionary parameters = default(IDictionary)) + { + OperationId = operationId; + ValuePath = valuePath; + Parameters = parameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the operation id to fetch dynamic schema. + /// + [JsonProperty(PropertyName = "operationId")] + public string OperationId { get; set; } + + /// + /// Gets or sets json pointer to the dynamic schema on the response + /// body. + /// + [JsonProperty(PropertyName = "valuePath")] + public string ValuePath { get; set; } + + /// + /// Gets or sets the operation parameters. + /// + [JsonProperty(PropertyName = "parameters")] + public IDictionary Parameters { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicSchema.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicSchema.cs new file mode 100644 index 000000000000..0e1fea9faabd --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicSchema.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The swagger custom dynamic schema. + /// + public partial class SwaggerCustomDynamicSchema + { + /// + /// Initializes a new instance of the SwaggerCustomDynamicSchema class. + /// + public SwaggerCustomDynamicSchema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerCustomDynamicSchema class. + /// + /// The operation id to fetch dynamic + /// schema. + /// Json pointer to the dynamic schema on the + /// response body. + /// The operation parameters. + public SwaggerCustomDynamicSchema(string operationId = default(string), string valuePath = default(string), IDictionary parameters = default(IDictionary)) + { + OperationId = operationId; + ValuePath = valuePath; + Parameters = parameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the operation id to fetch dynamic schema. + /// + [JsonProperty(PropertyName = "operationId")] + public string OperationId { get; set; } + + /// + /// Gets or sets json pointer to the dynamic schema on the response + /// body. + /// + [JsonProperty(PropertyName = "valuePath")] + public string ValuePath { get; set; } + + /// + /// Gets or sets the operation parameters. + /// + [JsonProperty(PropertyName = "parameters")] + public IDictionary Parameters { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTree.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTree.cs new file mode 100644 index 000000000000..7748759a84a1 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTree.cs @@ -0,0 +1,67 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The swagger custom dynamic tree. + /// + public partial class SwaggerCustomDynamicTree + { + /// + /// Initializes a new instance of the SwaggerCustomDynamicTree class. + /// + public SwaggerCustomDynamicTree() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerCustomDynamicTree class. + /// + /// The tree settings + /// The tree on-open configuration + /// The tree on-browse configuration + public SwaggerCustomDynamicTree(SwaggerCustomDynamicTreeSettings settings = default(SwaggerCustomDynamicTreeSettings), SwaggerCustomDynamicTreeCommand open = default(SwaggerCustomDynamicTreeCommand), SwaggerCustomDynamicTreeCommand browse = default(SwaggerCustomDynamicTreeCommand)) + { + Settings = settings; + Open = open; + Browse = browse; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the tree settings + /// + [JsonProperty(PropertyName = "settings")] + public SwaggerCustomDynamicTreeSettings Settings { get; set; } + + /// + /// Gets or sets the tree on-open configuration + /// + [JsonProperty(PropertyName = "open")] + public SwaggerCustomDynamicTreeCommand Open { get; set; } + + /// + /// Gets or sets the tree on-browse configuration + /// + [JsonProperty(PropertyName = "browse")] + public SwaggerCustomDynamicTreeCommand Browse { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeCommand.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeCommand.cs new file mode 100644 index 000000000000..02218172f438 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeCommand.cs @@ -0,0 +1,123 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The swagger tree command. + /// + public partial class SwaggerCustomDynamicTreeCommand + { + /// + /// Initializes a new instance of the SwaggerCustomDynamicTreeCommand + /// class. + /// + public SwaggerCustomDynamicTreeCommand() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerCustomDynamicTreeCommand + /// class. + /// + /// The path to an item property which + /// defines the display name of the item. + /// The path to an item property which defines + /// the display name of the item. + /// The path to an item property which + /// defines the display name of the item. + /// The path to an item property which + /// defines the display name of the item. + /// The path to an item property which + /// defines the display name of the item. + /// The path to an item property which + /// defines the display name of the item. + /// The path to an item property which + /// defines the display name of the item. + public SwaggerCustomDynamicTreeCommand(string operationId = default(string), string itemsPath = default(string), string itemValuePath = default(string), string itemTitlePath = default(string), string itemFullTitlePath = default(string), string itemIsParent = default(string), string selectableFilter = default(string), IDictionary parameters = default(IDictionary)) + { + OperationId = operationId; + ItemsPath = itemsPath; + ItemValuePath = itemValuePath; + ItemTitlePath = itemTitlePath; + ItemFullTitlePath = itemFullTitlePath; + ItemIsParent = itemIsParent; + SelectableFilter = selectableFilter; + Parameters = parameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the path to an item property which defines the display + /// name of the item. + /// + [JsonProperty(PropertyName = "operationId")] + public string OperationId { get; set; } + + /// + /// Gets or sets the path to an item property which defines the display + /// name of the item. + /// + [JsonProperty(PropertyName = "itemsPath")] + public string ItemsPath { get; set; } + + /// + /// Gets or sets the path to an item property which defines the display + /// name of the item. + /// + [JsonProperty(PropertyName = "itemValuePath")] + public string ItemValuePath { get; set; } + + /// + /// Gets or sets the path to an item property which defines the display + /// name of the item. + /// + [JsonProperty(PropertyName = "itemTitlePath")] + public string ItemTitlePath { get; set; } + + /// + /// Gets or sets the path to an item property which defines the display + /// name of the item. + /// + [JsonProperty(PropertyName = "itemFullTitlePath")] + public string ItemFullTitlePath { get; set; } + + /// + /// Gets or sets the path to an item property which defines the display + /// name of the item. + /// + [JsonProperty(PropertyName = "itemIsParent")] + public string ItemIsParent { get; set; } + + /// + /// Gets or sets the path to an item property which defines the display + /// name of the item. + /// + [JsonProperty(PropertyName = "selectableFilter")] + public string SelectableFilter { get; set; } + + /// + /// + [JsonProperty(PropertyName = "parameters")] + public IDictionary Parameters { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeParameter.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeParameter.cs new file mode 100644 index 000000000000..d5b641704f96 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeParameter.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The swagger custom dynamic tree parameter. + /// + public partial class SwaggerCustomDynamicTreeParameter + { + /// + /// Initializes a new instance of the SwaggerCustomDynamicTreeParameter + /// class. + /// + public SwaggerCustomDynamicTreeParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerCustomDynamicTreeParameter + /// class. + /// + /// Gets or sets a path to a + /// property in the currently selected item to pass as a value to a + /// parameter for the given operation. + /// The parameter value. + /// The parameter reference. + /// Indicates whether the parameter is + /// required. + public SwaggerCustomDynamicTreeParameter(string selectedItemValuePath = default(string), object value = default(object), string parameterReference = default(string), bool? required = default(bool?)) + { + SelectedItemValuePath = selectedItemValuePath; + Value = value; + ParameterReference = parameterReference; + Required = required; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a path to a property in the currently selected item to + /// pass as a value to a parameter for the given operation. + /// + [JsonProperty(PropertyName = "selectedItemValuePath")] + public string SelectedItemValuePath { get; set; } + + /// + /// Gets or sets the parameter value. + /// + [JsonProperty(PropertyName = "value")] + public object Value { get; set; } + + /// + /// Gets or sets the parameter reference. + /// + [JsonProperty(PropertyName = "parameterReference")] + public string ParameterReference { get; set; } + + /// + /// Gets or sets indicates whether the parameter is required. + /// + [JsonProperty(PropertyName = "required")] + public bool? Required { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeSettings.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeSettings.cs new file mode 100644 index 000000000000..4ff18037c14d --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerCustomDynamicTreeSettings.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The swagger custom dynamic tree settings. + /// + public partial class SwaggerCustomDynamicTreeSettings + { + /// + /// Initializes a new instance of the SwaggerCustomDynamicTreeSettings + /// class. + /// + public SwaggerCustomDynamicTreeSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerCustomDynamicTreeSettings + /// class. + /// + /// Indicates whether parent nodes + /// can be selected. + /// Indicates whether leaf nodes can + /// be selected. + public SwaggerCustomDynamicTreeSettings(bool? canSelectParentNodes = default(bool?), bool? canSelectLeafNodes = default(bool?)) + { + CanSelectParentNodes = canSelectParentNodes; + CanSelectLeafNodes = canSelectLeafNodes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether parent nodes can be selected. + /// + [JsonProperty(PropertyName = "CanSelectParentNodes")] + public bool? CanSelectParentNodes { get; set; } + + /// + /// Gets or sets indicates whether leaf nodes can be selected. + /// + [JsonProperty(PropertyName = "CanSelectLeafNodes")] + public bool? CanSelectLeafNodes { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerExternalDocumentation.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerExternalDocumentation.cs new file mode 100644 index 000000000000..40e9b8d3bf18 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerExternalDocumentation.cs @@ -0,0 +1,71 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The swagger external documentation + /// + public partial class SwaggerExternalDocumentation + { + /// + /// Initializes a new instance of the SwaggerExternalDocumentation + /// class. + /// + public SwaggerExternalDocumentation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerExternalDocumentation + /// class. + /// + /// The document description. + /// The documentation Uri. + /// The vendor extensions. + public SwaggerExternalDocumentation(string description = default(string), string uri = default(string), IDictionary extensions = default(IDictionary)) + { + Description = description; + Uri = uri; + Extensions = extensions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the document description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the documentation Uri. + /// + [JsonProperty(PropertyName = "uri")] + public string Uri { get; set; } + + /// + /// Gets or sets the vendor extensions. + /// + [JsonProperty(PropertyName = "extensions")] + public IDictionary Extensions { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerSchema.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerSchema.cs new file mode 100644 index 000000000000..b00265e0f2da --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerSchema.cs @@ -0,0 +1,222 @@ +// +// 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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The swagger schema. + /// + public partial class SwaggerSchema + { + /// + /// Initializes a new instance of the SwaggerSchema class. + /// + public SwaggerSchema() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerSchema class. + /// + /// The reference. + /// The type. Possible values include: 'String', + /// 'Number', 'Integer', 'Boolean', 'Array', 'File', 'Object', + /// 'Null' + /// The title. + /// The items schema. + /// The object properties + /// The additional + /// properties. + /// The object required properties. + /// The maximum number of allowed + /// properties. + /// The minimum number of allowed + /// properties. + /// The schemas which must pass validation when + /// this schema is used. + /// The discriminator. + /// Indicates whether this property must + /// be present in the a request. + /// The xml representation format for a + /// property. + /// The external documentation. + /// The example value. + /// Indicates the notification + /// url extension. If this is set, the property's value should be a + /// callback url for a webhook. + /// The dynamic schema + /// configuration. + /// The dynamic schema + /// configuration. + /// The dynamic list. + /// The dynamic values tree + /// configuration. + public SwaggerSchema(string refProperty = default(string), string type = default(string), string title = default(string), SwaggerSchema items = default(SwaggerSchema), IDictionary properties = default(IDictionary), object additionalProperties = default(object), IList required = default(IList), int? maxProperties = default(int?), int? minProperties = default(int?), IList allOf = default(IList), string discriminator = default(string), bool? readOnlyProperty = default(bool?), SwaggerXml xml = default(SwaggerXml), SwaggerExternalDocumentation externalDocs = default(SwaggerExternalDocumentation), object example = default(object), bool? notificationUrlExtension = default(bool?), SwaggerCustomDynamicSchema dynamicSchemaOld = default(SwaggerCustomDynamicSchema), SwaggerCustomDynamicProperties dynamicSchemaNew = default(SwaggerCustomDynamicProperties), SwaggerCustomDynamicList dynamicListNew = default(SwaggerCustomDynamicList), SwaggerCustomDynamicTree dynamicTree = default(SwaggerCustomDynamicTree)) + { + RefProperty = refProperty; + Type = type; + Title = title; + Items = items; + Properties = properties; + AdditionalProperties = additionalProperties; + Required = required; + MaxProperties = maxProperties; + MinProperties = minProperties; + AllOf = allOf; + Discriminator = discriminator; + ReadOnlyProperty = readOnlyProperty; + Xml = xml; + ExternalDocs = externalDocs; + Example = example; + NotificationUrlExtension = notificationUrlExtension; + DynamicSchemaOld = dynamicSchemaOld; + DynamicSchemaNew = dynamicSchemaNew; + DynamicListNew = dynamicListNew; + DynamicTree = dynamicTree; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the reference. + /// + [JsonProperty(PropertyName = "ref")] + public string RefProperty { get; set; } + + /// + /// Gets or sets the type. Possible values include: 'String', 'Number', + /// 'Integer', 'Boolean', 'Array', 'File', 'Object', 'Null' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets the title. + /// + [JsonProperty(PropertyName = "title")] + public string Title { get; set; } + + /// + /// Gets or sets the items schema. + /// + [JsonProperty(PropertyName = "items")] + public SwaggerSchema Items { get; set; } + + /// + /// Gets or sets the object properties + /// + [JsonProperty(PropertyName = "properties")] + public IDictionary Properties { get; set; } + + /// + /// Gets or sets the additional properties. + /// + [JsonProperty(PropertyName = "additionalProperties")] + public object AdditionalProperties { get; set; } + + /// + /// Gets or sets the object required properties. + /// + [JsonProperty(PropertyName = "required")] + public IList Required { get; set; } + + /// + /// Gets or sets the maximum number of allowed properties. + /// + [JsonProperty(PropertyName = "maxProperties")] + public int? MaxProperties { get; set; } + + /// + /// Gets or sets the minimum number of allowed properties. + /// + [JsonProperty(PropertyName = "minProperties")] + public int? MinProperties { get; set; } + + /// + /// Gets or sets the schemas which must pass validation when this + /// schema is used. + /// + [JsonProperty(PropertyName = "allOf")] + public IList AllOf { get; set; } + + /// + /// Gets or sets the discriminator. + /// + [JsonProperty(PropertyName = "discriminator")] + public string Discriminator { get; set; } + + /// + /// Gets or sets indicates whether this property must be present in the + /// a request. + /// + [JsonProperty(PropertyName = "readOnly")] + public bool? ReadOnlyProperty { get; set; } + + /// + /// Gets or sets the xml representation format for a property. + /// + [JsonProperty(PropertyName = "xml")] + public SwaggerXml Xml { get; set; } + + /// + /// Gets or sets the external documentation. + /// + [JsonProperty(PropertyName = "externalDocs")] + public SwaggerExternalDocumentation ExternalDocs { get; set; } + + /// + /// Gets or sets the example value. + /// + [JsonProperty(PropertyName = "example")] + public object Example { get; set; } + + /// + /// Gets or sets indicates the notification url extension. If this is + /// set, the property's value should be a callback url for a webhook. + /// + [JsonProperty(PropertyName = "notificationUrlExtension")] + public bool? NotificationUrlExtension { get; set; } + + /// + /// Gets or sets the dynamic schema configuration. + /// + [JsonProperty(PropertyName = "dynamicSchemaOld")] + public SwaggerCustomDynamicSchema DynamicSchemaOld { get; set; } + + /// + /// Gets or sets the dynamic schema configuration. + /// + [JsonProperty(PropertyName = "dynamicSchemaNew")] + public SwaggerCustomDynamicProperties DynamicSchemaNew { get; set; } + + /// + /// Gets or sets the dynamic list. + /// + [JsonProperty(PropertyName = "dynamicListNew")] + public SwaggerCustomDynamicList DynamicListNew { get; set; } + + /// + /// Gets or sets the dynamic values tree configuration. + /// + [JsonProperty(PropertyName = "dynamicTree")] + public SwaggerCustomDynamicTree DynamicTree { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerSchemaType.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerSchemaType.cs new file mode 100644 index 000000000000..ec41cd150c3c --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerSchemaType.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.Logic.Models +{ + + /// + /// Defines values for SwaggerSchemaType. + /// + public static class SwaggerSchemaType + { + public const string String = "String"; + public const string Number = "Number"; + public const string Integer = "Integer"; + public const string Boolean = "Boolean"; + public const string Array = "Array"; + public const string File = "File"; + public const string Object = "Object"; + public const string Null = "Null"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerXml.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerXml.cs new file mode 100644 index 000000000000..0431d5169bd4 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/SwaggerXml.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Swagger XML. + /// + public partial class SwaggerXml + { + /// + /// Initializes a new instance of the SwaggerXml class. + /// + public SwaggerXml() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SwaggerXml class. + /// + /// The xml element or attribute name. + /// The xml namespace. + /// The name prefix. + /// Indicates whether the property should be an + /// attribute instead of an element. + /// Indicates whether the array elements are + /// wrapped in a container element. + /// The vendor extensions. + public SwaggerXml(string name = default(string), string namespaceProperty = default(string), string prefix = default(string), bool? attribute = default(bool?), bool? wrapped = default(bool?), IDictionary extensions = default(IDictionary)) + { + Name = name; + NamespaceProperty = namespaceProperty; + Prefix = prefix; + Attribute = attribute; + Wrapped = wrapped; + Extensions = extensions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the xml element or attribute name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the xml namespace. + /// + [JsonProperty(PropertyName = "namespace")] + public string NamespaceProperty { get; set; } + + /// + /// Gets or sets the name prefix. + /// + [JsonProperty(PropertyName = "prefix")] + public string Prefix { get; set; } + + /// + /// Gets or sets indicates whether the property should be an attribute + /// instead of an element. + /// + [JsonProperty(PropertyName = "attribute")] + public bool? Attribute { get; set; } + + /// + /// Gets or sets indicates whether the array elements are wrapped in a + /// container element. + /// + [JsonProperty(PropertyName = "wrapped")] + public bool? Wrapped { get; set; } + + /// + /// Gets or sets the vendor extensions. + /// + [JsonProperty(PropertyName = "extensions")] + public IDictionary Extensions { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEvent.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEvent.cs index 9e4887be1f31..8179db7b4358 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEvent.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEvent.cs @@ -14,6 +14,9 @@ namespace Microsoft.Azure.Management.Logic.Models using Newtonsoft.Json; using System.Linq; + /// + /// The tracking event. + /// public partial class TrackingEvent { /// @@ -27,10 +30,12 @@ public TrackingEvent() /// /// Initializes a new instance of the TrackingEvent class. /// - /// Possible values include: 'LogAlways', - /// 'Critical', 'Error', 'Warning', 'Informational', 'Verbose' - /// Possible values include: 'NotSpecified', - /// 'Custom', 'AS2Message', 'AS2MDN', 'X12Interchange', + /// The event level. Possible values include: + /// 'LogAlways', 'Critical', 'Error', 'Warning', 'Informational', + /// 'Verbose' + /// The event time. + /// The record type. Possible values include: + /// 'NotSpecified', 'Custom', 'AS2Message', 'AS2MDN', 'X12Interchange', /// 'X12FunctionalGroup', 'X12TransactionSet', /// 'X12InterchangeAcknowledgment', 'X12FunctionalGroupAcknowledgment', /// 'X12TransactionSetAcknowledgment', 'EdifactInterchange', @@ -38,6 +43,7 @@ public TrackingEvent() /// 'EdifactInterchangeAcknowledgment', /// 'EdifactFunctionalGroupAcknowledgment', /// 'EdifactTransactionSetAcknowledgment' + /// The error. public TrackingEvent(EventLevel eventLevel, System.DateTime eventTime, string recordType, TrackingEventErrorInfo error = default(TrackingEventErrorInfo)) { EventLevel = eventLevel; @@ -53,22 +59,23 @@ public TrackingEvent() partial void CustomInit(); /// - /// Gets or sets possible values include: 'LogAlways', 'Critical', - /// 'Error', 'Warning', 'Informational', 'Verbose' + /// Gets or sets the event level. Possible values include: 'LogAlways', + /// 'Critical', 'Error', 'Warning', 'Informational', 'Verbose' /// [JsonProperty(PropertyName = "eventLevel")] public EventLevel EventLevel { get; set; } /// + /// Gets or sets the event time. /// [JsonProperty(PropertyName = "eventTime")] public System.DateTime EventTime { get; set; } /// - /// Gets or sets possible values include: 'NotSpecified', 'Custom', - /// 'AS2Message', 'AS2MDN', 'X12Interchange', 'X12FunctionalGroup', - /// 'X12TransactionSet', 'X12InterchangeAcknowledgment', - /// 'X12FunctionalGroupAcknowledgment', + /// Gets or sets the record type. Possible values include: + /// 'NotSpecified', 'Custom', 'AS2Message', 'AS2MDN', 'X12Interchange', + /// 'X12FunctionalGroup', 'X12TransactionSet', + /// 'X12InterchangeAcknowledgment', 'X12FunctionalGroupAcknowledgment', /// 'X12TransactionSetAcknowledgment', 'EdifactInterchange', /// 'EdifactFunctionalGroup', 'EdifactTransactionSet', /// 'EdifactInterchangeAcknowledgment', @@ -79,6 +86,7 @@ public TrackingEvent() public string RecordType { get; set; } /// + /// Gets or sets the error. /// [JsonProperty(PropertyName = "error")] public TrackingEventErrorInfo Error { get; set; } diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEventErrorInfo.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEventErrorInfo.cs index d7089c948147..291dbbca0f15 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEventErrorInfo.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEventErrorInfo.cs @@ -13,6 +13,9 @@ namespace Microsoft.Azure.Management.Logic.Models using Newtonsoft.Json; using System.Linq; + /// + /// The tracking event error info. + /// public partial class TrackingEventErrorInfo { /// @@ -26,6 +29,8 @@ public TrackingEventErrorInfo() /// /// Initializes a new instance of the TrackingEventErrorInfo class. /// + /// The message. + /// The code. public TrackingEventErrorInfo(string message = default(string), string code = default(string)) { Message = message; @@ -39,11 +44,13 @@ public TrackingEventErrorInfo() partial void CustomInit(); /// + /// Gets or sets the message. /// [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// + /// Gets or sets the code. /// [JsonProperty(PropertyName = "code")] public string Code { get; set; } diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEventsDefinition.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEventsDefinition.cs index 89556856542f..516de7995bec 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEventsDefinition.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/TrackingEventsDefinition.cs @@ -16,6 +16,9 @@ namespace Microsoft.Azure.Management.Logic.Models using System.Collections.Generic; using System.Linq; + /// + /// The tracking events definition. + /// public partial class TrackingEventsDefinition { /// @@ -29,8 +32,10 @@ public TrackingEventsDefinition() /// /// Initializes a new instance of the TrackingEventsDefinition class. /// - /// Possible values include: 'None', - /// 'DisableSourceInfoEnrich' + /// The source type. + /// The events. + /// The track events options. Possible + /// values include: 'None', 'DisableSourceInfoEnrich' public TrackingEventsDefinition(string sourceType, IList events, string trackEventsOptions = default(string)) { SourceType = sourceType; @@ -45,18 +50,20 @@ public TrackingEventsDefinition() partial void CustomInit(); /// + /// Gets or sets the source type. /// [JsonProperty(PropertyName = "sourceType")] public string SourceType { get; set; } /// - /// Gets or sets possible values include: 'None', - /// 'DisableSourceInfoEnrich' + /// Gets or sets the track events options. Possible values include: + /// 'None', 'DisableSourceInfoEnrich' /// [JsonProperty(PropertyName = "trackEventsOptions")] public string TrackEventsOptions { get; set; } /// + /// Gets or sets the events. /// [JsonProperty(PropertyName = "events")] public IList Events { get; set; } diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/Workflow.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/Workflow.cs index f6a3322a3dfd..9ebab6563f89 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/Workflow.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/Workflow.cs @@ -51,11 +51,15 @@ public Workflow() /// 'Suspended' /// Gets the version. /// Gets the access endpoint. + /// The endpoints + /// configuration. /// The sku. /// The integration account. + /// The integration service + /// environment. /// The definition. /// The parameters. - public Workflow(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? changedTime = default(System.DateTime?), string state = default(string), string version = default(string), string accessEndpoint = default(string), Sku sku = default(Sku), ResourceReference integrationAccount = default(ResourceReference), object definition = default(object), IDictionary parameters = default(IDictionary)) + public Workflow(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), System.DateTime? createdTime = default(System.DateTime?), System.DateTime? changedTime = default(System.DateTime?), string state = default(string), string version = default(string), string accessEndpoint = default(string), FlowEndpointsConfiguration endpointsConfiguration = default(FlowEndpointsConfiguration), Sku sku = default(Sku), ResourceReference integrationAccount = default(ResourceReference), ResourceReference integrationServiceEnvironment = default(ResourceReference), object definition = default(object), IDictionary parameters = default(IDictionary)) : base(id, name, type, location, tags) { ProvisioningState = provisioningState; @@ -64,8 +68,10 @@ public Workflow() State = state; Version = version; AccessEndpoint = accessEndpoint; + EndpointsConfiguration = endpointsConfiguration; Sku = sku; IntegrationAccount = integrationAccount; + IntegrationServiceEnvironment = integrationServiceEnvironment; Definition = definition; Parameters = parameters; CustomInit(); @@ -117,6 +123,12 @@ public Workflow() [JsonProperty(PropertyName = "properties.accessEndpoint")] public string AccessEndpoint { get; private set; } + /// + /// Gets or sets the endpoints configuration. + /// + [JsonProperty(PropertyName = "properties.endpointsConfiguration")] + public FlowEndpointsConfiguration EndpointsConfiguration { get; set; } + /// /// Gets or sets the sku. /// @@ -129,6 +141,12 @@ public Workflow() [JsonProperty(PropertyName = "properties.integrationAccount")] public ResourceReference IntegrationAccount { get; set; } + /// + /// Gets or sets the integration service environment. + /// + [JsonProperty(PropertyName = "properties.integrationServiceEnvironment")] + public ResourceReference IntegrationServiceEnvironment { get; set; } + /// /// Gets or sets the definition. /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WorkflowTriggerHistory.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WorkflowTriggerHistory.cs index 49bfd277adff..5faddd7097e7 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WorkflowTriggerHistory.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WorkflowTriggerHistory.cs @@ -46,7 +46,7 @@ public WorkflowTriggerHistory() /// Gets the link to input parameters. /// Gets the link to output /// parameters. - /// Gets a value indicating whether trigger was + /// The value indicating whether trigger was /// fired. /// Gets the reference to workflow run. /// Gets the workflow trigger history name. @@ -132,7 +132,7 @@ public WorkflowTriggerHistory() public ContentLink OutputsLink { get; private set; } /// - /// Gets a value indicating whether trigger was fired. + /// Gets the value indicating whether trigger was fired. /// [JsonProperty(PropertyName = "properties.fired")] public bool? Fired { get; private set; } diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WsdlImportMethod.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WsdlImportMethod.cs new file mode 100644 index 000000000000..8739b141e927 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WsdlImportMethod.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.Logic.Models +{ + + /// + /// Defines values for WsdlImportMethod. + /// + public static class WsdlImportMethod + { + public const string NotSpecified = "NotSpecified"; + public const string SoapToRest = "SoapToRest"; + public const string SoapPassThrough = "SoapPassThrough"; + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WsdlService.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WsdlService.cs new file mode 100644 index 000000000000..c0b270d61b19 --- /dev/null +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/WsdlService.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.Logic.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The WSDL service. + /// + public partial class WsdlService + { + /// + /// Initializes a new instance of the WsdlService class. + /// + public WsdlService() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WsdlService class. + /// + /// The qualified name. + /// The list of endpoints' + /// qualified names. + public WsdlService(string qualifiedName = default(string), IList endpointQualifiedNames = default(IList)) + { + QualifiedName = qualifiedName; + EndpointQualifiedNames = endpointQualifiedNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the qualified name. + /// + [JsonProperty(PropertyName = "qualifiedName")] + public string QualifiedName { get; set; } + + /// + /// Gets or sets the list of endpoints' qualified names. + /// + [JsonProperty(PropertyName = "EndpointQualifiedNames")] + public IList EndpointQualifiedNames { get; set; } + + } +} diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/X12ValidationOverride.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/X12ValidationOverride.cs index 855fb4a9ff73..ab16b56d61ad 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/X12ValidationOverride.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/X12ValidationOverride.cs @@ -32,9 +32,9 @@ public X12ValidationOverride() /// /// The message id on which the validation /// settings has to be applied. - /// The value indicating whether to + /// The value indicating whether to /// validate EDI types. - /// The value indicating whether to + /// The value indicating whether to /// validate XSD types. /// The value /// indicating whether to allow leading and trailing spaces and @@ -47,11 +47,11 @@ public X12ValidationOverride() /// The trailing separator /// policy. Possible values include: 'NotSpecified', 'NotAllowed', /// 'Optional', 'Mandatory' - public X12ValidationOverride(string messageId, bool validateEdiTypes, bool validateXsdTypes, bool allowLeadingAndTrailingSpacesAndZeroes, bool validateCharacterSet, bool trimLeadingAndTrailingSpacesAndZeroes, string trailingSeparatorPolicy) + public X12ValidationOverride(string messageId, bool validateEDITypes, bool validateXSDTypes, bool allowLeadingAndTrailingSpacesAndZeroes, bool validateCharacterSet, bool trimLeadingAndTrailingSpacesAndZeroes, string trailingSeparatorPolicy) { MessageId = messageId; - ValidateEdiTypes = validateEdiTypes; - ValidateXsdTypes = validateXsdTypes; + ValidateEDITypes = validateEDITypes; + ValidateXSDTypes = validateXSDTypes; AllowLeadingAndTrailingSpacesAndZeroes = allowLeadingAndTrailingSpacesAndZeroes; ValidateCharacterSet = validateCharacterSet; TrimLeadingAndTrailingSpacesAndZeroes = trimLeadingAndTrailingSpacesAndZeroes; @@ -74,14 +74,14 @@ public X12ValidationOverride(string messageId, bool validateEdiTypes, bool valid /// /// Gets or sets the value indicating whether to validate EDI types. /// - [JsonProperty(PropertyName = "validateEdiTypes")] - public bool ValidateEdiTypes { get; set; } + [JsonProperty(PropertyName = "validateEDITypes")] + public bool ValidateEDITypes { get; set; } /// /// Gets or sets the value indicating whether to validate XSD types. /// - [JsonProperty(PropertyName = "validateXsdTypes")] - public bool ValidateXsdTypes { get; set; } + [JsonProperty(PropertyName = "validateXSDTypes")] + public bool ValidateXSDTypes { get; set; } /// /// Gets or sets the value indicating whether to allow leading and diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/X12ValidationSettings.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/X12ValidationSettings.cs index 2ae403a332bd..9ad7f4884570 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/X12ValidationSettings.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/Models/X12ValidationSettings.cs @@ -42,9 +42,9 @@ public X12ValidationSettings() /// The value /// indicating whether to check for duplicate transaction set control /// number. - /// The value indicating whether to + /// The value indicating whether to /// Whether to validate EDI types. - /// The value indicating whether to + /// The value indicating whether to /// Whether to validate XSD types. /// The value /// indicating whether to allow leading and trailing spaces and @@ -55,15 +55,15 @@ public X12ValidationSettings() /// The trailing separator /// policy. Possible values include: 'NotSpecified', 'NotAllowed', /// 'Optional', 'Mandatory' - public X12ValidationSettings(bool validateCharacterSet, bool checkDuplicateInterchangeControlNumber, int interchangeControlNumberValidityDays, bool checkDuplicateGroupControlNumber, bool checkDuplicateTransactionSetControlNumber, bool validateEdiTypes, bool validateXsdTypes, bool allowLeadingAndTrailingSpacesAndZeroes, bool trimLeadingAndTrailingSpacesAndZeroes, string trailingSeparatorPolicy) + public X12ValidationSettings(bool validateCharacterSet, bool checkDuplicateInterchangeControlNumber, int interchangeControlNumberValidityDays, bool checkDuplicateGroupControlNumber, bool checkDuplicateTransactionSetControlNumber, bool validateEDITypes, bool validateXSDTypes, bool allowLeadingAndTrailingSpacesAndZeroes, bool trimLeadingAndTrailingSpacesAndZeroes, string trailingSeparatorPolicy) { ValidateCharacterSet = validateCharacterSet; CheckDuplicateInterchangeControlNumber = checkDuplicateInterchangeControlNumber; InterchangeControlNumberValidityDays = interchangeControlNumberValidityDays; CheckDuplicateGroupControlNumber = checkDuplicateGroupControlNumber; CheckDuplicateTransactionSetControlNumber = checkDuplicateTransactionSetControlNumber; - ValidateEdiTypes = validateEdiTypes; - ValidateXsdTypes = validateXsdTypes; + ValidateEDITypes = validateEDITypes; + ValidateXSDTypes = validateXSDTypes; AllowLeadingAndTrailingSpacesAndZeroes = allowLeadingAndTrailingSpacesAndZeroes; TrimLeadingAndTrailingSpacesAndZeroes = trimLeadingAndTrailingSpacesAndZeroes; TrailingSeparatorPolicy = trailingSeparatorPolicy; @@ -113,15 +113,15 @@ public X12ValidationSettings(bool validateCharacterSet, bool checkDuplicateInter /// Gets or sets the value indicating whether to Whether to validate /// EDI types. /// - [JsonProperty(PropertyName = "validateEdiTypes")] - public bool ValidateEdiTypes { get; set; } + [JsonProperty(PropertyName = "validateEDITypes")] + public bool ValidateEDITypes { get; set; } /// /// Gets or sets the value indicating whether to Whether to validate /// XSD types. /// - [JsonProperty(PropertyName = "validateXsdTypes")] - public bool ValidateXsdTypes { get; set; } + [JsonProperty(PropertyName = "validateXSDTypes")] + public bool ValidateXSDTypes { get; set; } /// /// Gets or sets the value indicating whether to allow leading and diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/SdkInfo_LogicManagementClient.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/SdkInfo_LogicManagementClient.cs index fc7aeb9d7572..18116d24911a 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/SdkInfo_LogicManagementClient.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/SdkInfo_LogicManagementClient.cs @@ -19,41 +19,35 @@ public static IEnumerable> ApiInfo_LogicManagement { return new Tuple[] { - new Tuple("Logic", "IntegrationAccountAgreements", "2018-07-01-preview"), - new Tuple("Logic", "IntegrationAccountAssemblies", "2018-07-01-preview"), - new Tuple("Logic", "IntegrationAccountBatchConfigurations", "2018-07-01-preview"), - new Tuple("Logic", "IntegrationAccountCertificates", "2018-07-01-preview"), - new Tuple("Logic", "IntegrationAccountMaps", "2018-07-01-preview"), - new Tuple("Logic", "IntegrationAccountPartners", "2018-07-01-preview"), - new Tuple("Logic", "IntegrationAccountSchemas", "2018-07-01-preview"), - new Tuple("Logic", "IntegrationAccountSessions", "2018-07-01-preview"), - new Tuple("Logic", "IntegrationAccounts", "2018-07-01-preview"), - new Tuple("Logic", "Operations", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowRunActionRepetitions", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowRunActionRepetitionsRequestHistories", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowRunActionRequestHistories", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowRunActionScopeRepetitions", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowRunActions", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowRunOperations", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowRuns", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowTriggerHistories", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowTriggers", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowVersionTriggers", "2018-07-01-preview"), - new Tuple("Logic", "WorkflowVersions", "2018-07-01-preview"), - new Tuple("Logic", "Workflows", "2018-07-01-preview"), + new Tuple("Logic", "IntegrationAccountAgreements", "2019-05-01"), + new Tuple("Logic", "IntegrationAccountAssemblies", "2019-05-01"), + new Tuple("Logic", "IntegrationAccountBatchConfigurations", "2019-05-01"), + new Tuple("Logic", "IntegrationAccountCertificates", "2019-05-01"), + new Tuple("Logic", "IntegrationAccountMaps", "2019-05-01"), + new Tuple("Logic", "IntegrationAccountPartners", "2019-05-01"), + new Tuple("Logic", "IntegrationAccountSchemas", "2019-05-01"), + new Tuple("Logic", "IntegrationAccountSessions", "2019-05-01"), + new Tuple("Logic", "IntegrationAccounts", "2019-05-01"), + new Tuple("Logic", "IntegrationServiceEnvironmentManagedApiOperations", "2019-05-01"), + new Tuple("Logic", "IntegrationServiceEnvironmentManagedApis", "2019-05-01"), + new Tuple("Logic", "IntegrationServiceEnvironmentNetworkHealth", "2019-05-01"), + new Tuple("Logic", "IntegrationServiceEnvironmentSkus", "2019-05-01"), + new Tuple("Logic", "IntegrationServiceEnvironments", "2019-05-01"), + new Tuple("Logic", "Operations", "2019-05-01"), + new Tuple("Logic", "WorkflowRunActionRepetitions", "2019-05-01"), + new Tuple("Logic", "WorkflowRunActionRepetitionsRequestHistories", "2019-05-01"), + new Tuple("Logic", "WorkflowRunActionRequestHistories", "2019-05-01"), + new Tuple("Logic", "WorkflowRunActionScopeRepetitions", "2019-05-01"), + new Tuple("Logic", "WorkflowRunActions", "2019-05-01"), + new Tuple("Logic", "WorkflowRunOperations", "2019-05-01"), + new Tuple("Logic", "WorkflowRuns", "2019-05-01"), + new Tuple("Logic", "WorkflowTriggerHistories", "2019-05-01"), + new Tuple("Logic", "WorkflowTriggers", "2019-05-01"), + new Tuple("Logic", "WorkflowVersionTriggers", "2019-05-01"), + new Tuple("Logic", "WorkflowVersions", "2019-05-01"), + new Tuple("Logic", "Workflows", "2019-05-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/logic/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\src\\Other\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "d8a6649b0becb3af50c79da9d4c3b7218dd641e5"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionRepetitionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionRepetitionsOperations.cs index cd11a12135a8..a5cf92b711e1 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionRepetitionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionRepetitionsOperations.cs @@ -71,7 +71,7 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -199,14 +199,13 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -216,10 +215,6 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -288,7 +283,7 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -422,14 +417,13 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -439,10 +433,6 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -511,7 +501,7 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -645,14 +635,13 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -662,10 +651,6 @@ internal WorkflowRunActionRepetitionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionScopeRepetitionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionScopeRepetitionsOperations.cs index 17cd51567d08..42a88bcfd2b9 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionScopeRepetitionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionScopeRepetitionsOperations.cs @@ -71,7 +71,7 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -86,7 +86,7 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string workflowName, string runName, string actionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workflowName, string runName, string actionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -199,14 +199,13 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -216,10 +215,6 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -232,7 +227,7 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien 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")) @@ -245,7 +240,7 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien _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) { @@ -288,7 +283,7 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -422,14 +417,13 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -439,10 +433,6 @@ internal WorkflowRunActionScopeRepetitionsOperations(LogicManagementClient clien } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionScopeRepetitionsOperationsExtensions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionScopeRepetitionsOperationsExtensions.cs index 360710f64fe1..1e78ae018592 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionScopeRepetitionsOperationsExtensions.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionScopeRepetitionsOperationsExtensions.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.Logic using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -39,7 +41,7 @@ public static partial class WorkflowRunActionScopeRepetitionsOperationsExtension /// /// The workflow action name. /// - public static WorkflowRunActionRepetitionDefinitionCollection List(this IWorkflowRunActionScopeRepetitionsOperations operations, string resourceGroupName, string workflowName, string runName, string actionName) + public static IEnumerable List(this IWorkflowRunActionScopeRepetitionsOperations operations, string resourceGroupName, string workflowName, string runName, string actionName) { return operations.ListAsync(resourceGroupName, workflowName, runName, actionName).GetAwaiter().GetResult(); } @@ -65,7 +67,7 @@ public static WorkflowRunActionRepetitionDefinitionCollection List(this IWorkflo /// /// The cancellation token. /// - public static async Task ListAsync(this IWorkflowRunActionScopeRepetitionsOperations operations, string resourceGroupName, string workflowName, string runName, string actionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IWorkflowRunActionScopeRepetitionsOperations operations, string resourceGroupName, string workflowName, string runName, string actionName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workflowName, runName, actionName, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionsOperations.cs index a76ac63c450b..eb9bbea3141d 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunActionsOperations.cs @@ -72,7 +72,7 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -203,14 +203,13 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -220,10 +219,6 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -289,7 +284,7 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -417,14 +412,13 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -434,10 +428,6 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -503,7 +493,7 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -631,14 +621,13 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -648,10 +637,6 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -708,7 +693,7 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -804,14 +789,13 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -821,10 +805,6 @@ internal WorkflowRunActionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunOperations.cs index 321aa494a8cb..121a75ad1ac5 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunOperations.cs @@ -71,7 +71,7 @@ internal WorkflowRunOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -199,14 +199,13 @@ internal WorkflowRunOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -216,10 +215,6 @@ internal WorkflowRunOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunsOperations.cs index e960a04b58e7..f20022516e84 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowRunsOperations.cs @@ -69,7 +69,7 @@ internal WorkflowRunsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -194,14 +194,13 @@ internal WorkflowRunsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +210,6 @@ internal WorkflowRunsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -277,7 +272,7 @@ internal WorkflowRunsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -399,14 +394,13 @@ internal WorkflowRunsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -416,10 +410,6 @@ internal WorkflowRunsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -482,7 +472,7 @@ internal WorkflowRunsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -601,14 +591,13 @@ internal WorkflowRunsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -618,10 +607,6 @@ internal WorkflowRunsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -660,7 +645,7 @@ internal WorkflowRunsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -756,14 +741,13 @@ internal WorkflowRunsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -773,10 +757,6 @@ internal WorkflowRunsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggerHistoriesOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggerHistoriesOperations.cs index c235d90dbbcc..733107a7c78d 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggerHistoriesOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggerHistoriesOperations.cs @@ -72,7 +72,7 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -203,14 +203,13 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -220,10 +219,6 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -290,7 +285,7 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -418,14 +413,13 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -435,10 +429,6 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -483,6 +473,35 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) return _result; } + /// + /// Resubmits a workflow run based on the trigger history. + /// + /// + /// The resource group name. + /// + /// + /// The workflow name. + /// + /// + /// The workflow trigger name. + /// + /// + /// The workflow trigger history name. Corresponds to the run name for triggers + /// that resulted in a run. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ResubmitWithHttpMessagesAsync(string resourceGroupName, string workflowName, string triggerName, string historyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginResubmitWithHttpMessagesAsync(resourceGroupName, workflowName, triggerName, historyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Resubmits a workflow run based on the trigger history. /// @@ -505,7 +524,7 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -517,7 +536,7 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ResubmitWithHttpMessagesAsync(string resourceGroupName, string workflowName, string triggerName, string historyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginResubmitWithHttpMessagesAsync(string resourceGroupName, string workflowName, string triggerName, string historyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -555,7 +574,7 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) tracingParameters.Add("triggerName", triggerName); tracingParameters.Add("historyName", historyName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Resubmit", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginResubmit", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -630,14 +649,13 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -647,10 +665,6 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -689,7 +703,7 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -785,14 +799,13 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -802,10 +815,6 @@ internal WorkflowTriggerHistoriesOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggerHistoriesOperationsExtensions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggerHistoriesOperationsExtensions.cs index 31e2ca9eef01..550b92f0c988 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggerHistoriesOperationsExtensions.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggerHistoriesOperationsExtensions.cs @@ -179,6 +179,57 @@ public static void Resubmit(this IWorkflowTriggerHistoriesOperations operations, (await operations.ResubmitWithHttpMessagesAsync(resourceGroupName, workflowName, triggerName, historyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Resubmits a workflow run based on the trigger history. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The workflow name. + /// + /// + /// The workflow trigger name. + /// + /// + /// The workflow trigger history name. Corresponds to the run name for triggers + /// that resulted in a run. + /// + public static void BeginResubmit(this IWorkflowTriggerHistoriesOperations operations, string resourceGroupName, string workflowName, string triggerName, string historyName) + { + operations.BeginResubmitAsync(resourceGroupName, workflowName, triggerName, historyName).GetAwaiter().GetResult(); + } + + /// + /// Resubmits a workflow run based on the trigger history. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The workflow name. + /// + /// + /// The workflow trigger name. + /// + /// + /// The workflow trigger history name. Corresponds to the run name for triggers + /// that resulted in a run. + /// + /// + /// The cancellation token. + /// + public static async Task BeginResubmitAsync(this IWorkflowTriggerHistoriesOperations operations, string resourceGroupName, string workflowName, string triggerName, string historyName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginResubmitWithHttpMessagesAsync(resourceGroupName, workflowName, triggerName, historyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Gets a list of workflow trigger histories. /// diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggersOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggersOperations.cs index 2203d32a6d8c..734c117ac4fb 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggersOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowTriggersOperations.cs @@ -69,7 +69,7 @@ internal WorkflowTriggersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -194,14 +194,13 @@ internal WorkflowTriggersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +210,6 @@ internal WorkflowTriggersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -277,7 +272,7 @@ internal WorkflowTriggersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -399,14 +394,13 @@ internal WorkflowTriggersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -416,10 +410,6 @@ internal WorkflowTriggersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -482,7 +472,7 @@ internal WorkflowTriggersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -601,14 +591,13 @@ internal WorkflowTriggersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -618,10 +607,6 @@ internal WorkflowTriggersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -859,7 +844,7 @@ internal WorkflowTriggersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -981,14 +966,13 @@ internal WorkflowTriggersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -998,10 +982,6 @@ internal WorkflowTriggersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1067,7 +1047,7 @@ internal WorkflowTriggersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1201,14 +1181,13 @@ internal WorkflowTriggersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1218,10 +1197,6 @@ internal WorkflowTriggersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1266,7 +1241,7 @@ internal WorkflowTriggersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1388,14 +1363,13 @@ internal WorkflowTriggersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1405,10 +1379,6 @@ internal WorkflowTriggersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1465,7 +1435,7 @@ internal WorkflowTriggersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1561,14 +1531,13 @@ internal WorkflowTriggersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1578,10 +1547,6 @@ internal WorkflowTriggersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowVersionTriggersOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowVersionTriggersOperations.cs index 5785ada9a9d7..bae366cc441d 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowVersionTriggersOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowVersionTriggersOperations.cs @@ -74,7 +74,7 @@ internal WorkflowVersionTriggersOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -209,14 +209,13 @@ internal WorkflowVersionTriggersOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -226,10 +225,6 @@ internal WorkflowVersionTriggersOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowVersionsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowVersionsOperations.cs index b38519491694..7f6a37a7e38a 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowVersionsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowVersionsOperations.cs @@ -68,7 +68,7 @@ internal WorkflowVersionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -189,14 +189,13 @@ internal WorkflowVersionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -206,10 +205,6 @@ internal WorkflowVersionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -272,7 +267,7 @@ internal WorkflowVersionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -394,14 +389,13 @@ internal WorkflowVersionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -411,10 +405,6 @@ internal WorkflowVersionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -471,7 +461,7 @@ internal WorkflowVersionsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -567,14 +557,13 @@ internal WorkflowVersionsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -584,10 +573,6 @@ internal WorkflowVersionsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowsOperations.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowsOperations.cs index 3c1fbf42137a..ce55f6da1fe0 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowsOperations.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowsOperations.cs @@ -63,7 +63,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -176,14 +176,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -193,10 +192,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -256,7 +251,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -375,14 +370,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -392,10 +386,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -455,7 +445,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -571,14 +561,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -588,10 +577,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -654,7 +639,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -785,14 +770,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -802,10 +786,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -886,7 +866,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1013,14 +993,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1030,10 +1009,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1093,7 +1068,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1206,14 +1181,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1223,10 +1197,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1268,7 +1238,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1381,14 +1351,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1398,10 +1367,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1443,7 +1408,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1556,14 +1521,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1573,10 +1537,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1621,7 +1581,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1748,14 +1708,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1765,10 +1724,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1831,7 +1786,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1958,14 +1913,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1975,10 +1929,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2038,7 +1988,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2154,14 +2104,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2171,10 +2120,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2232,12 +2177,37 @@ internal WorkflowsOperations(LogicManagementClient client) /// The workflow to move. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task MoveWithHttpMessagesAsync(string resourceGroupName, string workflowName, Workflow move, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginMoveWithHttpMessagesAsync(resourceGroupName, workflowName, move, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Regenerates the callback URL access key for request triggers. + /// + /// + /// The resource group name. + /// + /// + /// The workflow name. + /// + /// + /// The access key type. + /// + /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2249,7 +2219,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task MoveWithHttpMessagesAsync(string resourceGroupName, string workflowName, Workflow move, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task RegenerateAccessKeyWithHttpMessagesAsync(string resourceGroupName, string workflowName, RegenerateActionParameter keyType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2263,13 +2233,9 @@ internal WorkflowsOperations(LogicManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "workflowName"); } - if (move == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "move"); - } - if (move != null) + if (keyType == null) { - move.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); } if (Client.ApiVersion == null) { @@ -2284,13 +2250,13 @@ internal WorkflowsOperations(LogicManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workflowName", workflowName); - tracingParameters.Add("move", move); + tracingParameters.Add("keyType", keyType); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Move", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateAccessKey", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workflowName}", System.Uri.EscapeDataString(workflowName)); @@ -2337,9 +2303,9 @@ internal WorkflowsOperations(LogicManagementClient client) // Serialize Request string _requestContent = null; - if(move != null) + if(keyType != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(move, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(keyType, 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"); } @@ -2363,16 +2329,15 @@ internal WorkflowsOperations(LogicManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2382,10 +2347,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2413,7 +2374,7 @@ internal WorkflowsOperations(LogicManagementClient client) } /// - /// Regenerates the callback URL access key for request triggers. + /// Validates the workflow. /// /// /// The resource group name. @@ -2421,8 +2382,8 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The workflow name. /// - /// - /// The access key type. + /// + /// The workflow. /// /// /// Headers that will be added to request. @@ -2430,7 +2391,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2442,7 +2403,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task RegenerateAccessKeyWithHttpMessagesAsync(string resourceGroupName, string workflowName, RegenerateActionParameter keyType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ValidateByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string workflowName, Workflow validate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2456,9 +2417,13 @@ internal WorkflowsOperations(LogicManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "workflowName"); } - if (keyType == null) + if (validate == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "keyType"); + throw new ValidationException(ValidationRules.CannotBeNull, "validate"); + } + if (validate != null) + { + validate.Validate(); } if (Client.ApiVersion == null) { @@ -2473,13 +2438,13 @@ internal WorkflowsOperations(LogicManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workflowName", workflowName); - tracingParameters.Add("keyType", keyType); + tracingParameters.Add("validate", validate); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RegenerateAccessKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ValidateByResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workflowName}", System.Uri.EscapeDataString(workflowName)); @@ -2526,9 +2491,9 @@ internal WorkflowsOperations(LogicManagementClient client) // Serialize Request string _requestContent = null; - if(keyType != null) + if(validate != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(keyType, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(validate, 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"); } @@ -2554,14 +2519,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2571,10 +2535,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2602,24 +2562,24 @@ internal WorkflowsOperations(LogicManagementClient client) } /// - /// Validates the workflow. + /// Validates the workflow definition. /// /// /// The resource group name. /// + /// + /// The workflow location. + /// /// /// The workflow name. /// - /// - /// The workflow. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2631,7 +2591,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ValidateByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string workflowName, Workflow validate, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task ValidateByLocationWithHttpMessagesAsync(string resourceGroupName, string location, string workflowName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2641,17 +2601,13 @@ internal WorkflowsOperations(LogicManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (workflowName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "workflowName"); - } - if (validate == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "validate"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (validate != null) + if (workflowName == null) { - validate.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "workflowName"); } if (Client.ApiVersion == null) { @@ -2665,16 +2621,17 @@ internal WorkflowsOperations(LogicManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("location", location); tracingParameters.Add("workflowName", workflowName); - tracingParameters.Add("validate", validate); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ValidateByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ValidateByLocation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{workflowName}", System.Uri.EscapeDataString(workflowName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2719,12 +2676,6 @@ internal WorkflowsOperations(LogicManagementClient client) // Serialize Request string _requestContent = null; - if(validate != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(validate, 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) { @@ -2747,14 +2698,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2764,10 +2714,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2795,19 +2741,16 @@ internal WorkflowsOperations(LogicManagementClient client) } /// - /// Validates the workflow definition. + /// Moves an existing workflow. /// /// /// The resource group name. /// - /// - /// The workflow location. - /// /// /// The workflow name. /// - /// - /// The workflow definition. + /// + /// The workflow to move. /// /// /// Headers that will be added to request. @@ -2815,7 +2758,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2827,7 +2770,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task ValidateByLocationWithHttpMessagesAsync(string resourceGroupName, string location, string workflowName, Workflow workflow, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginMoveWithHttpMessagesAsync(string resourceGroupName, string workflowName, Workflow move, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2837,25 +2780,21 @@ internal WorkflowsOperations(LogicManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } if (workflowName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "workflowName"); } - if (Client.ApiVersion == null) + if (move == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "move"); } - if (workflow == null) + if (move != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "workflow"); + move.Validate(); } - if (workflow != null) + if (Client.ApiVersion == null) { - workflow.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -2865,18 +2804,16 @@ internal WorkflowsOperations(LogicManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("location", location); tracingParameters.Add("workflowName", workflowName); - tracingParameters.Add("workflow", workflow); + tracingParameters.Add("move", move); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ValidateByLocation", 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{workflowName}", System.Uri.EscapeDataString(workflowName)); List _queryParameters = new List(); if (Client.ApiVersion != null) @@ -2921,9 +2858,9 @@ internal WorkflowsOperations(LogicManagementClient client) // Serialize Request string _requestContent = null; - if(workflow != null) + if(move != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workflow, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(move, 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"); } @@ -2947,16 +2884,15 @@ internal WorkflowsOperations(LogicManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2966,10 +2902,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -3008,7 +2940,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3104,14 +3036,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3121,10 +3052,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -3181,7 +3108,7 @@ internal WorkflowsOperations(LogicManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -3277,14 +3204,13 @@ internal WorkflowsOperations(LogicManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -3294,10 +3220,6 @@ internal WorkflowsOperations(LogicManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowsOperationsExtensions.cs b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowsOperationsExtensions.cs index 44ee7a70bcbd..8c67669dd1d8 100644 --- a/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowsOperationsExtensions.cs +++ b/sdk/logic/Microsoft.Azure.Management.Logic/src/Generated/WorkflowsOperationsExtensions.cs @@ -615,12 +615,9 @@ public static void ValidateByResourceGroup(this IWorkflowsOperations operations, /// /// The workflow name. /// - /// - /// The workflow definition. - /// - public static void ValidateByLocation(this IWorkflowsOperations operations, string resourceGroupName, string location, string workflowName, Workflow workflow) + public static void ValidateByLocation(this IWorkflowsOperations operations, string resourceGroupName, string location, string workflowName) { - operations.ValidateByLocationAsync(resourceGroupName, location, workflowName, workflow).GetAwaiter().GetResult(); + operations.ValidateByLocationAsync(resourceGroupName, location, workflowName).GetAwaiter().GetResult(); } /// @@ -638,15 +635,55 @@ public static void ValidateByLocation(this IWorkflowsOperations operations, stri /// /// The workflow name. /// - /// - /// The workflow definition. + /// + /// The cancellation token. + /// + public static async Task ValidateByLocationAsync(this IWorkflowsOperations operations, string resourceGroupName, string location, string workflowName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ValidateByLocationWithHttpMessagesAsync(resourceGroupName, location, workflowName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Moves an existing workflow. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The workflow name. + /// + /// + /// The workflow to move. + /// + public static void BeginMove(this IWorkflowsOperations operations, string resourceGroupName, string workflowName, Workflow move) + { + operations.BeginMoveAsync(resourceGroupName, workflowName, move).GetAwaiter().GetResult(); + } + + /// + /// Moves an existing workflow. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The workflow name. + /// + /// + /// The workflow to move. /// /// /// The cancellation token. /// - public static async Task ValidateByLocationAsync(this IWorkflowsOperations operations, string resourceGroupName, string location, string workflowName, Workflow workflow, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginMoveAsync(this IWorkflowsOperations operations, string resourceGroupName, string workflowName, Workflow move, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.ValidateByLocationWithHttpMessagesAsync(resourceGroupName, location, workflowName, workflow, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginMoveWithHttpMessagesAsync(resourceGroupName, workflowName, move, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// From 04c2939a77e931a3b43eda3a73777593afa2a370 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2019 05:26:41 +0000 Subject: [PATCH 15/23] [AutoPR Microsoft.Azure.Management.DataMigration] Add aad domain name for windows login migration support (#225) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * [AutoPR Microsoft.Azure.Management.FrontDoor] Remove unsupported REST APIs from frontdoor (#218) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from 5c5a9743d699fe0a4ba6d07b69d696f490ae50a0 Delete unused example json files * [AutoPR Microsoft.Azure.Management.Logic] [LogicApps] New Api version (#140) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * Generated from 56286b280dda0ebf76f171c8e4f7288e5ea5141b Fixed Resubmit trigger histories * Generated from 91579252e6aa0e9aa0b00749c82755240e5f5282 Add aad domain name for windows login migration support --- .../Models/MigrateSqlServerSqlMITaskInput.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/MigrateSqlServerSqlMITaskInput.cs b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/MigrateSqlServerSqlMITaskInput.cs index ba582ff6dced..f0e9fd6f2780 100644 --- a/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/MigrateSqlServerSqlMITaskInput.cs +++ b/sdk/datamigration/Microsoft.Azure.Management.DataMigration/src/Generated/Models/MigrateSqlServerSqlMITaskInput.cs @@ -50,7 +50,11 @@ public MigrateSqlServerSqlMITaskInput() /// existing backup or create new backup. If using existing backups, /// backup file paths are required to be provided in selectedDatabases. /// Possible values include: 'CreateBackup', 'ExistingBackup' - public MigrateSqlServerSqlMITaskInput(SqlConnectionInfo sourceConnectionInfo, SqlConnectionInfo targetConnectionInfo, IList selectedDatabases, BlobShare backupBlobShare, IList selectedLogins = default(IList), IList selectedAgentJobs = default(IList), FileShare backupFileShare = default(FileShare), string backupMode = default(string)) + /// Azure Active Directory domain name in + /// the format of 'contoso.com' for federated Azure AD or + /// 'contoso.onmicrosoft.com' for managed domain, required if and only + /// if Windows logins are selected + public MigrateSqlServerSqlMITaskInput(SqlConnectionInfo sourceConnectionInfo, SqlConnectionInfo targetConnectionInfo, IList selectedDatabases, BlobShare backupBlobShare, IList selectedLogins = default(IList), IList selectedAgentJobs = default(IList), FileShare backupFileShare = default(FileShare), string backupMode = default(string), string aadDomainName = default(string)) : base(sourceConnectionInfo, targetConnectionInfo) { SelectedDatabases = selectedDatabases; @@ -59,6 +63,7 @@ public MigrateSqlServerSqlMITaskInput() BackupFileShare = backupFileShare; BackupBlobShare = backupBlobShare; BackupMode = backupMode; + AadDomainName = aadDomainName; CustomInit(); } @@ -108,6 +113,15 @@ public MigrateSqlServerSqlMITaskInput() [JsonProperty(PropertyName = "backupMode")] public string BackupMode { get; set; } + /// + /// Gets or sets azure Active Directory domain name in the format of + /// 'contoso.com' for federated Azure AD or 'contoso.onmicrosoft.com' + /// for managed domain, required if and only if Windows logins are + /// selected + /// + [JsonProperty(PropertyName = "aadDomainName")] + public string AadDomainName { get; set; } + /// /// Validate the object. /// From 1ad92791fb5c21bd6de510e2c51c8fea7f85903c Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 01:34:22 +0000 Subject: [PATCH 16/23] [AutoPR Microsoft.Azure.Management.Media] Initial 2019-09-01-preview for LVA (#216) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * Generated from ae35d5e5415ae13c6fb749ff6109a213b4e284c4 Remove required property for credentials and update examples. --- .../src/Generated/Models/AbsoluteClipTime.cs | 4 ++-- .../src/Generated/Models/FilterTrackPropertyCondition.cs | 4 ++-- .../src/Generated/Models/PresentationTimeRange.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AbsoluteClipTime.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AbsoluteClipTime.cs index a14417720240..b97e1148df9f 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AbsoluteClipTime.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/AbsoluteClipTime.cs @@ -33,7 +33,7 @@ public AbsoluteClipTime() /// Initializes a new instance of the AbsoluteClipTime class. /// /// The time position on the timeline of the input - /// media. It is usually speicified as an ISO8601 period. e.g PT30S for + /// media. It is usually specified as an ISO8601 period. e.g PT30S for /// 30 seconds. public AbsoluteClipTime(System.TimeSpan time) { @@ -48,7 +48,7 @@ public AbsoluteClipTime(System.TimeSpan time) /// /// Gets or sets the time position on the timeline of the input media. - /// It is usually speicified as an ISO8601 period. e.g PT30S for 30 + /// It is usually specified as an ISO8601 period. e.g PT30S for 30 /// seconds. /// [JsonProperty(PropertyName = "time")] diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/FilterTrackPropertyCondition.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/FilterTrackPropertyCondition.cs index f4718a2dd77a..1c614037d9bc 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/FilterTrackPropertyCondition.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/FilterTrackPropertyCondition.cs @@ -35,7 +35,7 @@ public FilterTrackPropertyCondition() /// The track property type. Possible values /// include: 'Unknown', 'Type', 'Name', 'Language', 'FourCC', /// 'Bitrate' - /// The track proprty value. + /// The track property value. /// The track property condition operation. /// Possible values include: 'Equal', 'NotEqual' public FilterTrackPropertyCondition(FilterTrackPropertyType property, string value, FilterTrackPropertyCompareOperation operation) @@ -59,7 +59,7 @@ public FilterTrackPropertyCondition(FilterTrackPropertyType property, string val public FilterTrackPropertyType Property { get; set; } /// - /// Gets or sets the track proprty value. + /// Gets or sets the track property value. /// [JsonProperty(PropertyName = "value")] public string Value { get; set; } diff --git a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PresentationTimeRange.cs b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PresentationTimeRange.cs index 2cc14b617b77..f452cf17087e 100644 --- a/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PresentationTimeRange.cs +++ b/sdk/mediaservices/Microsoft.Azure.Management.Media/src/Generated/Models/PresentationTimeRange.cs @@ -38,7 +38,7 @@ public PresentationTimeRange() /// The relative to end right /// edge. /// The time scale of time stamps. - /// The indicator of forcing exsiting + /// The indicator of forcing existing /// of end time stamp. public PresentationTimeRange(long? startTimestamp = default(long?), long? endTimestamp = default(long?), long? presentationWindowDuration = default(long?), long? liveBackoffDuration = default(long?), long? timescale = default(long?), bool? forceEndTimestamp = default(bool?)) { @@ -87,7 +87,7 @@ public PresentationTimeRange() public long? Timescale { get; set; } /// - /// Gets or sets the indicator of forcing exsiting of end time stamp. + /// Gets or sets the indicator of forcing existing of end time stamp. /// [JsonProperty(PropertyName = "forceEndTimestamp")] public bool? ForceEndTimestamp { get; set; } From 5f8294ea1177d1f224b481ddc414d205a2a5cb28 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 09:24:28 +0000 Subject: [PATCH 17/23] [AutoPR Microsoft.Azure.Management.SecurityCenter] Add ProtectionMode to Microsoft.Security applicationWhitelistings (#214) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * [AutoPR Microsoft.Azure.Management.FrontDoor] Remove unsupported REST APIs from frontdoor (#218) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from 5c5a9743d699fe0a4ba6d07b69d696f490ae50a0 Delete unused example json files * [AutoPR Microsoft.Azure.Management.Logic] [LogicApps] New Api version (#140) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * Generated from 56286b280dda0ebf76f171c8e4f7288e5ea5141b Fixed Resubmit trigger histories * Generated from 16c7d5f2a872e3b7cc01c7dd8af608a586776fe9 lowercase the collection types --- .../Generated/Models/AppWhitelistingGroup.cs | 12 ++- .../Models/AppWhitelistingPutGroupData.cs | 23 +++++- .../src/Generated/Models/ProtectionMode.cs | 80 +++++++++++++++++++ .../src/Generated/SdkInfo_SecurityCenter.cs | 11 --- 4 files changed, 108 insertions(+), 18 deletions(-) create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProtectionMode.cs diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AppWhitelistingGroup.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AppWhitelistingGroup.cs index 8a42c7fa59bf..8bd1d03f8661 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AppWhitelistingGroup.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AppWhitelistingGroup.cs @@ -37,7 +37,7 @@ public AppWhitelistingGroup() /// Location where the resource is /// stored /// Possible values include: 'Audit', - /// 'Enforce' + /// 'Enforce', 'None' /// Possible values include: /// 'Configured', 'NotConfigured', 'InProgress', 'Failed', /// 'NoStatus' @@ -46,13 +46,14 @@ public AppWhitelistingGroup() /// Possible values include: /// 'Azure_AppLocker', 'Azure_AuditD', 'NonAzure_AppLocker', /// 'NonAzure_AuditD', 'None' - public AppWhitelistingGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), string enforcementMode = default(string), string configurationStatus = default(string), string recommendationStatus = default(string), IList issues = default(IList), string sourceSystem = default(string), IList vmRecommendations = default(IList), IList pathRecommendations = default(IList)) + public AppWhitelistingGroup(string id = default(string), string name = default(string), string type = default(string), string location = default(string), string enforcementMode = default(string), ProtectionMode protectionMode = default(ProtectionMode), string configurationStatus = default(string), string recommendationStatus = default(string), IList issues = default(IList), string sourceSystem = default(string), IList vmRecommendations = default(IList), IList pathRecommendations = default(IList)) { Id = id; Name = name; Type = type; Location = location; EnforcementMode = enforcementMode; + ProtectionMode = protectionMode; ConfigurationStatus = configurationStatus; RecommendationStatus = recommendationStatus; Issues = issues; @@ -92,11 +93,16 @@ public AppWhitelistingGroup() public string Location { get; private set; } /// - /// Gets or sets possible values include: 'Audit', 'Enforce' + /// Gets or sets possible values include: 'Audit', 'Enforce', 'None' /// [JsonProperty(PropertyName = "properties.enforcementMode")] public string EnforcementMode { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.protectionMode")] + public ProtectionMode ProtectionMode { get; set; } + /// /// Gets or sets possible values include: 'Configured', /// 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AppWhitelistingPutGroupData.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AppWhitelistingPutGroupData.cs index 996ed88c504f..bd1f357bfb40 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AppWhitelistingPutGroupData.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AppWhitelistingPutGroupData.cs @@ -33,11 +33,16 @@ public AppWhitelistingPutGroupData() /// Initializes a new instance of the AppWhitelistingPutGroupData /// class. /// - /// Possible values include: 'Audit', - /// 'Enforce' - public AppWhitelistingPutGroupData(string enforcementMode = default(string), IList vmRecommendations = default(IList), IList pathRecommendations = default(IList)) + /// The enforcement mode of the group. + /// Can also be defined per collection type by using ProtectionMode. + /// Possible values include: 'Audit', 'Enforce', 'None' + /// The protection mode of the group per + /// collection type. Can also be defined for all collection types by + /// using EnforcementMode + public AppWhitelistingPutGroupData(string enforcementMode = default(string), ProtectionMode protectionMode = default(ProtectionMode), IList vmRecommendations = default(IList), IList pathRecommendations = default(IList)) { EnforcementMode = enforcementMode; + ProtectionMode = protectionMode; VmRecommendations = vmRecommendations; PathRecommendations = pathRecommendations; CustomInit(); @@ -49,11 +54,21 @@ public AppWhitelistingPutGroupData() partial void CustomInit(); /// - /// Gets or sets possible values include: 'Audit', 'Enforce' + /// Gets or sets the enforcement mode of the group. Can also be defined + /// per collection type by using ProtectionMode. Possible values + /// include: 'Audit', 'Enforce', 'None' /// [JsonProperty(PropertyName = "enforcementMode")] public string EnforcementMode { get; set; } + /// + /// Gets or sets the protection mode of the group per collection type. + /// Can also be defined for all collection types by using + /// EnforcementMode + /// + [JsonProperty(PropertyName = "protectionMode")] + public ProtectionMode ProtectionMode { get; set; } + /// /// [JsonProperty(PropertyName = "vmRecommendations")] diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProtectionMode.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProtectionMode.cs new file mode 100644 index 000000000000..d86a0a7c7d66 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProtectionMode.cs @@ -0,0 +1,80 @@ +// +// 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.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The protection mode of the collection/file types. Exe/Msi/Script are + /// used for Windows, Executable is used for Linux. + /// + public partial class ProtectionMode + { + /// + /// Initializes a new instance of the ProtectionMode class. + /// + public ProtectionMode() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionMode class. + /// + /// Possible values include: 'Audit', 'Enforce', + /// 'None' + /// Possible values include: 'Audit', 'Enforce', + /// 'None' + /// Possible values include: 'Audit', 'Enforce', + /// 'None' + /// Possible values include: 'Audit', + /// 'Enforce', 'None' + public ProtectionMode(string exe = default(string), string msi = default(string), string script = default(string), string executable = default(string)) + { + Exe = exe; + Msi = msi; + Script = script; + Executable = executable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'Audit', 'Enforce', 'None' + /// + [JsonProperty(PropertyName = "Exe")] + public string Exe { get; set; } + + /// + /// Gets or sets possible values include: 'Audit', 'Enforce', 'None' + /// + [JsonProperty(PropertyName = "Msi")] + public string Msi { get; set; } + + /// + /// Gets or sets possible values include: 'Audit', 'Enforce', 'None' + /// + [JsonProperty(PropertyName = "Script")] + public string Script { get; set; } + + /// + /// Gets or sets possible values include: 'Audit', 'Enforce', 'None' + /// + [JsonProperty(PropertyName = "Executable")] + public string Executable { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs index efebd6c72ac8..97df5dadd441 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs @@ -50,16 +50,5 @@ public static IEnumerable> ApiInfo_SecurityCenter }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/security/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\git\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "626308502df9fd4b4a7fafed44eceba9ee7ef1bf"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - From 7c929607e01f873ebed4b8c3e9495dbc6966d45c Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 09:48:25 +0000 Subject: [PATCH 18/23] [AutoPR Microsoft.Azure.Management.DataFactory] [Don't Review for now][Data Factory] data flow + debug session API swagger (#168) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 1b8779e51e707035d038a5e24534b9d428dc51bd fix more for lint --- .../Generated/DataFactoryManagementClient.cs | 14 + .../DataFlowDebugSessionOperations.cs | 1430 +++++++++++++++++ ...ataFlowDebugSessionOperationsExtensions.cs | 280 ++++ .../src/Generated/DataFlowsOperations.cs | 1227 ++++++++++++++ .../DataFlowsOperationsExtensions.cs | 258 +++ .../Generated/IDataFactoryManagementClient.cs | 10 + .../IDataFlowDebugSessionOperations.cs | 183 +++ .../src/Generated/IDataFlowsOperations.cs | 168 ++ .../AddDataFlowToDebugSessionResponse.cs | 54 + .../CreateDataFlowDebugSessionRequest.cs | 99 ++ .../CreateDataFlowDebugSessionResponse.cs | 61 + .../src/Generated/Models/DataFlow.cs | 74 + .../Models/DataFlowDebugCommandPayload.cs | 95 ++ .../Models/DataFlowDebugCommandRequest.cs | 86 + .../Models/DataFlowDebugCommandResponse.cs | 66 + .../Models/DataFlowDebugCommandType.cs | 23 + .../Generated/Models/DataFlowDebugPackage.cs | 136 ++ .../DataFlowDebugPackageDebugSettings.cs | 72 + .../DataFlowDebugSessionCreateHeaders.cs | 54 + ...taFlowDebugSessionExecuteCommandHeaders.cs | 54 + .../Models/DataFlowDebugSessionInfo.cs | 127 ++ .../src/Generated/Models/DataFlowFolder.cs | 53 + .../src/Generated/Models/DataFlowReference.cs | 99 ++ .../src/Generated/Models/DataFlowResource.cs | 70 + .../src/Generated/Models/DataFlowSink.cs | 78 + .../src/Generated/Models/DataFlowSource.cs | 78 + .../Generated/Models/DataFlowSourceSetting.cs | 66 + .../Generated/Models/DataFlowStagingInfo.cs | 73 + .../DeleteDataFlowDebugSessionRequest.cs | 53 + .../Models/ExecuteDataFlowActivity.cs | 111 ++ .../GetDataFactoryOperationStatusResponse.cs | 59 + .../src/Generated/Models/MappingDataFlow.cs | 103 ++ ...kageLocation.cs => SSISPackageLocation.cs} | 0 .../src/Generated/Models/Transformation.cs | 85 + .../SdkInfo_DataFactoryManagementClient.cs | 13 +- 35 files changed, 5501 insertions(+), 11 deletions(-) create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowDebugSessionOperations.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowDebugSessionOperationsExtensions.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowsOperations.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowsOperationsExtensions.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFlowDebugSessionOperations.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFlowsOperations.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AddDataFlowToDebugSessionResponse.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CreateDataFlowDebugSessionRequest.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CreateDataFlowDebugSessionResponse.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlow.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandPayload.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandRequest.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandResponse.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandType.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugPackage.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugPackageDebugSettings.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionCreateHeaders.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionExecuteCommandHeaders.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionInfo.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowFolder.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowReference.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowResource.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSink.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSource.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSourceSetting.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowStagingInfo.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DeleteDataFlowDebugSessionRequest.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ExecuteDataFlowActivity.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/GetDataFactoryOperationStatusResponse.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/MappingDataFlow.cs rename sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/{SsisPackageLocation.cs => SSISPackageLocation.cs} (100%) create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/Transformation.cs diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs index eb02c8389215..0dfc24d48fa0 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFactoryManagementClient.cs @@ -145,6 +145,16 @@ public partial class DataFactoryManagementClient : ServiceClient public virtual IRerunTriggersOperations RerunTriggers { get; private set; } + /// + /// Gets the IDataFlowsOperations. + /// + public virtual IDataFlowsOperations DataFlows { get; private set; } + + /// + /// Gets the IDataFlowDebugSessionOperations. + /// + public virtual IDataFlowDebugSessionOperations DataFlowDebugSession { get; private set; } + /// /// Initializes a new instance of the DataFactoryManagementClient class. /// @@ -400,6 +410,8 @@ private void Initialize() Triggers = new TriggersOperations(this); TriggerRuns = new TriggerRunsOperations(this); RerunTriggers = new RerunTriggersOperations(this); + DataFlows = new DataFlowsOperations(this); + DataFlowDebugSession = new DataFlowDebugSessionOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2018-06-01"; AcceptLanguage = "en-US"; @@ -447,6 +459,8 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("authenticationType")); diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowDebugSessionOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowDebugSessionOperations.cs new file mode 100644 index 000000000000..76f92c2f233b --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowDebugSessionOperations.cs @@ -0,0 +1,1430 @@ +// +// 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.DataFactory +{ + 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; + + /// + /// DataFlowDebugSessionOperations operations. + /// + internal partial class DataFlowDebugSessionOperations : IServiceOperations, IDataFlowDebugSessionOperations + { + /// + /// Initializes a new instance of the DataFlowDebugSessionOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataFlowDebugSessionOperations(DataFactoryManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataFactoryManagementClient + /// + public DataFactoryManagementClient Client { get; private set; } + + /// + /// Creates a data flow debug session. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string factoryName, CreateDataFlowDebugSessionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/createDataFlowDebugSession").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + 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(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Query all active data flow debug sessions. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// 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>> QueryByFactoryWithHttpMessagesAsync(string resourceGroupName, string factoryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "QueryByFactory", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/queryDataFlowDebugSessions").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + 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) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Add a data flow into debug session. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition with debug content. + /// + /// + /// 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> AddDataFlowWithHttpMessagesAsync(string resourceGroupName, string factoryName, DataFlowDebugPackage request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "AddDataFlow", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/addDataFlowToDebugSession").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + 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(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Deletes a data flow debug session. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition for deletion + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string factoryName, DeleteDataFlowDebugSessionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/deleteDataFlowDebugSession").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + 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(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Execute a data flow debug command. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug command definition. + /// + /// + /// 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> ExecuteCommandWithHttpMessagesAsync(string resourceGroupName, string factoryName, DataFlowDebugCommandRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (request == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "request"); + } + if (request != null) + { + request.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("request", request); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ExecuteCommand", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/executeDataFlowDebugCommand").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + 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(request != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(request, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Query all active data flow debug sessions. + /// + /// + /// 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>> QueryByFactoryNextWithHttpMessagesAsync(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, "QueryByFactoryNext", 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("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) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowDebugSessionOperationsExtensions.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowDebugSessionOperationsExtensions.cs new file mode 100644 index 000000000000..7c4c66a33f93 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowDebugSessionOperationsExtensions.cs @@ -0,0 +1,280 @@ +// +// 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.DataFactory +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataFlowDebugSessionOperations. + /// + public static partial class DataFlowDebugSessionOperationsExtensions + { + /// + /// Creates a data flow debug session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition + /// + public static CreateDataFlowDebugSessionResponse Create(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, CreateDataFlowDebugSessionRequest request) + { + return operations.CreateAsync(resourceGroupName, factoryName, request).GetAwaiter().GetResult(); + } + + /// + /// Creates a data flow debug session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, CreateDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, factoryName, request, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Query all active data flow debug sessions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + public static IPage QueryByFactory(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName) + { + return operations.QueryByFactoryAsync(resourceGroupName, factoryName).GetAwaiter().GetResult(); + } + + /// + /// Query all active data flow debug sessions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The cancellation token. + /// + public static async Task> QueryByFactoryAsync(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.QueryByFactoryWithHttpMessagesAsync(resourceGroupName, factoryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Add a data flow into debug session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition with debug content. + /// + public static AddDataFlowToDebugSessionResponse AddDataFlow(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, DataFlowDebugPackage request) + { + return operations.AddDataFlowAsync(resourceGroupName, factoryName, request).GetAwaiter().GetResult(); + } + + /// + /// Add a data flow into debug session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition with debug content. + /// + /// + /// The cancellation token. + /// + public static async Task AddDataFlowAsync(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, DataFlowDebugPackage request, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.AddDataFlowWithHttpMessagesAsync(resourceGroupName, factoryName, request, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a data flow debug session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition for deletion + /// + public static void Delete(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, DeleteDataFlowDebugSessionRequest request) + { + operations.DeleteAsync(resourceGroupName, factoryName, request).GetAwaiter().GetResult(); + } + + /// + /// Deletes a data flow debug session. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition for deletion + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, DeleteDataFlowDebugSessionRequest request, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, factoryName, request, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Execute a data flow debug command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug command definition. + /// + public static DataFlowDebugCommandResponse ExecuteCommand(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, DataFlowDebugCommandRequest request) + { + return operations.ExecuteCommandAsync(resourceGroupName, factoryName, request).GetAwaiter().GetResult(); + } + + /// + /// Execute a data flow debug command. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug command definition. + /// + /// + /// The cancellation token. + /// + public static async Task ExecuteCommandAsync(this IDataFlowDebugSessionOperations operations, string resourceGroupName, string factoryName, DataFlowDebugCommandRequest request, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ExecuteCommandWithHttpMessagesAsync(resourceGroupName, factoryName, request, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Query all active data flow debug sessions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage QueryByFactoryNext(this IDataFlowDebugSessionOperations operations, string nextPageLink) + { + return operations.QueryByFactoryNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Query all active data flow debug sessions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> QueryByFactoryNextAsync(this IDataFlowDebugSessionOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.QueryByFactoryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowsOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowsOperations.cs new file mode 100644 index 000000000000..6e4319df375c --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowsOperations.cs @@ -0,0 +1,1227 @@ +// +// 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.DataFactory +{ + 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; + + /// + /// DataFlowsOperations operations. + /// + internal partial class DataFlowsOperations : IServiceOperations, IDataFlowsOperations + { + /// + /// Initializes a new instance of the DataFlowsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataFlowsOperations(DataFactoryManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataFactoryManagementClient + /// + public DataFactoryManagementClient Client { get; private set; } + + /// + /// Creates or updates a data flow. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// Data flow resource definition. + /// + /// + /// ETag of the data flow entity. Should only be specified for update, for + /// which it should match existing entity or can be * for unconditional update. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string factoryName, string dataFlowName, DataFlowResource dataFlow, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (dataFlowName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataFlowName"); + } + if (dataFlowName != null) + { + if (dataFlowName.Length > 260) + { + throw new ValidationException(ValidationRules.MaxLength, "dataFlowName", 260); + } + if (dataFlowName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "dataFlowName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dataFlowName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dataFlowName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (dataFlow == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataFlow"); + } + if (dataFlow != null) + { + dataFlow.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("dataFlowName", dataFlowName); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("dataFlow", dataFlow); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/dataflows/{dataFlowName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + _url = _url.Replace("{dataFlowName}", System.Uri.EscapeDataString(dataFlowName)); + 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 (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + 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(dataFlow != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dataFlow, 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 data flow. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// ETag of the data flow entity. Should only be specified for get. If the ETag + /// matches the existing entity tag, or if * was provided, then no content will + /// be returned. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string factoryName, string dataFlowName, string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (dataFlowName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataFlowName"); + } + if (dataFlowName != null) + { + if (dataFlowName.Length > 260) + { + throw new ValidationException(ValidationRules.MaxLength, "dataFlowName", 260); + } + if (dataFlowName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "dataFlowName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dataFlowName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dataFlowName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("dataFlowName", dataFlowName); + tracingParameters.Add("ifNoneMatch", ifNoneMatch); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/dataflows/{dataFlowName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + _url = _url.Replace("{dataFlowName}", System.Uri.EscapeDataString(dataFlowName)); + 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 (ifNoneMatch != null) + { + if (_httpRequest.Headers.Contains("If-None-Match")) + { + _httpRequest.Headers.Remove("If-None-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-None-Match", ifNoneMatch); + } + 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 != 304) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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; + } + + /// + /// Deletes a data flow. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string factoryName, string dataFlowName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (dataFlowName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataFlowName"); + } + if (dataFlowName != null) + { + if (dataFlowName.Length > 260) + { + throw new ValidationException(ValidationRules.MaxLength, "dataFlowName", 260); + } + if (dataFlowName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "dataFlowName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dataFlowName, "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$")) + { + throw new ValidationException(ValidationRules.Pattern, "dataFlowName", "^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("dataFlowName", dataFlowName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/dataflows/{dataFlowName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + _url = _url.Replace("{dataFlowName}", System.Uri.EscapeDataString(dataFlowName)); + 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("DELETE"); + _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 != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists data flows. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// 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>> ListByFactoryWithHttpMessagesAsync(string resourceGroupName, string factoryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (factoryName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "factoryName"); + } + if (factoryName != null) + { + if (factoryName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "factoryName", 63); + } + if (factoryName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "factoryName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(factoryName, "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$")) + { + throw new ValidationException(ValidationRules.Pattern, "factoryName", "^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("factoryName", factoryName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByFactory", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/dataflows").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{factoryName}", System.Uri.EscapeDataString(factoryName)); + 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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 data flows. + /// + /// + /// 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>> ListByFactoryNextWithHttpMessagesAsync(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, "ListByFactoryNext", 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowsOperationsExtensions.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowsOperationsExtensions.cs new file mode 100644 index 000000000000..b9128218a2f8 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/DataFlowsOperationsExtensions.cs @@ -0,0 +1,258 @@ +// +// 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.DataFactory +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataFlowsOperations. + /// + public static partial class DataFlowsOperationsExtensions + { + /// + /// Creates or updates a data flow. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// Data flow resource definition. + /// + /// + /// ETag of the data flow entity. Should only be specified for update, for + /// which it should match existing entity or can be * for unconditional update. + /// + public static DataFlowResource CreateOrUpdate(this IDataFlowsOperations operations, string resourceGroupName, string factoryName, string dataFlowName, DataFlowResource dataFlow, string ifMatch = default(string)) + { + return operations.CreateOrUpdateAsync(resourceGroupName, factoryName, dataFlowName, dataFlow, ifMatch).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a data flow. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// Data flow resource definition. + /// + /// + /// ETag of the data flow entity. Should only be specified for update, for + /// which it should match existing entity or can be * for unconditional update. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDataFlowsOperations operations, string resourceGroupName, string factoryName, string dataFlowName, DataFlowResource dataFlow, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, factoryName, dataFlowName, dataFlow, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a data flow. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// ETag of the data flow entity. Should only be specified for get. If the ETag + /// matches the existing entity tag, or if * was provided, then no content will + /// be returned. + /// + public static DataFlowResource Get(this IDataFlowsOperations operations, string resourceGroupName, string factoryName, string dataFlowName, string ifNoneMatch = default(string)) + { + return operations.GetAsync(resourceGroupName, factoryName, dataFlowName, ifNoneMatch).GetAwaiter().GetResult(); + } + + /// + /// Gets a data flow. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// ETag of the data flow entity. Should only be specified for get. If the ETag + /// matches the existing entity tag, or if * was provided, then no content will + /// be returned. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDataFlowsOperations operations, string resourceGroupName, string factoryName, string dataFlowName, string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, factoryName, dataFlowName, ifNoneMatch, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a data flow. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + public static void Delete(this IDataFlowsOperations operations, string resourceGroupName, string factoryName, string dataFlowName) + { + operations.DeleteAsync(resourceGroupName, factoryName, dataFlowName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a data flow. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDataFlowsOperations operations, string resourceGroupName, string factoryName, string dataFlowName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, factoryName, dataFlowName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists data flows. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + public static IPage ListByFactory(this IDataFlowsOperations operations, string resourceGroupName, string factoryName) + { + return operations.ListByFactoryAsync(resourceGroupName, factoryName).GetAwaiter().GetResult(); + } + + /// + /// Lists data flows. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByFactoryAsync(this IDataFlowsOperations operations, string resourceGroupName, string factoryName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByFactoryWithHttpMessagesAsync(resourceGroupName, factoryName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists data flows. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByFactoryNext(this IDataFlowsOperations operations, string nextPageLink) + { + return operations.ListByFactoryNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists data flows. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByFactoryNextAsync(this IDataFlowsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByFactoryNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFactoryManagementClient.cs index e0b46a5bd0ad..1648e0af85c1 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFactoryManagementClient.cs @@ -140,5 +140,15 @@ public partial interface IDataFactoryManagementClient : System.IDisposable /// IRerunTriggersOperations RerunTriggers { get; } + /// + /// Gets the IDataFlowsOperations. + /// + IDataFlowsOperations DataFlows { get; } + + /// + /// Gets the IDataFlowDebugSessionOperations. + /// + IDataFlowDebugSessionOperations DataFlowDebugSession { get; } + } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFlowDebugSessionOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFlowDebugSessionOperations.cs new file mode 100644 index 000000000000..b81a78a97a6b --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFlowDebugSessionOperations.cs @@ -0,0 +1,183 @@ +// +// 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.DataFactory +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataFlowDebugSessionOperations operations. + /// + public partial interface IDataFlowDebugSessionOperations + { + /// + /// Creates a data flow debug session. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string factoryName, CreateDataFlowDebugSessionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Query all active data flow debug sessions. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// 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>> QueryByFactoryWithHttpMessagesAsync(string resourceGroupName, string factoryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Add a data flow into debug session. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition with debug content. + /// + /// + /// 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> AddDataFlowWithHttpMessagesAsync(string resourceGroupName, string factoryName, DataFlowDebugPackage request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a data flow debug session. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug session definition for deletion + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string factoryName, DeleteDataFlowDebugSessionRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Execute a data flow debug command. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// Data flow debug command definition. + /// + /// + /// 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> ExecuteCommandWithHttpMessagesAsync(string resourceGroupName, string factoryName, DataFlowDebugCommandRequest request, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Query all active data flow debug sessions. + /// + /// + /// 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>> QueryByFactoryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFlowsOperations.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFlowsOperations.cs new file mode 100644 index 000000000000..9d1e9bf3f49c --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/IDataFlowsOperations.cs @@ -0,0 +1,168 @@ +// +// 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.DataFactory +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataFlowsOperations operations. + /// + public partial interface IDataFlowsOperations + { + /// + /// Creates or updates a data flow. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// Data flow resource definition. + /// + /// + /// ETag of the data flow entity. Should only be specified for update, + /// for which it should match existing entity or can be * for + /// unconditional update. + /// + /// + /// 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 resourceGroupName, string factoryName, string dataFlowName, DataFlowResource dataFlow, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a data flow. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// ETag of the data flow entity. Should only be specified for get. If + /// the ETag matches the existing entity tag, or if * was provided, + /// then no content will be returned. + /// + /// + /// 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 resourceGroupName, string factoryName, string dataFlowName, string ifNoneMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a data flow. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// The data flow name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string factoryName, string dataFlowName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists data flows. + /// + /// + /// The resource group name. + /// + /// + /// The factory name. + /// + /// + /// 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>> ListByFactoryWithHttpMessagesAsync(string resourceGroupName, string factoryName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists data flows. + /// + /// + /// 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>> ListByFactoryNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AddDataFlowToDebugSessionResponse.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AddDataFlowToDebugSessionResponse.cs new file mode 100644 index 000000000000..efbe4ecfdf4d --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/AddDataFlowToDebugSessionResponse.cs @@ -0,0 +1,54 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response body structure for starting data flow debug session. + /// + public partial class AddDataFlowToDebugSessionResponse + { + /// + /// Initializes a new instance of the AddDataFlowToDebugSessionResponse + /// class. + /// + public AddDataFlowToDebugSessionResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddDataFlowToDebugSessionResponse + /// class. + /// + /// The ID of data flow debug job + /// version. + public AddDataFlowToDebugSessionResponse(string jobVersion = default(string)) + { + JobVersion = jobVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of data flow debug job version. + /// + [JsonProperty(PropertyName = "jobVersion")] + public string JobVersion { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CreateDataFlowDebugSessionRequest.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CreateDataFlowDebugSessionRequest.cs new file mode 100644 index 000000000000..8becead1903b --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CreateDataFlowDebugSessionRequest.cs @@ -0,0 +1,99 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body structure for creating data flow debug session. + /// + public partial class CreateDataFlowDebugSessionRequest + { + /// + /// Initializes a new instance of the CreateDataFlowDebugSessionRequest + /// class. + /// + public CreateDataFlowDebugSessionRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CreateDataFlowDebugSessionRequest + /// class. + /// + /// Compute type of the cluster. The value + /// will be overwritten by the same setting in integration runtime if + /// provided. + /// Core count of the cluster. The value will + /// be overwritten by the same setting in integration runtime if + /// provided. + /// Time to live setting of the cluster in + /// minutes. + /// Set to use integration runtime + /// setting for data flow debug session. + public CreateDataFlowDebugSessionRequest(string computeType = default(string), int? coreCount = default(int?), int? timeToLive = default(int?), IntegrationRuntimeResource integrationRuntime = default(IntegrationRuntimeResource)) + { + ComputeType = computeType; + CoreCount = coreCount; + TimeToLive = timeToLive; + IntegrationRuntime = integrationRuntime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets compute type of the cluster. The value will be + /// overwritten by the same setting in integration runtime if provided. + /// + [JsonProperty(PropertyName = "computeType")] + public string ComputeType { get; set; } + + /// + /// Gets or sets core count of the cluster. The value will be + /// overwritten by the same setting in integration runtime if provided. + /// + [JsonProperty(PropertyName = "coreCount")] + public int? CoreCount { get; set; } + + /// + /// Gets or sets time to live setting of the cluster in minutes. + /// + [JsonProperty(PropertyName = "timeToLive")] + public int? TimeToLive { get; set; } + + /// + /// Gets or sets set to use integration runtime setting for data flow + /// debug session. + /// + [JsonProperty(PropertyName = "integrationRuntime")] + public IntegrationRuntimeResource IntegrationRuntime { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IntegrationRuntime != null) + { + IntegrationRuntime.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CreateDataFlowDebugSessionResponse.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CreateDataFlowDebugSessionResponse.cs new file mode 100644 index 000000000000..f2f79da08226 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CreateDataFlowDebugSessionResponse.cs @@ -0,0 +1,61 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response body structure for creating data flow debug session. + /// + public partial class CreateDataFlowDebugSessionResponse + { + /// + /// Initializes a new instance of the + /// CreateDataFlowDebugSessionResponse class. + /// + public CreateDataFlowDebugSessionResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CreateDataFlowDebugSessionResponse class. + /// + /// The state of the debug session. + /// The ID of data flow debug session. + public CreateDataFlowDebugSessionResponse(string status = default(string), string sessionId = default(string)) + { + Status = status; + SessionId = sessionId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the state of the debug session. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the ID of data flow debug session. + /// + [JsonProperty(PropertyName = "sessionId")] + public string SessionId { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlow.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlow.cs new file mode 100644 index 000000000000..f88c4d091d89 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlow.cs @@ -0,0 +1,74 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure Data Factory nested object which contains a flow with data + /// movements and transformations. + /// + public partial class DataFlow + { + /// + /// Initializes a new instance of the DataFlow class. + /// + public DataFlow() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlow class. + /// + /// The description of the data flow. + /// List of tags that can be used for + /// describing the data flow. + /// The folder that this data flow is in. If not + /// specified, Data flow will appear at the root level. + public DataFlow(string description = default(string), IList annotations = default(IList), DataFlowFolder folder = default(DataFlowFolder)) + { + Description = description; + Annotations = annotations; + Folder = folder; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the description of the data flow. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets list of tags that can be used for describing the data + /// flow. + /// + [JsonProperty(PropertyName = "annotations")] + public IList Annotations { get; set; } + + /// + /// Gets or sets the folder that this data flow is in. If not + /// specified, Data flow will appear at the root level. + /// + [JsonProperty(PropertyName = "folder")] + public DataFlowFolder Folder { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandPayload.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandPayload.cs new file mode 100644 index 000000000000..c54876caac7f --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandPayload.cs @@ -0,0 +1,95 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Structure of command payload. + /// + public partial class DataFlowDebugCommandPayload + { + /// + /// Initializes a new instance of the DataFlowDebugCommandPayload + /// class. + /// + public DataFlowDebugCommandPayload() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowDebugCommandPayload + /// class. + /// + /// The stream name which is used for + /// preview. + /// Row limits for preview response. + /// Array of column names. + /// The expression which is used for + /// preview. + public DataFlowDebugCommandPayload(string streamName, int? rowLimits = default(int?), IList columns = default(IList), string expression = default(string)) + { + StreamName = streamName; + RowLimits = rowLimits; + Columns = columns; + Expression = expression; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the stream name which is used for preview. + /// + [JsonProperty(PropertyName = "streamName")] + public string StreamName { get; set; } + + /// + /// Gets or sets row limits for preview response. + /// + [JsonProperty(PropertyName = "rowLimits")] + public int? RowLimits { get; set; } + + /// + /// Gets or sets array of column names. + /// + [JsonProperty(PropertyName = "columns")] + public IList Columns { get; set; } + + /// + /// Gets or sets the expression which is used for preview. + /// + [JsonProperty(PropertyName = "expression")] + public string Expression { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StreamName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StreamName"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandRequest.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandRequest.cs new file mode 100644 index 000000000000..66c559cf2f30 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandRequest.cs @@ -0,0 +1,86 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body structure for data flow debug command. + /// + public partial class DataFlowDebugCommandRequest + { + /// + /// Initializes a new instance of the DataFlowDebugCommandRequest + /// class. + /// + public DataFlowDebugCommandRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowDebugCommandRequest + /// class. + /// + /// The ID of data flow debug session. + /// The command type. Possible values include: + /// 'executePreviewQuery', 'executeStatisticsQuery', + /// 'executeExpressionQuery' + /// The command payload object. + public DataFlowDebugCommandRequest(string sessionId = default(string), string command = default(string), DataFlowDebugCommandPayload commandPayload = default(DataFlowDebugCommandPayload)) + { + SessionId = sessionId; + Command = command; + CommandPayload = commandPayload; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of data flow debug session. + /// + [JsonProperty(PropertyName = "sessionId")] + public string SessionId { get; set; } + + /// + /// Gets or sets the command type. Possible values include: + /// 'executePreviewQuery', 'executeStatisticsQuery', + /// 'executeExpressionQuery' + /// + [JsonProperty(PropertyName = "command")] + public string Command { get; set; } + + /// + /// Gets or sets the command payload object. + /// + [JsonProperty(PropertyName = "commandPayload")] + public DataFlowDebugCommandPayload CommandPayload { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (CommandPayload != null) + { + CommandPayload.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandResponse.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandResponse.cs new file mode 100644 index 000000000000..034a3c28f49b --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandResponse.cs @@ -0,0 +1,66 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response body structure of data flow result for data preview, + /// statistics or expression preview. + /// + public partial class DataFlowDebugCommandResponse + { + /// + /// Initializes a new instance of the DataFlowDebugCommandResponse + /// class. + /// + public DataFlowDebugCommandResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowDebugCommandResponse + /// class. + /// + /// The run status of data preview, statistics or + /// expression preview. + /// The result data of data preview, statistics or + /// expression preview. + public DataFlowDebugCommandResponse(string status = default(string), string data = default(string)) + { + Status = status; + Data = data; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the run status of data preview, statistics or + /// expression preview. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets or sets the result data of data preview, statistics or + /// expression preview. + /// + [JsonProperty(PropertyName = "data")] + public string Data { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandType.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandType.cs new file mode 100644 index 000000000000..23470ffe9278 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugCommandType.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.DataFactory.Models +{ + + /// + /// Defines values for DataFlowDebugCommandType. + /// + public static class DataFlowDebugCommandType + { + public const string ExecutePreviewQuery = "executePreviewQuery"; + public const string ExecuteStatisticsQuery = "executeStatisticsQuery"; + public const string ExecuteExpressionQuery = "executeExpressionQuery"; + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugPackage.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugPackage.cs new file mode 100644 index 000000000000..19812c5beafe --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugPackage.cs @@ -0,0 +1,136 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Request body structure for starting data flow debug session. + /// + public partial class DataFlowDebugPackage + { + /// + /// Initializes a new instance of the DataFlowDebugPackage class. + /// + public DataFlowDebugPackage() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowDebugPackage class. + /// + /// The ID of data flow debug session. + /// Data flow instance. + /// List of datasets. + /// List of linked services. + /// Staging info for debug session. + /// Data flow debug settings. + public DataFlowDebugPackage(string sessionId = default(string), DataFlowResource dataFlow = default(DataFlowResource), IList datasets = default(IList), IList linkedServices = default(IList), DataFlowStagingInfo staging = default(DataFlowStagingInfo), DataFlowDebugPackageDebugSettings debugSettings = default(DataFlowDebugPackageDebugSettings), object additionalProperties = default(object)) + { + SessionId = sessionId; + DataFlow = dataFlow; + Datasets = datasets; + LinkedServices = linkedServices; + Staging = staging; + DebugSettings = debugSettings; + AdditionalProperties = additionalProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of data flow debug session. + /// + [JsonProperty(PropertyName = "sessionId")] + public string SessionId { get; set; } + + /// + /// Gets or sets data flow instance. + /// + [JsonProperty(PropertyName = "dataFlow")] + public DataFlowResource DataFlow { get; set; } + + /// + /// Gets or sets list of datasets. + /// + [JsonProperty(PropertyName = "datasets")] + public IList Datasets { get; set; } + + /// + /// Gets or sets list of linked services. + /// + [JsonProperty(PropertyName = "linkedServices")] + public IList LinkedServices { get; set; } + + /// + /// Gets or sets staging info for debug session. + /// + [JsonProperty(PropertyName = "staging")] + public DataFlowStagingInfo Staging { get; set; } + + /// + /// Gets or sets data flow debug settings. + /// + [JsonProperty(PropertyName = "debugSettings")] + public DataFlowDebugPackageDebugSettings DebugSettings { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalProperties")] + public object AdditionalProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DataFlow != null) + { + DataFlow.Validate(); + } + if (Datasets != null) + { + foreach (var element in Datasets) + { + if (element != null) + { + element.Validate(); + } + } + } + if (LinkedServices != null) + { + foreach (var element1 in LinkedServices) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (Staging != null) + { + Staging.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugPackageDebugSettings.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugPackageDebugSettings.cs new file mode 100644 index 000000000000..ba905f0711b3 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugPackageDebugSettings.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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data flow debug settings. + /// + public partial class DataFlowDebugPackageDebugSettings + { + /// + /// Initializes a new instance of the DataFlowDebugPackageDebugSettings + /// class. + /// + public DataFlowDebugPackageDebugSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowDebugPackageDebugSettings + /// class. + /// + /// Source setting for data flow + /// debug. + /// Data flow parameters. + /// Parameters for dataset. + public DataFlowDebugPackageDebugSettings(IList sourceSettings = default(IList), IDictionary parameters = default(IDictionary), object datasetParameters = default(object)) + { + SourceSettings = sourceSettings; + Parameters = parameters; + DatasetParameters = datasetParameters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets source setting for data flow debug. + /// + [JsonProperty(PropertyName = "sourceSettings")] + public IList SourceSettings { get; set; } + + /// + /// Gets or sets data flow parameters. + /// + [JsonProperty(PropertyName = "parameters")] + public IDictionary Parameters { get; set; } + + /// + /// Gets or sets parameters for dataset. + /// + [JsonProperty(PropertyName = "datasetParameters")] + public object DatasetParameters { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionCreateHeaders.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionCreateHeaders.cs new file mode 100644 index 000000000000..d2e5f57282df --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionCreateHeaders.cs @@ -0,0 +1,54 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Create operation. + /// + public partial class DataFlowDebugSessionCreateHeaders + { + /// + /// Initializes a new instance of the DataFlowDebugSessionCreateHeaders + /// class. + /// + public DataFlowDebugSessionCreateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowDebugSessionCreateHeaders + /// class. + /// + /// URI to poll for asynchronous operation + /// status. + public DataFlowDebugSessionCreateHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URI to poll for asynchronous operation status. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionExecuteCommandHeaders.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionExecuteCommandHeaders.cs new file mode 100644 index 000000000000..6b26e807ebf7 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionExecuteCommandHeaders.cs @@ -0,0 +1,54 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for ExecuteCommand operation. + /// + public partial class DataFlowDebugSessionExecuteCommandHeaders + { + /// + /// Initializes a new instance of the + /// DataFlowDebugSessionExecuteCommandHeaders class. + /// + public DataFlowDebugSessionExecuteCommandHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataFlowDebugSessionExecuteCommandHeaders class. + /// + /// URI to poll for asynchronous operation + /// status. + public DataFlowDebugSessionExecuteCommandHeaders(string location = default(string)) + { + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets URI to poll for asynchronous operation status. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionInfo.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionInfo.cs new file mode 100644 index 000000000000..7d3842d667e9 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowDebugSessionInfo.cs @@ -0,0 +1,127 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Data flow debug session info. + /// + public partial class DataFlowDebugSessionInfo + { + /// + /// Initializes a new instance of the DataFlowDebugSessionInfo class. + /// + public DataFlowDebugSessionInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowDebugSessionInfo class. + /// + /// The name of the data flow. + /// Compute type of the cluster. + /// Core count of the cluster. + /// Node count of the cluster. (deprecated + /// property) + /// Attached integration runtime + /// name of data flow debug session. + /// The ID of data flow debug session. + /// Start time of data flow debug + /// session. + /// Compute type of the + /// cluster. + /// Last activity time of data flow + /// debug session. + public DataFlowDebugSessionInfo(string dataFlowName = default(string), string computeType = default(string), int? coreCount = default(int?), int? nodeCount = default(int?), string integrationRuntimeName = default(string), string sessionId = default(string), string startTime = default(string), string timeToLiveInMinutes = default(string), string lastActivityTime = default(string), object additionalProperties = default(object)) + { + DataFlowName = dataFlowName; + ComputeType = computeType; + CoreCount = coreCount; + NodeCount = nodeCount; + IntegrationRuntimeName = integrationRuntimeName; + SessionId = sessionId; + StartTime = startTime; + TimeToLiveInMinutes = timeToLiveInMinutes; + LastActivityTime = lastActivityTime; + AdditionalProperties = additionalProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the data flow. + /// + [JsonProperty(PropertyName = "dataFlowName")] + public string DataFlowName { get; set; } + + /// + /// Gets or sets compute type of the cluster. + /// + [JsonProperty(PropertyName = "computeType")] + public string ComputeType { get; set; } + + /// + /// Gets or sets core count of the cluster. + /// + [JsonProperty(PropertyName = "coreCount")] + public int? CoreCount { get; set; } + + /// + /// Gets or sets node count of the cluster. (deprecated property) + /// + [JsonProperty(PropertyName = "nodeCount")] + public int? NodeCount { get; set; } + + /// + /// Gets or sets attached integration runtime name of data flow debug + /// session. + /// + [JsonProperty(PropertyName = "integrationRuntimeName")] + public string IntegrationRuntimeName { get; set; } + + /// + /// Gets or sets the ID of data flow debug session. + /// + [JsonProperty(PropertyName = "sessionId")] + public string SessionId { get; set; } + + /// + /// Gets or sets start time of data flow debug session. + /// + [JsonProperty(PropertyName = "startTime")] + public string StartTime { get; set; } + + /// + /// Gets or sets compute type of the cluster. + /// + [JsonProperty(PropertyName = "timeToLiveInMinutes")] + public string TimeToLiveInMinutes { get; set; } + + /// + /// Gets or sets last activity time of data flow debug session. + /// + [JsonProperty(PropertyName = "lastActivityTime")] + public string LastActivityTime { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalProperties")] + public object AdditionalProperties { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowFolder.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowFolder.cs new file mode 100644 index 000000000000..99419a661eee --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowFolder.cs @@ -0,0 +1,53 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The folder that this data flow is in. If not specified, Data flow will + /// appear at the root level. + /// + public partial class DataFlowFolder + { + /// + /// Initializes a new instance of the DataFlowFolder class. + /// + public DataFlowFolder() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowFolder class. + /// + /// The name of the folder that this data flow is + /// in. + public DataFlowFolder(string name = default(string)) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the folder that this data flow is in. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowReference.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowReference.cs new file mode 100644 index 000000000000..da9861bce286 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowReference.cs @@ -0,0 +1,99 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data flow reference type. + /// + public partial class DataFlowReference + { + /// + /// Initializes a new instance of the DataFlowReference class. + /// + public DataFlowReference() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowReference class. + /// + /// Reference data flow name. + /// Unmatched properties from the + /// message are deserialized this collection + /// Reference data flow parameters from + /// dataset. + public DataFlowReference(string referenceName, IDictionary additionalProperties = default(IDictionary), object datasetParameters = default(object)) + { + AdditionalProperties = additionalProperties; + ReferenceName = referenceName; + DatasetParameters = datasetParameters; + CustomInit(); + } + /// + /// Static constructor for DataFlowReference class. + /// + static DataFlowReference() + { + Type = "DataFlowReference"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unmatched properties from the message are deserialized + /// this collection + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Gets or sets reference data flow name. + /// + [JsonProperty(PropertyName = "referenceName")] + public string ReferenceName { get; set; } + + /// + /// Gets or sets reference data flow parameters from dataset. + /// + [JsonProperty(PropertyName = "datasetParameters")] + public object DatasetParameters { get; set; } + + /// + /// Data flow reference type. + /// + [JsonProperty(PropertyName = "type")] + public static string Type { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ReferenceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ReferenceName"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowResource.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowResource.cs new file mode 100644 index 000000000000..6ee35e23dc6e --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowResource.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.DataFactory.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Data flow resource type. + /// + public partial class DataFlowResource : SubResource + { + /// + /// Initializes a new instance of the DataFlowResource class. + /// + public DataFlowResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowResource class. + /// + /// Data flow properties. + /// The resource identifier. + /// The resource name. + /// The resource type. + /// Etag identifies change in the resource. + public DataFlowResource(DataFlow properties, string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type, etag) + { + Properties = properties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets data flow properties. + /// + [JsonProperty(PropertyName = "properties")] + public DataFlow Properties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Properties == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSink.cs new file mode 100644 index 000000000000..3d974932cd68 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSink.cs @@ -0,0 +1,78 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Transformation for data flow sink. + /// + public partial class DataFlowSink : Transformation + { + /// + /// Initializes a new instance of the DataFlowSink class. + /// + public DataFlowSink() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowSink class. + /// + /// Transformation name. + /// Unmatched properties from the + /// message are deserialized this collection + /// Transformation description. + /// Dataset reference. + public DataFlowSink(string name, IDictionary additionalProperties = default(IDictionary), string description = default(string), DatasetReference dataset = default(DatasetReference), object additionalProperties = default(object)) + : base(name, additionalProperties, description) + { + Dataset = dataset; + AdditionalProperties = additionalProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets dataset reference. + /// + [JsonProperty(PropertyName = "dataset")] + public DatasetReference Dataset { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalProperties")] + public object AdditionalProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Dataset != null) + { + Dataset.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSource.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSource.cs new file mode 100644 index 000000000000..2200c5bba906 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSource.cs @@ -0,0 +1,78 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Transformation for data flow source. + /// + public partial class DataFlowSource : Transformation + { + /// + /// Initializes a new instance of the DataFlowSource class. + /// + public DataFlowSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowSource class. + /// + /// Transformation name. + /// Unmatched properties from the + /// message are deserialized this collection + /// Transformation description. + /// Dataset reference. + public DataFlowSource(string name, IDictionary additionalProperties = default(IDictionary), string description = default(string), DatasetReference dataset = default(DatasetReference), object additionalProperties = default(object)) + : base(name, additionalProperties, description) + { + Dataset = dataset; + AdditionalProperties = additionalProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets dataset reference. + /// + [JsonProperty(PropertyName = "dataset")] + public DatasetReference Dataset { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalProperties")] + public object AdditionalProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (Dataset != null) + { + Dataset.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSourceSetting.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSourceSetting.cs new file mode 100644 index 000000000000..2842dc3348fc --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowSourceSetting.cs @@ -0,0 +1,66 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Definition of data flow source setting for debug. + /// + public partial class DataFlowSourceSetting + { + /// + /// Initializes a new instance of the DataFlowSourceSetting class. + /// + public DataFlowSourceSetting() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowSourceSetting class. + /// + /// The data flow source name. + /// Defines the row limit of data flow source in + /// debug. + public DataFlowSourceSetting(string sourceName = default(string), int? rowLimit = default(int?), object additionalProperties = default(object)) + { + SourceName = sourceName; + RowLimit = rowLimit; + AdditionalProperties = additionalProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the data flow source name. + /// + [JsonProperty(PropertyName = "sourceName")] + public string SourceName { get; set; } + + /// + /// Gets or sets defines the row limit of data flow source in debug. + /// + [JsonProperty(PropertyName = "rowLimit")] + public int? RowLimit { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalProperties")] + public object AdditionalProperties { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowStagingInfo.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowStagingInfo.cs new file mode 100644 index 000000000000..b77877ea33a0 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DataFlowStagingInfo.cs @@ -0,0 +1,73 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Staging info for execute data flow activity. + /// + public partial class DataFlowStagingInfo + { + /// + /// Initializes a new instance of the DataFlowStagingInfo class. + /// + public DataFlowStagingInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataFlowStagingInfo class. + /// + /// Staging linked service + /// reference. + /// Folder path for staging blob. + public DataFlowStagingInfo(LinkedServiceReference linkedService = default(LinkedServiceReference), string folderPath = default(string)) + { + LinkedService = linkedService; + FolderPath = folderPath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets staging linked service reference. + /// + [JsonProperty(PropertyName = "linkedService")] + public LinkedServiceReference LinkedService { get; set; } + + /// + /// Gets or sets folder path for staging blob. + /// + [JsonProperty(PropertyName = "folderPath")] + public string FolderPath { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (LinkedService != null) + { + LinkedService.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DeleteDataFlowDebugSessionRequest.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DeleteDataFlowDebugSessionRequest.cs new file mode 100644 index 000000000000..d6bcccba884a --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DeleteDataFlowDebugSessionRequest.cs @@ -0,0 +1,53 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body structure for deleting data flow debug session. + /// + public partial class DeleteDataFlowDebugSessionRequest + { + /// + /// Initializes a new instance of the DeleteDataFlowDebugSessionRequest + /// class. + /// + public DeleteDataFlowDebugSessionRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DeleteDataFlowDebugSessionRequest + /// class. + /// + /// The ID of data flow debug session. + public DeleteDataFlowDebugSessionRequest(string sessionId = default(string)) + { + SessionId = sessionId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of data flow debug session. + /// + [JsonProperty(PropertyName = "sessionId")] + public string SessionId { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ExecuteDataFlowActivity.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ExecuteDataFlowActivity.cs new file mode 100644 index 000000000000..2ec5dc7577f4 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/ExecuteDataFlowActivity.cs @@ -0,0 +1,111 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Execute data flow activity. + /// + [Newtonsoft.Json.JsonObject("ExecuteDataFlow")] + [Rest.Serialization.JsonTransformation] + public partial class ExecuteDataFlowActivity : ExecutionActivity + { + /// + /// Initializes a new instance of the ExecuteDataFlowActivity class. + /// + public ExecuteDataFlowActivity() + { + DataFlow = new DataFlowReference(); + CustomInit(); + } + + /// + /// Initializes a new instance of the ExecuteDataFlowActivity class. + /// + /// Activity name. + /// Data flow reference. + /// Unmatched properties from the + /// message are deserialized this collection + /// Activity description. + /// Activity depends on condition. + /// Activity user properties. + /// Linked service reference. + /// Activity policy. + /// Staging info for execute data flow + /// activity. + /// The integration runtime + /// reference. + public ExecuteDataFlowActivity(string name, DataFlowReference dataFlow, IDictionary additionalProperties = default(IDictionary), string description = default(string), IList dependsOn = default(IList), IList userProperties = default(IList), LinkedServiceReference linkedServiceName = default(LinkedServiceReference), ActivityPolicy policy = default(ActivityPolicy), DataFlowStagingInfo staging = default(DataFlowStagingInfo), IntegrationRuntimeReference integrationRuntime = default(IntegrationRuntimeReference)) + : base(name, additionalProperties, description, dependsOn, userProperties, linkedServiceName, policy) + { + DataFlow = dataFlow; + Staging = staging; + IntegrationRuntime = integrationRuntime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets data flow reference. + /// + [JsonProperty(PropertyName = "typeProperties.dataFlow")] + public DataFlowReference DataFlow { get; set; } + + /// + /// Gets or sets staging info for execute data flow activity. + /// + [JsonProperty(PropertyName = "typeProperties.staging")] + public DataFlowStagingInfo Staging { get; set; } + + /// + /// Gets or sets the integration runtime reference. + /// + [JsonProperty(PropertyName = "typeProperties.integrationRuntime")] + public IntegrationRuntimeReference IntegrationRuntime { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (DataFlow == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DataFlow"); + } + if (DataFlow != null) + { + DataFlow.Validate(); + } + if (Staging != null) + { + Staging.Validate(); + } + if (IntegrationRuntime != null) + { + IntegrationRuntime.Validate(); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/GetDataFactoryOperationStatusResponse.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/GetDataFactoryOperationStatusResponse.cs new file mode 100644 index 000000000000..3a67a1311e58 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/GetDataFactoryOperationStatusResponse.cs @@ -0,0 +1,59 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Response body structure for get data factory operation status. + /// + public partial class GetDataFactoryOperationStatusResponse + { + /// + /// Initializes a new instance of the + /// GetDataFactoryOperationStatusResponse class. + /// + public GetDataFactoryOperationStatusResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GetDataFactoryOperationStatusResponse class. + /// + /// Status of the operation. + public GetDataFactoryOperationStatusResponse(string status = default(string), object additionalProperties = default(object)) + { + Status = status; + AdditionalProperties = additionalProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of the operation. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalProperties")] + public object AdditionalProperties { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/MappingDataFlow.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/MappingDataFlow.cs new file mode 100644 index 000000000000..23aab906246c --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/MappingDataFlow.cs @@ -0,0 +1,103 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Mapping data flow. + /// + [Rest.Serialization.JsonTransformation] + public partial class MappingDataFlow : DataFlow + { + /// + /// Initializes a new instance of the MappingDataFlow class. + /// + public MappingDataFlow() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MappingDataFlow class. + /// + /// The description of the data flow. + /// List of tags that can be used for + /// describing the data flow. + /// The folder that this data flow is in. If not + /// specified, Data flow will appear at the root level. + /// Unmatched properties from the + /// message are deserialized this collection + /// List of sources in data flow. + /// List of sinks in data flow. + /// List of transformations in data + /// flow. + /// DataFlow script. + public MappingDataFlow(string description = default(string), IList annotations = default(IList), DataFlowFolder folder = default(DataFlowFolder), IDictionary additionalProperties = default(IDictionary), IList sources = default(IList), IList sinks = default(IList), IList transformations = default(IList), string script = default(string), object additionalProperties1 = default(object)) + : base(description, annotations, folder) + { + AdditionalProperties = additionalProperties; + Sources = sources; + Sinks = sinks; + Transformations = transformations; + Script = script; + AdditionalProperties1 = additionalProperties1; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unmatched properties from the message are deserialized + /// this collection + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Gets or sets list of sources in data flow. + /// + [JsonProperty(PropertyName = "typeProperties.sources")] + public IList Sources { get; set; } + + /// + /// Gets or sets list of sinks in data flow. + /// + [JsonProperty(PropertyName = "typeProperties.sinks")] + public IList Sinks { get; set; } + + /// + /// Gets or sets list of transformations in data flow. + /// + [JsonProperty(PropertyName = "typeProperties.transformations")] + public IList Transformations { get; set; } + + /// + /// Gets or sets dataFlow script. + /// + [JsonProperty(PropertyName = "typeProperties.script")] + public string Script { get; set; } + + /// + /// + [JsonProperty(PropertyName = "typeProperties.additionalProperties")] + public object AdditionalProperties1 { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISPackageLocation.cs similarity index 100% rename from sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SsisPackageLocation.cs rename to sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/SSISPackageLocation.cs diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/Transformation.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/Transformation.cs new file mode 100644 index 000000000000..39406950f461 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/Transformation.cs @@ -0,0 +1,85 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A data flow transformation. + /// + public partial class Transformation + { + /// + /// Initializes a new instance of the Transformation class. + /// + public Transformation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Transformation class. + /// + /// Transformation name. + /// Unmatched properties from the + /// message are deserialized this collection + /// Transformation description. + public Transformation(string name, IDictionary additionalProperties = default(IDictionary), string description = default(string)) + { + AdditionalProperties = additionalProperties; + Name = name; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unmatched properties from the message are deserialized + /// this collection + /// + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } + + /// + /// Gets or sets transformation name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets transformation description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs index c563702e5662..7c97f1039412 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/SdkInfo_DataFactoryManagementClient.cs @@ -20,6 +20,8 @@ public static IEnumerable> ApiInfo_DataFactoryMana return new Tuple[] { new Tuple("DataFactory", "ActivityRuns", "2018-06-01"), + new Tuple("DataFactory", "DataFlowDebugSession", "2018-06-01"), + new Tuple("DataFactory", "DataFlows", "2018-06-01"), new Tuple("DataFactory", "Datasets", "2018-06-01"), new Tuple("DataFactory", "ExposureControl", "2018-06-01"), new Tuple("DataFactory", "Factories", "2018-06-01"), @@ -36,16 +38,5 @@ public static IEnumerable> ApiInfo_DataFactoryMana }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datafactory/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2018-06 --csharp-sdks-folder=C:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "6bec7452e59b579f0a1e203b937bf1157eb8af1e"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - From 4b3a2fda1d01fa6d5f119e98158c0fc7a2098f50 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2019 10:36:45 +0000 Subject: [PATCH 19/23] [AutoPR Microsoft.Azure.Management.DataFactory] [DataFactory] - Add CosmosDbSqlApi dataset (#223) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * [AutoPR Microsoft.Azure.Management.FrontDoor] Remove unsupported REST APIs from frontdoor (#218) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from 5c5a9743d699fe0a4ba6d07b69d696f490ae50a0 Delete unused example json files * [AutoPR Microsoft.Azure.Management.Logic] [LogicApps] New Api version (#140) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * Generated from 56286b280dda0ebf76f171c8e4f7288e5ea5141b Fixed Resubmit trigger histories * Generated from 8188f2ed896ed7f345c5a324f3c62aaca926a35b Removed one property which won't be exposed to public for now --- .../Generated/Models/CosmosDbLinkedService.cs | 46 ++++++---- .../Models/CosmosDbSqlApiCollectionDataset.cs | 92 +++++++++++++++++++ .../Generated/Models/CosmosDbSqlApiSink.cs | 73 +++++++++++++++ .../Generated/Models/CosmosDbSqlApiSource.cs | 86 +++++++++++++++++ .../Models/DocumentDbCollectionSink.cs | 8 +- 5 files changed, 286 insertions(+), 19 deletions(-) create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiCollectionDataset.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiSink.cs create mode 100644 sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiSource.cs diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbLinkedService.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbLinkedService.cs index 63ffd4370576..076249b68755 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbLinkedService.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbLinkedService.cs @@ -35,8 +35,6 @@ public CosmosDbLinkedService() /// /// Initializes a new instance of the CosmosDbLinkedService class. /// - /// The connection string. Type: string, - /// SecureString or AzureKeyVaultSecretReference. /// Unmatched properties from the /// message are deserialized this collection /// The integration runtime reference. @@ -44,16 +42,26 @@ public CosmosDbLinkedService() /// Parameters for linked service. /// List of tags that can be used for /// describing the linked service. - /// The Azure key vault secret reference of - /// accountKey in connection string. + /// The connection string. Type: string, + /// SecureString or AzureKeyVaultSecretReference. + /// The endpoint of the Azure CosmosDB + /// account. Type: string (or Expression with resultType + /// string) + /// The name of the database. Type: string (or + /// Expression with resultType string) + /// The account key of the Azure CosmosDB + /// account. Type: SecureString or + /// AzureKeyVaultSecretReference. /// The encrypted credential used for /// authentication. Credentials are encrypted using the integration /// runtime credential manager. Type: string (or Expression with /// resultType string). - public CosmosDbLinkedService(object connectionString, IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), AzureKeyVaultSecretReference accountKey = default(AzureKeyVaultSecretReference), object encryptedCredential = default(object)) + public CosmosDbLinkedService(IDictionary additionalProperties = default(IDictionary), IntegrationRuntimeReference connectVia = default(IntegrationRuntimeReference), string description = default(string), IDictionary parameters = default(IDictionary), IList annotations = default(IList), object connectionString = default(object), object accountEndpoint = default(object), object database = default(object), SecretBase accountKey = default(SecretBase), object encryptedCredential = default(object)) : base(additionalProperties, connectVia, description, parameters, annotations) { ConnectionString = connectionString; + AccountEndpoint = accountEndpoint; + Database = database; AccountKey = accountKey; EncryptedCredential = encryptedCredential; CustomInit(); @@ -72,11 +80,25 @@ public CosmosDbLinkedService() public object ConnectionString { get; set; } /// - /// Gets or sets the Azure key vault secret reference of accountKey in - /// connection string. + /// Gets or sets the endpoint of the Azure CosmosDB account. Type: + /// string (or Expression with resultType string) + /// + [JsonProperty(PropertyName = "typeProperties.accountEndpoint")] + public object AccountEndpoint { get; set; } + + /// + /// Gets or sets the name of the database. Type: string (or Expression + /// with resultType string) + /// + [JsonProperty(PropertyName = "typeProperties.database")] + public object Database { get; set; } + + /// + /// Gets or sets the account key of the Azure CosmosDB account. Type: + /// SecureString or AzureKeyVaultSecretReference. /// [JsonProperty(PropertyName = "typeProperties.accountKey")] - public AzureKeyVaultSecretReference AccountKey { get; set; } + public SecretBase AccountKey { get; set; } /// /// Gets or sets the encrypted credential used for authentication. @@ -95,14 +117,6 @@ public CosmosDbLinkedService() public override void Validate() { base.Validate(); - if (ConnectionString == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectionString"); - } - if (AccountKey != null) - { - AccountKey.Validate(); - } } } } diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiCollectionDataset.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiCollectionDataset.cs new file mode 100644 index 000000000000..7e787f7f1263 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiCollectionDataset.cs @@ -0,0 +1,92 @@ +// +// 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.DataFactory.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Microsoft Azure CosmosDB (SQL API) Collection dataset. + /// + [Newtonsoft.Json.JsonObject("CosmosDbSqlApiCollection")] + [Rest.Serialization.JsonTransformation] + public partial class CosmosDbSqlApiCollectionDataset : Dataset + { + /// + /// Initializes a new instance of the CosmosDbSqlApiCollectionDataset + /// class. + /// + public CosmosDbSqlApiCollectionDataset() + { + LinkedServiceName = new LinkedServiceReference(); + CustomInit(); + } + + /// + /// Initializes a new instance of the CosmosDbSqlApiCollectionDataset + /// class. + /// + /// Linked service reference. + /// CosmosDB (SQL API) collection name. + /// Type: string (or Expression with resultType string). + /// Unmatched properties from the + /// message are deserialized this collection + /// Dataset description. + /// Columns that define the structure of the + /// dataset. Type: array (or Expression with resultType array), + /// itemType: DatasetDataElement. + /// Columns that define the physical type schema + /// of the dataset. Type: array (or Expression with resultType array), + /// itemType: DatasetSchemaDataElement. + /// Parameters for dataset. + /// List of tags that can be used for + /// describing the Dataset. + /// The folder that this Dataset is in. If not + /// specified, Dataset will appear at the root level. + public CosmosDbSqlApiCollectionDataset(LinkedServiceReference linkedServiceName, object collectionName, IDictionary additionalProperties = default(IDictionary), string description = default(string), object structure = default(object), object schema = default(object), IDictionary parameters = default(IDictionary), IList annotations = default(IList), DatasetFolder folder = default(DatasetFolder)) + : base(linkedServiceName, additionalProperties, description, structure, schema, parameters, annotations, folder) + { + CollectionName = collectionName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets cosmosDB (SQL API) collection name. Type: string (or + /// Expression with resultType string). + /// + [JsonProperty(PropertyName = "typeProperties.collectionName")] + public object CollectionName { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (CollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CollectionName"); + } + } + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiSink.cs new file mode 100644 index 000000000000..a6f5bf1acc86 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiSink.cs @@ -0,0 +1,73 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A copy activity Azure CosmosDB (SQL API) Collection sink. + /// + public partial class CosmosDbSqlApiSink : CopySink + { + /// + /// Initializes a new instance of the CosmosDbSqlApiSink class. + /// + public CosmosDbSqlApiSink() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CosmosDbSqlApiSink class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Write batch size. Type: integer (or + /// Expression with resultType integer), minimum: 0. + /// Write batch timeout. Type: string + /// (or Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// Sink retry count. Type: integer (or + /// Expression with resultType integer). + /// Sink retry wait. Type: string (or + /// Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// The maximum concurrent + /// connection count for the sink data store. Type: integer (or + /// Expression with resultType integer). + /// Describes how to write data to Azure + /// Cosmos DB. Type: string (or Expression with resultType string). + /// Allowed values: insert and upsert. + public CosmosDbSqlApiSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object writeBehavior = default(object)) + : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) + { + WriteBehavior = writeBehavior; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets describes how to write data to Azure Cosmos DB. Type: + /// string (or Expression with resultType string). Allowed values: + /// insert and upsert. + /// + [JsonProperty(PropertyName = "writeBehavior")] + public object WriteBehavior { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiSource.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiSource.cs new file mode 100644 index 000000000000..b51433059c56 --- /dev/null +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/CosmosDbSqlApiSource.cs @@ -0,0 +1,86 @@ +// +// 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.DataFactory.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A copy activity Azure CosmosDB (SQL API) Collection source. + /// + public partial class CosmosDbSqlApiSource : CopySource + { + /// + /// Initializes a new instance of the CosmosDbSqlApiSource class. + /// + public CosmosDbSqlApiSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CosmosDbSqlApiSource class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Source retry count. Type: integer + /// (or Expression with resultType integer). + /// Source retry wait. Type: string (or + /// Expression with resultType string), pattern: + /// ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + /// The maximum concurrent + /// connection count for the source data store. Type: integer (or + /// Expression with resultType integer). + /// SQL API query. Type: string (or Expression with + /// resultType string). + /// Page size of the result. Type: integer (or + /// Expression with resultType integer). + /// Preferred regions. Type: array of + /// strings (or Expression with resultType array of strings). + public CosmosDbSqlApiSource(IDictionary additionalProperties = default(IDictionary), object sourceRetryCount = default(object), object sourceRetryWait = default(object), object maxConcurrentConnections = default(object), object query = default(object), object pageSize = default(object), object preferredRegions = default(object)) + : base(additionalProperties, sourceRetryCount, sourceRetryWait, maxConcurrentConnections) + { + Query = query; + PageSize = pageSize; + PreferredRegions = preferredRegions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets SQL API query. Type: string (or Expression with + /// resultType string). + /// + [JsonProperty(PropertyName = "query")] + public object Query { get; set; } + + /// + /// Gets or sets page size of the result. Type: integer (or Expression + /// with resultType integer). + /// + [JsonProperty(PropertyName = "pageSize")] + public object PageSize { get; set; } + + /// + /// Gets or sets preferred regions. Type: array of strings (or + /// Expression with resultType array of strings). + /// + [JsonProperty(PropertyName = "preferredRegions")] + public object PreferredRegions { get; set; } + + } +} diff --git a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DocumentDbCollectionSink.cs b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DocumentDbCollectionSink.cs index 9ceefb6b2244..7e1ca124e4b3 100644 --- a/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DocumentDbCollectionSink.cs +++ b/sdk/datafactory/Microsoft.Azure.Management.DataFactory/src/Generated/Models/DocumentDbCollectionSink.cs @@ -50,7 +50,8 @@ public DocumentDbCollectionSink() /// is . (dot). Type: string (or Expression with resultType /// string). /// Describes how to write data to Azure - /// Cosmos DB. Allowed values: insert and upsert. + /// Cosmos DB. Type: string (or Expression with resultType string). + /// Allowed values: insert and upsert. public DocumentDbCollectionSink(IDictionary additionalProperties = default(IDictionary), object writeBatchSize = default(object), object writeBatchTimeout = default(object), object sinkRetryCount = default(object), object sinkRetryWait = default(object), object maxConcurrentConnections = default(object), object nestingSeparator = default(object), object writeBehavior = default(object)) : base(additionalProperties, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections) { @@ -72,8 +73,9 @@ public DocumentDbCollectionSink() public object NestingSeparator { get; set; } /// - /// Gets or sets describes how to write data to Azure Cosmos DB. - /// Allowed values: insert and upsert. + /// Gets or sets describes how to write data to Azure Cosmos DB. Type: + /// string (or Expression with resultType string). Allowed values: + /// insert and upsert. /// [JsonProperty(PropertyName = "writeBehavior")] public object WriteBehavior { get; set; } From 27ed93f3fee99e4448f768a76eea13d1eff3fe0a Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2019 03:22:54 +0000 Subject: [PATCH 20/23] [AutoPR Microsoft.Azure.Management.Storage] [SRP] Add nextLink to StorageAccountList (#227) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * [AutoPR Microsoft.Azure.Management.FrontDoor] Remove unsupported REST APIs from frontdoor (#218) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from 5c5a9743d699fe0a4ba6d07b69d696f490ae50a0 Delete unused example json files * [AutoPR Microsoft.Azure.Management.Logic] [LogicApps] New Api version (#140) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * [AutoPR Microsoft.Azure.Management.FrontDoor] [AFD WAF] Add defaultState and defaultAction to managed rule set definitions (#204) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * Generated from 3fa8f3514a5e14cab1429615541e7f04e8730996 Add read-only to defaultAction and defaultState fields * [AutoPR Microsoft.Azure.Management.Reservations] [Hub Generated] Review request for Microsoft.Capacity to add version preview/2019-04-01 (#198) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from cac978330e8c7b9583812a735cfeac97fb267056 reverted breaking operation id change * [AutoPR Microsoft.Azure.Management.DataMigration] Fix eligibility typo (#217) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 7a0a386b7bb4042100e0d4a5c9aed5ac4374ab3d (#208) Network: add java readme * [AutoPR Microsoft.Azure.Management.ContainerRegistry] [ACR] Scope map updates (#206) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * [AutoPR Microsoft.Azure.Management.Billing] Amaga/update customer policy (#202) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#196) new source * [AutoPR Microsoft.Azure.ApplicationInsights] Add purge API details. (#184) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from cf0d03934bcbc56858cf3696b0a3c7fa481c12ac Fix example * Generated from a48d205a68ab63fdafa5dcb79e013c6946d92a43 Applying Code review feedbacks * Generated from 604a599550d7aa46f836e8b47376839971cdfbb7 add scopemap to custom-words.txt * Generated from f8a0f9fccb5e3f7911f171e4480fbd48fc4a85df Remove suppression for Eligible typo * [AutoPR Microsoft.Azure.Management.ContainerService] fix getting agent pool available versions api path (#203) * Generated from 25369344fbeb2f169b5bc40b9c4a8a99c42503e7 (#194) chore: jsonfmt servicebus * Generated from 7a35ba99fa36d4a95daf9c4f7c88ae0867cb0825 (#195) Remove common from examples. * Generated from 7cd1aa92499c42947998cf1570e19ac0087fda19 (#193) missing section for compute 2019-07-01 * Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 fix getting agent pool available versions api path * Generated from 56286b280dda0ebf76f171c8e4f7288e5ea5141b Fixed Resubmit trigger histories * Generated from 51020f68a1a7cd0fd66f44a493e8a8b2a23f1e2a Add nextLink --- ...{ISKUsOperations.cs => ISkusOperations.cs} | 0 .../Generated/IStorageAccountsOperations.cs | 26 ++- .../Generated/Models/{IpRule.cs => IPRule.cs} | 0 .../{signedResource.cs => SignedResource.cs} | 0 .../SdkInfo_StorageManagementClient.cs | 11 -- .../{SKUsOperations.cs => SkusOperations.cs} | 0 ...ensions.cs => SkusOperationsExtensions.cs} | 0 .../Generated/StorageAccountsOperations.cs | 180 +++++++++++++++++- .../StorageAccountsOperationsExtensions.cs | 40 +++- 9 files changed, 240 insertions(+), 17 deletions(-) rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/{ISKUsOperations.cs => ISkusOperations.cs} (100%) rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/{IpRule.cs => IPRule.cs} (100%) rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/{signedResource.cs => SignedResource.cs} (100%) rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/{SKUsOperations.cs => SkusOperations.cs} (100%) rename sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/{SKUsOperationsExtensions.cs => SkusOperationsExtensions.cs} (100%) diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/ISKUsOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/ISkusOperations.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/ISKUsOperations.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/ISkusOperations.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageAccountsOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageAccountsOperations.cs index 96ff50a945af..4c75cfe729a7 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageAccountsOperations.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/IStorageAccountsOperations.cs @@ -204,7 +204,7 @@ public partial interface IStorageAccountsOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all the storage accounts available under the given resource /// group. Note that storage keys are not returned; use the ListKeys @@ -471,5 +471,29 @@ public partial interface IStorageAccountsOperations /// Thrown when a required parameter is null /// Task BeginFailoverWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the storage accounts available under the subscription. + /// Note that storage keys are not returned; use the ListKeys operation + /// for this. + /// + /// + /// 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)); } } diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/IpRule.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/IPRule.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/IpRule.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/IPRule.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/signedResource.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SignedResource.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/signedResource.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/Models/SignedResource.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs index 4e7117ff234d..ade321fb01d3 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SdkInfo_StorageManagementClient.cs @@ -31,16 +31,5 @@ public static IEnumerable> ApiInfo_StorageManageme }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/storage/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp.output-folder=C:\\code\\srpsdk\\sdk\\storage\\Microsoft.Azure.Management.Storage\\src\\Generated"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "6e6a651b6805d1811190025616f35e5a13194910"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SKUsOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SkusOperations.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SKUsOperations.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SkusOperations.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SKUsOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SkusOperationsExtensions.cs similarity index 100% rename from sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SKUsOperationsExtensions.cs rename to sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/SkusOperationsExtensions.cs diff --git a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageAccountsOperations.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageAccountsOperations.cs index 6fc4590d77db..c7317cd9777e 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageAccountsOperations.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageAccountsOperations.cs @@ -1049,7 +1049,7 @@ internal StorageAccountsOperations(StorageManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1185,7 +1185,7 @@ internal StorageAccountsOperations(StorageManagementClient 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")) @@ -1198,7 +1198,7 @@ internal StorageAccountsOperations(StorageManagementClient 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) { @@ -3176,5 +3176,179 @@ internal StorageAccountsOperations(StorageManagementClient client) return _result; } + /// + /// Lists all the storage accounts available under the subscription. Note that + /// storage keys are not returned; use the ListKeys operation for this. + /// + /// + /// 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 CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + 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/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageAccountsOperationsExtensions.cs b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageAccountsOperationsExtensions.cs index 6e3c4d40b6cc..0a3a10110d7c 100644 --- a/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageAccountsOperationsExtensions.cs +++ b/sdk/storage/Microsoft.Azure.Management.Storage/src/Generated/StorageAccountsOperationsExtensions.cs @@ -297,7 +297,7 @@ public static StorageAccount Update(this IStorageAccountsOperations operations, /// /// The operations group for this extension method. /// - public static IEnumerable List(this IStorageAccountsOperations operations) + public static IPage List(this IStorageAccountsOperations operations) { return operations.ListAsync().GetAwaiter().GetResult(); } @@ -312,7 +312,7 @@ public static IEnumerable List(this IStorageAccountsOperations o /// /// The cancellation token. /// - public static async Task> ListAsync(this IStorageAccountsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IStorageAccountsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -765,5 +765,41 @@ public static void BeginFailover(this IStorageAccountsOperations operations, str (await operations.BeginFailoverWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Lists all the storage accounts available under the subscription. Note that + /// storage keys are not returned; use the ListKeys operation for this. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IStorageAccountsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the storage accounts available under the subscription. Note that + /// storage keys are not returned; use the ListKeys operation for this. + /// + /// + /// 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 IStorageAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } From 52c6ab7cb5858446c93d386d9a98efe40a95e6ce Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2019 20:43:09 +0000 Subject: [PATCH 21/23] Generated from b86adb1353a8bc55b1f587f3f6b646f07ff14af2 (#212) Merge branch 'dev-consumption-Microsoft.Consumption-2019-06-01' of https://github.com/vihnguyen/azure-rest-api-specs into dev-consumption-Microsoft.Consumption-2019-06-01 --- .../Generated/ConsumptionManagementClient.cs | 10 +- .../Generated/IConsumptionManagementClient.cs | 7 +- .../IReservationRecommendationsOperations.cs | 52 +++ .../IReservationTransactionsOperations.cs | 80 ++++ .../IReservationsDetailsOperations.cs | 50 +++ .../IReservationsSummariesOperations.cs | 54 +++ .../src/Generated/IUsageDetailsOperations.cs | 97 +---- .../src/Generated/Models/Budget.cs | 6 +- .../src/Generated/Models/ReservationDetail.cs | 28 +- .../Models/ReservationRecommendation.cs | 45 +- .../Generated/Models/ReservationSummary.cs | 56 ++- .../Models/ReservationTransaction.cs | 228 ++++++++++ .../src/Generated/Models/SkuProperty.cs | 59 +++ .../src/Generated/Models/TimeGrainType.cs | 3 + .../src/Generated/Models/UsageDetail.cs | 4 +- .../Models/UsageDetailsDownloadHeaders.cs | 77 ---- .../Models/UsageDetailsDownloadResponse.cs | 72 --- .../ReservationRecommendationsOperations.cs | 358 +++++++++++++++ ...tionRecommendationsOperationsExtensions.cs | 84 ++++ .../ReservationTransactionsOperations.cs | 410 ++++++++++++++++++ ...rvationTransactionsOperationsExtensions.cs | 105 +++++ .../ReservationsDetailsOperations.cs | 360 +++++++++++++++ ...ReservationsDetailsOperationsExtensions.cs | 80 ++++ .../ReservationsSummariesOperations.cs | 369 ++++++++++++++++ ...servationsSummariesOperationsExtensions.cs | 88 ++++ .../SdkInfo_ConsumptionManagementClient.cs | 32 +- .../src/Generated/UsageDetailsOperations.cs | 266 +----------- .../UsageDetailsOperationsExtensions.cs | 172 +------- 28 files changed, 2569 insertions(+), 683 deletions(-) create mode 100644 sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationTransactionsOperations.cs create mode 100644 sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationTransaction.cs create mode 100644 sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/SkuProperty.cs delete mode 100644 sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetailsDownloadHeaders.cs delete mode 100644 sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetailsDownloadResponse.cs create mode 100644 sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperations.cs create mode 100644 sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperationsExtensions.cs diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ConsumptionManagementClient.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ConsumptionManagementClient.cs index 5f4ccf5c72a2..215e7745ac17 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ConsumptionManagementClient.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ConsumptionManagementClient.cs @@ -49,7 +49,7 @@ public partial class ConsumptionManagementClient : ServiceClient /// Version of the API to be used with the client request. The current version - /// is 2019-04-01-preview. + /// is 2019-06-01. /// public string ApiVersion { get; private set; } @@ -121,6 +121,11 @@ public partial class ConsumptionManagementClient : ServiceClient public virtual IReservationRecommendationsOperations ReservationRecommendations { get; private set; } + /// + /// Gets the IReservationTransactionsOperations. + /// + public virtual IReservationTransactionsOperations ReservationTransactions { get; private set; } + /// /// Gets the IPriceSheetOperations. /// @@ -391,12 +396,13 @@ private void Initialize() ReservationsSummaries = new ReservationsSummariesOperations(this); ReservationsDetails = new ReservationsDetailsOperations(this); ReservationRecommendations = new ReservationRecommendationsOperations(this); + ReservationTransactions = new ReservationTransactionsOperations(this); PriceSheet = new PriceSheetOperations(this); Forecasts = new ForecastsOperations(this); Operations = new Operations(this); AggregatedCost = new AggregatedCostOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-04-01-preview"; + ApiVersion = "2019-06-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IConsumptionManagementClient.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IConsumptionManagementClient.cs index e222d81ba322..1d64cf493787 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IConsumptionManagementClient.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IConsumptionManagementClient.cs @@ -43,7 +43,7 @@ public partial interface IConsumptionManagementClient : System.IDisposable /// /// Version of the API to be used with the client request. The current - /// version is 2019-04-01-preview. + /// version is 2019-06-01. /// string ApiVersion { get; } @@ -116,6 +116,11 @@ public partial interface IConsumptionManagementClient : System.IDisposable /// IReservationRecommendationsOperations ReservationRecommendations { get; } + /// + /// Gets the IReservationTransactionsOperations. + /// + IReservationTransactionsOperations ReservationTransactions { get; } + /// /// Gets the IPriceSheetOperations. /// diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationRecommendationsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationRecommendationsOperations.cs index 9c9af6f5a790..e2b9c9659f57 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationRecommendationsOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationRecommendationsOperations.cs @@ -48,6 +48,34 @@ public partial interface IReservationRecommendationsOperations /// Task>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// List of recommendations for purchasing reserved instances on + /// billing account scope + /// + /// + /// + /// BillingAccount ID + /// + /// + /// May be used to filter reservationRecommendations by + /// properties/scope and properties/lookBackPeriod. + /// + /// + /// 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>> ListByBillingAccountIdWithHttpMessagesAsync(string billingAccountId, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// List of recommendations for purchasing reserved instances. /// /// @@ -70,5 +98,29 @@ public partial interface IReservationRecommendationsOperations /// Thrown when a required parameter is null /// Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List of recommendations for purchasing reserved instances on + /// billing account scope + /// + /// + /// + /// 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>> ListByBillingAccountIdNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationTransactionsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationTransactionsOperations.cs new file mode 100644 index 000000000000..6b7af1efc04e --- /dev/null +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationTransactionsOperations.cs @@ -0,0 +1,80 @@ +// +// 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.Consumption +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ReservationTransactionsOperations operations. + /// + public partial interface IReservationTransactionsOperations + { + /// + /// List of transactions for reserved instances on billing account + /// scope + /// + /// + /// + /// BillingAccount ID + /// + /// + /// Filter reservation transactions by date range. The + /// properties/UsageDate for start date and end date. The filter + /// supports 'le' and 'ge' + /// + /// + /// 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>> ListByBillingAccountIdWithHttpMessagesAsync(string billingAccountId, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List of transactions for reserved instances on billing account + /// scope + /// + /// + /// + /// 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>> ListByBillingAccountIdNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationsDetailsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationsDetailsOperations.cs index d3ff2f1edd4d..a1f4a3ced738 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationsDetailsOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationsDetailsOperations.cs @@ -84,6 +84,33 @@ public partial interface IReservationsDetailsOperations /// Lists the reservations details for provided date range. /// /// + /// + /// BillingAccount ID + /// + /// + /// Filter reservation details by date range. The properties/UsageDate + /// for start date and end date. The filter supports 'le' and 'ge' + /// + /// + /// 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>> ListByBillingAccountIdWithHttpMessagesAsync(string billingAccountId, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the reservations details for provided date range. + /// + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -126,5 +153,28 @@ public partial interface IReservationsDetailsOperations /// Thrown when a required parameter is null /// Task>> ListByReservationOrderAndReservationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the reservations details for provided date range. + /// + /// + /// + /// 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>> ListByBillingAccountIdNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationsSummariesOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationsSummariesOperations.cs index dc422c9c9743..87b875745488 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationsSummariesOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IReservationsSummariesOperations.cs @@ -92,6 +92,37 @@ public partial interface IReservationsSummariesOperations /// Lists the reservations summaries for daily or monthly grain. /// /// + /// + /// BillingAccount ID + /// + /// + /// Can be daily or monthly. Possible values include: 'DailyGrain', + /// 'MonthlyGrain' + /// + /// + /// Required only for daily grain. The properties/UsageDate for start + /// date and end date. The filter supports 'le' and 'ge' + /// + /// + /// 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>> ListByBillingAccountIdWithHttpMessagesAsync(string billingAccountId, string grain, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the reservations summaries for daily or monthly grain. + /// + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -134,5 +165,28 @@ public partial interface IReservationsSummariesOperations /// Thrown when a required parameter is null /// Task>> ListByReservationOrderAndReservationNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the reservations summaries for daily or monthly grain. + /// + /// + /// + /// 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>> ListByBillingAccountIdNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IUsageDetailsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IUsageDetailsOperations.cs index 1ad611d71276..4156089c9734 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IUsageDetailsOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/IUsageDetailsOperations.cs @@ -55,10 +55,13 @@ public partial interface IUsageDetailsOperations /// /// May be used to filter usageDetails by properties/resourceGroup, /// properties/resourceName, properties/resourceId, - /// properties/chargeType, properties/reservationId or tags. 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 (:). + /// properties/chargeType, properties/reservationId, + /// properties/publisherType or tags. 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 (:). PublisherType Filter accepts two + /// values azure and marketplace and it is currently supported for Web + /// Direct Offer Type /// /// /// Skiptoken is only used if a previous operation returned a partial @@ -92,92 +95,6 @@ public partial interface IUsageDetailsOperations /// Task>> ListWithHttpMessagesAsync(string scope, string expand = default(string), string filter = default(string), string skiptoken = default(string), int? top = default(int?), string metric = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Download usage details data. - /// - /// - /// The scope associated with usage details operations. This includes - /// '/subscriptions/{subscriptionId}/' for subscription scope, - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - /// for resourceGroup scope, - /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' - /// for Billing Account scope, - /// '/providers/Microsoft.Billing/departments/{departmentId}' for - /// Department scope, - /// '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' - /// for EnrollmentAccount scope and - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - /// for Management Group scope. For subscription, billing account, - /// department, enrollment account and management group, you can also - /// add billing period to the scope using - /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. - /// For e.g. to specify billing period at department scope use - /// '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - /// - /// - /// Allows to select different type of cost/usage records. Possible - /// values include: 'ActualCostMetricType', 'AmortizedCostMetricType', - /// 'UsageMetricType' - /// - /// - /// 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 scope, string metric = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Download usage details data. - /// - /// - /// The scope associated with usage details operations. This includes - /// '/subscriptions/{subscriptionId}/' for subscription scope, - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' - /// for resourceGroup scope, - /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' - /// for Billing Account scope, - /// '/providers/Microsoft.Billing/departments/{departmentId}' for - /// Department scope, - /// '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' - /// for EnrollmentAccount scope and - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - /// for Management Group scope. For subscription, billing account, - /// department, enrollment account and management group, you can also - /// add billing period to the scope using - /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. - /// For e.g. to specify billing period at department scope use - /// '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - /// - /// - /// Allows to select different type of cost/usage records. Possible - /// values include: 'ActualCostMetricType', 'AmortizedCostMetricType', - /// 'UsageMetricType' - /// - /// - /// 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 scope, string metric = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Lists the usage details for the defined scope. Usage details are /// available via this API only for May 1, 2014 or later. /// diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/Budget.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/Budget.cs index fb09003f4ac6..9f050c992845 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/Budget.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/Budget.cs @@ -41,7 +41,8 @@ public Budget() /// budget /// The time covered by a budget. Tracking of /// the amount will be reset based on the time grain. Possible values - /// include: 'Monthly', 'Quarterly', 'Annually' + /// include: 'Monthly', 'Quarterly', 'Annually', 'BillingMonth', + /// 'BillingQuarter', 'BillingAnnual' /// Has start and end date of the budget. The /// start date must be first of the month and should be less than the /// end date. Budget start date must be on or after June 1, 2017. @@ -94,7 +95,8 @@ public Budget() /// /// Gets or sets the time covered by a budget. Tracking of the amount /// will be reset based on the time grain. Possible values include: - /// 'Monthly', 'Quarterly', 'Annually' + /// 'Monthly', 'Quarterly', 'Annually', 'BillingMonth', + /// 'BillingQuarter', 'BillingAnnual' /// [JsonProperty(PropertyName = "properties.timeGrain")] public string TimeGrain { get; set; } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationDetail.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationDetail.cs index f3903d5f9cb8..77c6286abcf8 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationDetail.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationDetail.cs @@ -43,6 +43,10 @@ public ReservationDetail() /// represents a single purchase transaction. A reservation order /// contains reservations. The reservation order specifies the VM size /// and region for the reservations. + /// The instance Flexibility + /// Ratio. + /// The instance Flexibility + /// Group. /// The reservation ID is the identifier of /// a reservation within a reservation order. Each reservation is the /// grouping for applying the benefit scope and also specifies the @@ -63,10 +67,13 @@ public ReservationDetail() /// resource or the fully qualified Resource ID. /// This is the total count of /// instances that are reserved for the reservationId. - public ReservationDetail(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string reservationOrderId = default(string), string reservationId = default(string), string skuName = default(string), decimal? reservedHours = default(decimal?), System.DateTime? usageDate = default(System.DateTime?), decimal? usedHours = default(decimal?), string instanceId = default(string), decimal? totalReservedQuantity = default(decimal?)) + /// The reservation kind. + public ReservationDetail(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string reservationOrderId = default(string), string instanceFlexibilityRatio = default(string), string instanceFlexibilityGroup = default(string), string reservationId = default(string), string skuName = default(string), decimal? reservedHours = default(decimal?), System.DateTime? usageDate = default(System.DateTime?), decimal? usedHours = default(decimal?), string instanceId = default(string), decimal? totalReservedQuantity = default(decimal?), string kind = default(string)) : base(id, name, type, tags) { ReservationOrderId = reservationOrderId; + InstanceFlexibilityRatio = instanceFlexibilityRatio; + InstanceFlexibilityGroup = instanceFlexibilityGroup; ReservationId = reservationId; SkuName = skuName; ReservedHours = reservedHours; @@ -74,6 +81,7 @@ public ReservationDetail() UsedHours = usedHours; InstanceId = instanceId; TotalReservedQuantity = totalReservedQuantity; + Kind = kind; CustomInit(); } @@ -92,6 +100,18 @@ public ReservationDetail() [JsonProperty(PropertyName = "properties.reservationOrderId")] public string ReservationOrderId { get; private set; } + /// + /// Gets the instance Flexibility Ratio. + /// + [JsonProperty(PropertyName = "properties.instanceFlexibilityRatio")] + public string InstanceFlexibilityRatio { get; private set; } + + /// + /// Gets the instance Flexibility Group. + /// + [JsonProperty(PropertyName = "properties.instanceFlexibilityGroup")] + public string InstanceFlexibilityGroup { get; private set; } + /// /// Gets the reservation ID is the identifier of a reservation within a /// reservation order. Each reservation is the grouping for applying @@ -142,5 +162,11 @@ public ReservationDetail() [JsonProperty(PropertyName = "properties.totalReservedQuantity")] public decimal? TotalReservedQuantity { get; private set; } + /// + /// Gets the reservation kind. + /// + [JsonProperty(PropertyName = "properties.kind")] + public string Kind { get; private set; } + } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationRecommendation.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationRecommendation.cs index 7bf72c60b372..16443aa05a69 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationRecommendation.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationRecommendation.cs @@ -42,6 +42,13 @@ public ReservationRecommendation() /// Resource sku /// The number of days of usage to look /// back for recommendation. + /// The instance Flexibility + /// Ratio. + /// The instance Flexibility + /// Group. + /// The normalized Size. + /// The recommended + /// Quantity Normalized. /// The meter id (GUID) /// RI recommendations in one or three year /// terms. @@ -56,7 +63,8 @@ public ReservationRecommendation() /// The usage date for looking /// back. /// Shared or single recommendation. - public ReservationRecommendation(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string sku = default(string), string lookBackPeriod = default(string), System.Guid? meterId = default(System.Guid?), string term = default(string), decimal? costWithNoReservedInstances = default(decimal?), decimal? recommendedQuantity = default(decimal?), decimal? totalCostWithReservedInstances = default(decimal?), decimal? netSavings = default(decimal?), System.DateTime? firstUsageDate = default(System.DateTime?), string scope = default(string)) + /// List of sku properties + public ReservationRecommendation(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string sku = default(string), string lookBackPeriod = default(string), int? instanceFlexibilityRatio = default(int?), string instanceFlexibilityGroup = default(string), string normalizedSize = default(string), double? recommendedQuantityNormalized = default(double?), System.Guid? meterId = default(System.Guid?), string term = default(string), decimal? costWithNoReservedInstances = default(decimal?), decimal? recommendedQuantity = default(decimal?), decimal? totalCostWithReservedInstances = default(decimal?), decimal? netSavings = default(decimal?), System.DateTime? firstUsageDate = default(System.DateTime?), string scope = default(string), IList skuProperties = default(IList)) { Id = id; Name = name; @@ -65,6 +73,10 @@ public ReservationRecommendation() Location = location; Sku = sku; LookBackPeriod = lookBackPeriod; + InstanceFlexibilityRatio = instanceFlexibilityRatio; + InstanceFlexibilityGroup = instanceFlexibilityGroup; + NormalizedSize = normalizedSize; + RecommendedQuantityNormalized = recommendedQuantityNormalized; MeterId = meterId; Term = term; CostWithNoReservedInstances = costWithNoReservedInstances; @@ -73,6 +85,7 @@ public ReservationRecommendation() NetSavings = netSavings; FirstUsageDate = firstUsageDate; Scope = scope; + SkuProperties = skuProperties; CustomInit(); } @@ -123,6 +136,30 @@ public ReservationRecommendation() [JsonProperty(PropertyName = "properties.lookBackPeriod")] public string LookBackPeriod { get; private set; } + /// + /// Gets the instance Flexibility Ratio. + /// + [JsonProperty(PropertyName = "properties.instanceFlexibilityRatio")] + public int? InstanceFlexibilityRatio { get; private set; } + + /// + /// Gets the instance Flexibility Group. + /// + [JsonProperty(PropertyName = "properties.instanceFlexibilityGroup")] + public string InstanceFlexibilityGroup { get; private set; } + + /// + /// Gets the normalized Size. + /// + [JsonProperty(PropertyName = "properties.normalizedSize")] + public string NormalizedSize { get; private set; } + + /// + /// Gets the recommended Quantity Normalized. + /// + [JsonProperty(PropertyName = "properties.recommendedQuantityNormalized")] + public double? RecommendedQuantityNormalized { get; private set; } + /// /// Gets the meter id (GUID) /// @@ -171,5 +208,11 @@ public ReservationRecommendation() [JsonProperty(PropertyName = "properties.scope")] public string Scope { get; private set; } + /// + /// Gets list of sku properties + /// + [JsonProperty(PropertyName = "properties.skuProperties")] + public IList SkuProperties { get; private set; } + } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationSummary.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationSummary.cs index d38076dcb31b..d5fca5fbba3a 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationSummary.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationSummary.cs @@ -69,7 +69,18 @@ public ReservationSummary() /// utilization in the usage time (day or month). E.g. if usage record /// corresponds to 12/10/2017 and on that for hour 4 and 5, utilization /// was 100%, this field will return 100% for that day. - public ReservationSummary(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string reservationOrderId = default(string), string reservationId = default(string), string skuName = default(string), decimal? reservedHours = default(decimal?), System.DateTime? usageDate = default(System.DateTime?), decimal? usedHours = default(decimal?), decimal? minUtilizationPercentage = default(decimal?), decimal? avgUtilizationPercentage = default(decimal?), decimal? maxUtilizationPercentage = default(decimal?)) + /// The reservation kind. + /// This is the purchased quantity for + /// the reservationId. + /// This is the remaining quantity for + /// the reservationId. + /// This is the total count of + /// instances that are reserved for the reservationId. + /// This is the used quantity for the + /// reservationId. + /// This is the utilized percentage + /// for the reservation Id. + public ReservationSummary(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string reservationOrderId = default(string), string reservationId = default(string), string skuName = default(string), decimal? reservedHours = default(decimal?), System.DateTime? usageDate = default(System.DateTime?), decimal? usedHours = default(decimal?), decimal? minUtilizationPercentage = default(decimal?), decimal? avgUtilizationPercentage = default(decimal?), decimal? maxUtilizationPercentage = default(decimal?), string kind = default(string), decimal? purchasedQuantity = default(decimal?), decimal? remainingQuantity = default(decimal?), decimal? totalReservedQuantity = default(decimal?), decimal? usedQuantity = default(decimal?), decimal? utilizedPercentage = default(decimal?)) : base(id, name, type, tags) { ReservationOrderId = reservationOrderId; @@ -81,6 +92,12 @@ public ReservationSummary() MinUtilizationPercentage = minUtilizationPercentage; AvgUtilizationPercentage = avgUtilizationPercentage; MaxUtilizationPercentage = maxUtilizationPercentage; + Kind = kind; + PurchasedQuantity = purchasedQuantity; + RemainingQuantity = remainingQuantity; + TotalReservedQuantity = totalReservedQuantity; + UsedQuantity = usedQuantity; + UtilizedPercentage = utilizedPercentage; CustomInit(); } @@ -161,5 +178,42 @@ public ReservationSummary() [JsonProperty(PropertyName = "properties.maxUtilizationPercentage")] public decimal? MaxUtilizationPercentage { get; private set; } + /// + /// Gets the reservation kind. + /// + [JsonProperty(PropertyName = "properties.kind")] + public string Kind { get; private set; } + + /// + /// Gets this is the purchased quantity for the reservationId. + /// + [JsonProperty(PropertyName = "properties.purchasedQuantity")] + public decimal? PurchasedQuantity { get; private set; } + + /// + /// Gets this is the remaining quantity for the reservationId. + /// + [JsonProperty(PropertyName = "properties.remainingQuantity")] + public decimal? RemainingQuantity { get; private set; } + + /// + /// Gets this is the total count of instances that are reserved for the + /// reservationId. + /// + [JsonProperty(PropertyName = "properties.totalReservedQuantity")] + public decimal? TotalReservedQuantity { get; private set; } + + /// + /// Gets this is the used quantity for the reservationId. + /// + [JsonProperty(PropertyName = "properties.usedQuantity")] + public decimal? UsedQuantity { get; private set; } + + /// + /// Gets this is the utilized percentage for the reservation Id. + /// + [JsonProperty(PropertyName = "properties.utilizedPercentage")] + public decimal? UtilizedPercentage { get; private set; } + } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationTransaction.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationTransaction.cs new file mode 100644 index 000000000000..f742124ac9fb --- /dev/null +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/ReservationTransaction.cs @@ -0,0 +1,228 @@ +// +// 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.Consumption.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Reservation transaction resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class ReservationTransaction : Resource + { + /// + /// Initializes a new instance of the ReservationTransaction class. + /// + public ReservationTransaction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReservationTransaction class. + /// + /// Resource Id. + /// Resource name. + /// Resource type. + /// Resource tags. + /// The date of the transaction + /// The reservation order ID is the + /// identifier for a reservation purchase. Each reservation order ID + /// represents a single purchase transaction. A reservation order + /// contains reservations. The reservation order specifies the VM size + /// and region for the reservations. + /// The description of the + /// transaction. + /// The type of the transaction (Purchase, + /// Cancel, etc.) + /// The quantity of the transaction. + /// The charge of the transaction. + /// The ISO currency in which the transaction is + /// charged, for example, USD. + /// The name of the reservation + /// order. + /// The purchasing + /// enrollment. + /// The subscription guid that + /// makes the transaction. + /// The subscription name that + /// makes the transaction. + /// This is the ARM Sku name. It can be used + /// to join with the serviceType field in additional info in usage + /// records. + /// This is the term of the transaction. + /// The region of the transaction. + /// The name of the account that makes the + /// transaction. + /// The email of the account owner that + /// makes the transaction. + /// The department name. + /// The cost center of this department if it + /// is a department and a cost center is provided. + /// The current enrollment. + public ReservationTransaction(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), System.DateTime? eventDate = default(System.DateTime?), string reservationOrderId = default(string), string description = default(string), string eventType = default(string), decimal? quantity = default(decimal?), decimal? amount = default(decimal?), string currency = default(string), string reservationOrderName = default(string), string purchasingEnrollment = default(string), System.Guid? purchasingSubscriptionGuid = default(System.Guid?), string purchasingSubscriptionName = default(string), string armSkuName = default(string), string term = default(string), string region = default(string), string accountName = default(string), string accountOwnerEmail = default(string), string departmentName = default(string), string costCenter = default(string), string currentEnrollment = default(string)) + : base(id, name, type, tags) + { + EventDate = eventDate; + ReservationOrderId = reservationOrderId; + Description = description; + EventType = eventType; + Quantity = quantity; + Amount = amount; + Currency = currency; + ReservationOrderName = reservationOrderName; + PurchasingEnrollment = purchasingEnrollment; + PurchasingSubscriptionGuid = purchasingSubscriptionGuid; + PurchasingSubscriptionName = purchasingSubscriptionName; + ArmSkuName = armSkuName; + Term = term; + Region = region; + AccountName = accountName; + AccountOwnerEmail = accountOwnerEmail; + DepartmentName = departmentName; + CostCenter = costCenter; + CurrentEnrollment = currentEnrollment; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the date of the transaction + /// + [JsonProperty(PropertyName = "properties.eventDate")] + public System.DateTime? EventDate { get; private set; } + + /// + /// Gets the reservation order ID is the identifier for a reservation + /// purchase. Each reservation order ID represents a single purchase + /// transaction. A reservation order contains reservations. The + /// reservation order specifies the VM size and region for the + /// reservations. + /// + [JsonProperty(PropertyName = "properties.reservationOrderId")] + public string ReservationOrderId { get; private set; } + + /// + /// Gets the description of the transaction. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; private set; } + + /// + /// Gets the type of the transaction (Purchase, Cancel, etc.) + /// + [JsonProperty(PropertyName = "properties.eventType")] + public string EventType { get; private set; } + + /// + /// Gets the quantity of the transaction. + /// + [JsonProperty(PropertyName = "properties.quantity")] + public decimal? Quantity { get; private set; } + + /// + /// Gets the charge of the transaction. + /// + [JsonProperty(PropertyName = "properties.amount")] + public decimal? Amount { get; private set; } + + /// + /// Gets the ISO currency in which the transaction is charged, for + /// example, USD. + /// + [JsonProperty(PropertyName = "properties.currency")] + public string Currency { get; private set; } + + /// + /// Gets the name of the reservation order. + /// + [JsonProperty(PropertyName = "properties.reservationOrderName")] + public string ReservationOrderName { get; private set; } + + /// + /// Gets the purchasing enrollment. + /// + [JsonProperty(PropertyName = "properties.purchasingEnrollment")] + public string PurchasingEnrollment { get; private set; } + + /// + /// Gets the subscription guid that makes the transaction. + /// + [JsonProperty(PropertyName = "properties.purchasingSubscriptionGuid")] + public System.Guid? PurchasingSubscriptionGuid { get; private set; } + + /// + /// Gets the subscription name that makes the transaction. + /// + [JsonProperty(PropertyName = "properties.purchasingSubscriptionName")] + public string PurchasingSubscriptionName { get; private set; } + + /// + /// Gets this is the ARM Sku name. It can be used to join with the + /// serviceType field in additional info in usage records. + /// + [JsonProperty(PropertyName = "properties.armSkuName")] + public string ArmSkuName { get; private set; } + + /// + /// Gets this is the term of the transaction. + /// + [JsonProperty(PropertyName = "properties.term")] + public string Term { get; private set; } + + /// + /// Gets the region of the transaction. + /// + [JsonProperty(PropertyName = "properties.region")] + public string Region { get; private set; } + + /// + /// Gets the name of the account that makes the transaction. + /// + [JsonProperty(PropertyName = "properties.accountName")] + public string AccountName { get; private set; } + + /// + /// Gets the email of the account owner that makes the transaction. + /// + [JsonProperty(PropertyName = "properties.accountOwnerEmail")] + public string AccountOwnerEmail { get; private set; } + + /// + /// Gets the department name. + /// + [JsonProperty(PropertyName = "properties.departmentName")] + public string DepartmentName { get; private set; } + + /// + /// Gets the cost center of this department if it is a department and a + /// cost center is provided. + /// + [JsonProperty(PropertyName = "properties.costCenter")] + public string CostCenter { get; private set; } + + /// + /// Gets the current enrollment. + /// + [JsonProperty(PropertyName = "properties.currentEnrollment")] + public string CurrentEnrollment { get; private set; } + + } +} diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/SkuProperty.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/SkuProperty.cs new file mode 100644 index 000000000000..f2f332a69b9b --- /dev/null +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/SkuProperty.cs @@ -0,0 +1,59 @@ +// +// 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.Consumption.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Sku property + /// + public partial class SkuProperty + { + /// + /// Initializes a new instance of the SkuProperty class. + /// + public SkuProperty() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuProperty class. + /// + /// The name of sku property. + /// The value of sku property. + public SkuProperty(string name = default(string), string value = default(string)) + { + Name = name; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the name of sku property. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the value of sku property. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; private set; } + + } +} diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/TimeGrainType.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/TimeGrainType.cs index 6e0a7feed11d..2b02f5b45443 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/TimeGrainType.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/TimeGrainType.cs @@ -19,5 +19,8 @@ public static class TimeGrainType public const string Monthly = "Monthly"; public const string Quarterly = "Quarterly"; public const string Annually = "Annually"; + public const string BillingMonth = "BillingMonth"; + public const string BillingQuarter = "BillingQuarter"; + public const string BillingAnnual = "BillingAnnual"; } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetail.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetail.cs index 8ff10325964c..9f0ec50a2293 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetail.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetail.cs @@ -64,7 +64,7 @@ public UsageDetail() /// The details about the meter. By default /// this is not populated, unless it's specified in $expand. /// The usage quantity. - /// Effective Price that’s charged for the + /// Effective Price that's charged for the /// usage. /// The amount of cost before tax. /// Unit Price is the price applicable to you. @@ -271,7 +271,7 @@ public UsageDetail() public decimal? Quantity { get; private set; } /// - /// Gets effective Price that’s charged for the usage. + /// Gets effective Price that's charged for the usage. /// [JsonProperty(PropertyName = "properties.effectivePrice")] public decimal? EffectivePrice { get; private set; } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetailsDownloadHeaders.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetailsDownloadHeaders.cs deleted file mode 100644 index 26cf1f9a2de3..000000000000 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetailsDownloadHeaders.cs +++ /dev/null @@ -1,77 +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.Consumption.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines headers for Download operation. - /// - public partial class UsageDetailsDownloadHeaders - { - /// - /// Initializes a new instance of the UsageDetailsDownloadHeaders - /// class. - /// - public UsageDetailsDownloadHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UsageDetailsDownloadHeaders - /// 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. - /// To get the progress of the - /// operation, call GET operation on the URL in Azure-AsyncOperation - /// header field. - public UsageDetailsDownloadHeaders(string location = default(string), string retryAfter = default(string), string azureAsyncOperation = default(string)) - { - Location = location; - RetryAfter = retryAfter; - AzureAsyncOperation = azureAsyncOperation; - 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 to get the progress of the operation, call GET - /// operation on the URL in Azure-AsyncOperation header field. - /// - [JsonProperty(PropertyName = "Azure-AsyncOperation")] - public string AzureAsyncOperation { get; set; } - - } -} diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetailsDownloadResponse.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetailsDownloadResponse.cs deleted file mode 100644 index 6eda8d43d49c..000000000000 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/Models/UsageDetailsDownloadResponse.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.Consumption.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Download response of Usage Details. - /// - [Rest.Serialization.JsonTransformation] - public partial class UsageDetailsDownloadResponse : Resource - { - /// - /// Initializes a new instance of the UsageDetailsDownloadResponse - /// class. - /// - public UsageDetailsDownloadResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UsageDetailsDownloadResponse - /// class. - /// - /// Resource Id. - /// Resource name. - /// Resource type. - /// Resource tags. - /// The URL to the csv file. - /// The time in UTC at which this download URL - /// will expire. - public UsageDetailsDownloadResponse(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string downloadUrlProperty = default(string), string validTill = default(string)) - : base(id, name, type, tags) - { - DownloadUrlProperty = downloadUrlProperty; - ValidTill = validTill; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the URL to the csv file. - /// - [JsonProperty(PropertyName = "properties.downloadUrl")] - public string DownloadUrlProperty { get; private set; } - - /// - /// Gets the time in UTC at which this download URL will expire. - /// - [JsonProperty(PropertyName = "properties.validTill")] - public string ValidTill { get; private set; } - - } -} diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationRecommendationsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationRecommendationsOperations.cs index b0c3ab64809a..8d7e5a2a5090 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationRecommendationsOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationRecommendationsOperations.cs @@ -233,6 +233,194 @@ internal ReservationRecommendationsOperations(ConsumptionManagementClient client return _result; } + /// + /// List of recommendations for purchasing reserved instances on billing + /// account scope + /// + /// + /// + /// BillingAccount ID + /// + /// + /// May be used to filter reservationRecommendations by properties/scope and + /// properties/lookBackPeriod. + /// + /// + /// 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>> ListByBillingAccountIdWithHttpMessagesAsync(string billingAccountId, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("filter", filter); + tracingParameters.Add("billingAccountId", billingAccountId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountId", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/microsoft.consumption/ReservationRecommendations").ToString(); + _url = _url.Replace("{billingAccountId}", System.Uri.EscapeDataString(billingAccountId)); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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; + } + /// /// List of recommendations for purchasing reserved instances. /// @@ -306,6 +494,176 @@ internal ReservationRecommendationsOperations(ConsumptionManagementClient 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; + } + + /// + /// List of recommendations for purchasing reserved instances on billing + /// account scope + /// + /// + /// + /// 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>> ListByBillingAccountIdNextWithHttpMessagesAsync(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, "ListByBillingAccountIdNext", 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/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationRecommendationsOperationsExtensions.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationRecommendationsOperationsExtensions.cs index 5358163308b1..64798a5338f5 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationRecommendationsOperationsExtensions.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationRecommendationsOperationsExtensions.cs @@ -59,6 +59,52 @@ public static partial class ReservationRecommendationsOperationsExtensions } } + /// + /// List of recommendations for purchasing reserved instances on billing + /// account scope + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// BillingAccount ID + /// + /// + /// May be used to filter reservationRecommendations by properties/scope and + /// properties/lookBackPeriod. + /// + public static IPage ListByBillingAccountId(this IReservationRecommendationsOperations operations, string billingAccountId, string filter = default(string)) + { + return operations.ListByBillingAccountIdAsync(billingAccountId, filter).GetAwaiter().GetResult(); + } + + /// + /// List of recommendations for purchasing reserved instances on billing + /// account scope + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// BillingAccount ID + /// + /// + /// May be used to filter reservationRecommendations by properties/scope and + /// properties/lookBackPeriod. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountIdAsync(this IReservationRecommendationsOperations operations, string billingAccountId, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountIdWithHttpMessagesAsync(billingAccountId, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// List of recommendations for purchasing reserved instances. /// @@ -95,5 +141,43 @@ public static IPage ListNext(this IReservationRecomme } } + /// + /// List of recommendations for purchasing reserved instances on billing + /// account scope + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountIdNext(this IReservationRecommendationsOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountIdNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List of recommendations for purchasing reserved instances on billing + /// account scope + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountIdNextAsync(this IReservationRecommendationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountIdNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperations.cs new file mode 100644 index 000000000000..3c27b69bd293 --- /dev/null +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperations.cs @@ -0,0 +1,410 @@ +// +// 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.Consumption +{ + 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; + + /// + /// ReservationTransactionsOperations operations. + /// + internal partial class ReservationTransactionsOperations : IServiceOperations, IReservationTransactionsOperations + { + /// + /// Initializes a new instance of the ReservationTransactionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ReservationTransactionsOperations(ConsumptionManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ConsumptionManagementClient + /// + public ConsumptionManagementClient Client { get; private set; } + + /// + /// List of transactions for reserved instances on billing account scope + /// + /// + /// + /// BillingAccount ID + /// + /// + /// Filter reservation transactions by date range. The properties/UsageDate for + /// start date and end date. The filter supports 'le' and 'ge' + /// + /// + /// 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>> ListByBillingAccountIdWithHttpMessagesAsync(string billingAccountId, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (billingAccountId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("filter", filter); + tracingParameters.Add("billingAccountId", billingAccountId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountId", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.consumption/reservationTransactions").ToString(); + _url = _url.Replace("{billingAccountId}", System.Uri.EscapeDataString(billingAccountId)); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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; + } + + /// + /// List of transactions for reserved instances on billing account scope + /// + /// + /// + /// 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>> ListByBillingAccountIdNextWithHttpMessagesAsync(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, "ListByBillingAccountIdNext", 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/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperationsExtensions.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperationsExtensions.cs new file mode 100644 index 000000000000..79f3961e283f --- /dev/null +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperationsExtensions.cs @@ -0,0 +1,105 @@ +// +// 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.Consumption +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ReservationTransactionsOperations. + /// + public static partial class ReservationTransactionsOperationsExtensions + { + /// + /// List of transactions for reserved instances on billing account scope + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// BillingAccount ID + /// + /// + /// Filter reservation transactions by date range. The properties/UsageDate for + /// start date and end date. The filter supports 'le' and 'ge' + /// + public static IPage ListByBillingAccountId(this IReservationTransactionsOperations operations, string billingAccountId, string filter = default(string)) + { + return operations.ListByBillingAccountIdAsync(billingAccountId, filter).GetAwaiter().GetResult(); + } + + /// + /// List of transactions for reserved instances on billing account scope + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// BillingAccount ID + /// + /// + /// Filter reservation transactions by date range. The properties/UsageDate for + /// start date and end date. The filter supports 'le' and 'ge' + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountIdAsync(this IReservationTransactionsOperations operations, string billingAccountId, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountIdWithHttpMessagesAsync(billingAccountId, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List of transactions for reserved instances on billing account scope + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountIdNext(this IReservationTransactionsOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountIdNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List of transactions for reserved instances on billing account scope + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountIdNextAsync(this IReservationTransactionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountIdNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsDetailsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsDetailsOperations.cs index b94241f33af7..35e49e4e6a41 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsDetailsOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsDetailsOperations.cs @@ -441,6 +441,197 @@ internal ReservationsDetailsOperations(ConsumptionManagementClient client) return _result; } + /// + /// Lists the reservations details for provided date range. + /// + /// + /// + /// BillingAccount ID + /// + /// + /// Filter reservation details by date range. The properties/UsageDate for + /// start date and end date. The filter supports 'le' and 'ge' + /// + /// + /// 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>> ListByBillingAccountIdWithHttpMessagesAsync(string billingAccountId, string filter, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (billingAccountId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountId"); + } + if (filter == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "filter"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountId", billingAccountId); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountId", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationDetails").ToString(); + _url = _url.Replace("{billingAccountId}", System.Uri.EscapeDataString(billingAccountId)); + List _queryParameters = new List(); + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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; + } + /// /// Lists the reservations details for provided date range. /// @@ -683,6 +874,175 @@ internal ReservationsDetailsOperations(ConsumptionManagementClient 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 reservations details for provided date range. + /// + /// + /// + /// 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>> ListByBillingAccountIdNextWithHttpMessagesAsync(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, "ListByBillingAccountIdNext", 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/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsDetailsOperationsExtensions.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsDetailsOperationsExtensions.cs index 0d08b82a9067..1fd19827086b 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsDetailsOperationsExtensions.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsDetailsOperationsExtensions.cs @@ -115,6 +115,50 @@ public static IPage ListByReservationOrderAndReservation(this } } + /// + /// Lists the reservations details for provided date range. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// BillingAccount ID + /// + /// + /// Filter reservation details by date range. The properties/UsageDate for + /// start date and end date. The filter supports 'le' and 'ge' + /// + public static IPage ListByBillingAccountId(this IReservationsDetailsOperations operations, string billingAccountId, string filter) + { + return operations.ListByBillingAccountIdAsync(billingAccountId, filter).GetAwaiter().GetResult(); + } + + /// + /// Lists the reservations details for provided date range. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// BillingAccount ID + /// + /// + /// Filter reservation details by date range. The properties/UsageDate for + /// start date and end date. The filter supports 'le' and 'ge' + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountIdAsync(this IReservationsDetailsOperations operations, string billingAccountId, string filter, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountIdWithHttpMessagesAsync(billingAccountId, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists the reservations details for provided date range. /// @@ -187,5 +231,41 @@ public static IPage ListByReservationOrderAndReservationNext( } } + /// + /// Lists the reservations details for provided date range. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountIdNext(this IReservationsDetailsOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountIdNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the reservations details for provided date range. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountIdNextAsync(this IReservationsDetailsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountIdNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsSummariesOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsSummariesOperations.cs index 67051f50e750..199ce0636461 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsSummariesOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsSummariesOperations.cs @@ -459,6 +459,206 @@ internal ReservationsSummariesOperations(ConsumptionManagementClient client) return _result; } + /// + /// Lists the reservations summaries for daily or monthly grain. + /// + /// + /// + /// BillingAccount ID + /// + /// + /// Can be daily or monthly. Possible values include: 'DailyGrain', + /// 'MonthlyGrain' + /// + /// + /// Required only for daily grain. The properties/UsageDate for start date and + /// end date. The filter supports 'le' and 'ge' + /// + /// + /// 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>> ListByBillingAccountIdWithHttpMessagesAsync(string billingAccountId, string grain, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (billingAccountId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "billingAccountId"); + } + if (grain == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "grain"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("billingAccountId", billingAccountId); + tracingParameters.Add("grain", grain); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByBillingAccountId", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationSummaries").ToString(); + _url = _url.Replace("{billingAccountId}", System.Uri.EscapeDataString(billingAccountId)); + List _queryParameters = new List(); + if (grain != null) + { + _queryParameters.Add(string.Format("grain={0}", System.Uri.EscapeDataString(grain))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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; + } + /// /// Lists the reservations summaries for daily or monthly grain. /// @@ -701,6 +901,175 @@ internal ReservationsSummariesOperations(ConsumptionManagementClient 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 reservations summaries for daily or monthly grain. + /// + /// + /// + /// 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>> ListByBillingAccountIdNextWithHttpMessagesAsync(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, "ListByBillingAccountIdNext", 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/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsSummariesOperationsExtensions.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsSummariesOperationsExtensions.cs index a2c21e8d0231..850d91676a2d 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsSummariesOperationsExtensions.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationsSummariesOperationsExtensions.cs @@ -131,6 +131,58 @@ public static partial class ReservationsSummariesOperationsExtensions } } + /// + /// Lists the reservations summaries for daily or monthly grain. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// BillingAccount ID + /// + /// + /// Can be daily or monthly. Possible values include: 'DailyGrain', + /// 'MonthlyGrain' + /// + /// + /// Required only for daily grain. The properties/UsageDate for start date and + /// end date. The filter supports 'le' and 'ge' + /// + public static IPage ListByBillingAccountId(this IReservationsSummariesOperations operations, string billingAccountId, string grain, string filter = default(string)) + { + return operations.ListByBillingAccountIdAsync(billingAccountId, grain, filter).GetAwaiter().GetResult(); + } + + /// + /// Lists the reservations summaries for daily or monthly grain. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// BillingAccount ID + /// + /// + /// Can be daily or monthly. Possible values include: 'DailyGrain', + /// 'MonthlyGrain' + /// + /// + /// Required only for daily grain. The properties/UsageDate for start date and + /// end date. The filter supports 'le' and 'ge' + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountIdAsync(this IReservationsSummariesOperations operations, string billingAccountId, string grain, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountIdWithHttpMessagesAsync(billingAccountId, grain, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists the reservations summaries for daily or monthly grain. /// @@ -203,5 +255,41 @@ public static IPage ListByReservationOrderAndReservationNext } } + /// + /// Lists the reservations summaries for daily or monthly grain. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByBillingAccountIdNext(this IReservationsSummariesOperations operations, string nextPageLink) + { + return operations.ListByBillingAccountIdNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the reservations summaries for daily or monthly grain. + /// + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByBillingAccountIdNextAsync(this IReservationsSummariesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByBillingAccountIdNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/SdkInfo_ConsumptionManagementClient.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/SdkInfo_ConsumptionManagementClient.cs index 2329d9f3ba0c..f25e243c68db 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/SdkInfo_ConsumptionManagementClient.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/SdkInfo_ConsumptionManagementClient.cs @@ -19,20 +19,24 @@ public static IEnumerable> ApiInfo_ConsumptionMana { return new Tuple[] { - new Tuple("Billing", "Balances", "2019-04-01-preview"), - new Tuple("Billing", "PriceSheet", "2019-04-01-preview"), - new Tuple("Capacity", "ReservationsDetails", "2019-04-01-preview"), - new Tuple("Capacity", "ReservationsSummaries", "2019-04-01-preview"), - new Tuple("Consumption", "Budgets", "2019-04-01-preview"), - new Tuple("Consumption", "Charges", "2019-04-01-preview"), - new Tuple("Consumption", "Forecasts", "2019-04-01-preview"), - new Tuple("Consumption", "Marketplaces", "2019-04-01-preview"), - new Tuple("Consumption", "Operations", "2019-04-01-preview"), - new Tuple("Consumption", "PriceSheet", "2019-04-01-preview"), - new Tuple("Consumption", "ReservationRecommendations", "2019-04-01-preview"), - new Tuple("Consumption", "Tags", "2019-04-01-preview"), - new Tuple("Consumption", "UsageDetails", "2019-04-01-preview"), - new Tuple("Management", "AggregatedCost", "2019-04-01-preview"), + new Tuple("Billing", "Balances", "2019-06-01"), + new Tuple("Billing", "PriceSheet", "2019-06-01"), + new Tuple("Billing", "ReservationRecommendations", "2019-06-01"), + new Tuple("Billing", "ReservationTransactions", "2019-06-01"), + new Tuple("Billing", "ReservationsDetails", "2019-06-01"), + new Tuple("Billing", "ReservationsSummaries", "2019-06-01"), + new Tuple("Capacity", "ReservationsDetails", "2019-06-01"), + new Tuple("Capacity", "ReservationsSummaries", "2019-06-01"), + new Tuple("Consumption", "Budgets", "2019-06-01"), + new Tuple("Consumption", "Charges", "2019-06-01"), + new Tuple("Consumption", "Forecasts", "2019-06-01"), + new Tuple("Consumption", "Marketplaces", "2019-06-01"), + new Tuple("Consumption", "Operations", "2019-06-01"), + new Tuple("Consumption", "PriceSheet", "2019-06-01"), + new Tuple("Consumption", "ReservationRecommendations", "2019-06-01"), + new Tuple("Consumption", "Tags", "2019-06-01"), + new Tuple("Consumption", "UsageDetails", "2019-06-01"), + new Tuple("Management", "AggregatedCost", "2019-06-01"), }.AsEnumerable(); } } diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/UsageDetailsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/UsageDetailsOperations.cs index 7bfa4cfdf7ae..bd283139aef6 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/UsageDetailsOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/UsageDetailsOperations.cs @@ -82,10 +82,12 @@ internal UsageDetailsOperations(ConsumptionManagementClient client) /// /// May be used to filter usageDetails by properties/resourceGroup, /// properties/resourceName, properties/resourceId, properties/chargeType, - /// properties/reservationId or tags. 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 (:). + /// properties/reservationId, properties/publisherType or tags. 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 (:). PublisherType Filter accepts two + /// values azure and marketplace and it is currently supported for Web Direct + /// Offer Type /// /// /// Skiptoken is only used if a previous operation returned a partial result. @@ -306,262 +308,6 @@ internal UsageDetailsOperations(ConsumptionManagementClient client) return _result; } - /// - /// Download usage details data. - /// - /// - /// The scope associated with usage details operations. This includes - /// '/subscriptions/{subscriptionId}/' for subscription scope, - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for - /// resourceGroup scope, - /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - /// Billing Account scope, - /// '/providers/Microsoft.Billing/departments/{departmentId}' for Department - /// scope, - /// '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for - /// EnrollmentAccount scope and - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - /// Management Group scope. For subscription, billing account, department, - /// enrollment account and management group, you can also add billing period to - /// the scope using - /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. - /// to specify billing period at department scope use - /// '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - /// - /// - /// Allows to select different type of cost/usage records. Possible values - /// include: 'ActualCostMetricType', 'AmortizedCostMetricType', - /// 'UsageMetricType' - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> DownloadWithHttpMessagesAsync(string scope, string metric = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDownloadWithHttpMessagesAsync(scope, metric, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Download usage details data. - /// - /// - /// The scope associated with usage details operations. This includes - /// '/subscriptions/{subscriptionId}/' for subscription scope, - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for - /// resourceGroup scope, - /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - /// Billing Account scope, - /// '/providers/Microsoft.Billing/departments/{departmentId}' for Department - /// scope, - /// '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for - /// EnrollmentAccount scope and - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - /// Management Group scope. For subscription, billing account, department, - /// enrollment account and management group, you can also add billing period to - /// the scope using - /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. - /// to specify billing period at department scope use - /// '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - /// - /// - /// Allows to select different type of cost/usage records. Possible values - /// include: 'ActualCostMetricType', 'AmortizedCostMetricType', - /// 'UsageMetricType' - /// - /// - /// 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 scope, string metric = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (scope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("scope", scope); - tracingParameters.Add("metric", metric); - 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("/") ? "" : "/")), "{scope}/providers/Microsoft.Consumption/usageDetails/download").ToString(); - _url = _url.Replace("{scope}", scope); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (metric != null) - { - _queryParameters.Add(string.Format("metric={0}", System.Uri.EscapeDataString(metric))); - } - 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 usage details for the defined scope. Usage details are available /// via this API only for May 1, 2014 or later. diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/UsageDetailsOperationsExtensions.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/UsageDetailsOperationsExtensions.cs index e40b96215e9f..5014e3a4f0ff 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/UsageDetailsOperationsExtensions.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/UsageDetailsOperationsExtensions.cs @@ -56,10 +56,12 @@ public static partial class UsageDetailsOperationsExtensions /// /// May be used to filter usageDetails by properties/resourceGroup, /// properties/resourceName, properties/resourceId, properties/chargeType, - /// properties/reservationId or tags. 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 (:). + /// properties/reservationId, properties/publisherType or tags. 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 (:). PublisherType Filter accepts two + /// values azure and marketplace and it is currently supported for Web Direct + /// Offer Type /// /// /// Skiptoken is only used if a previous operation returned a partial result. @@ -116,10 +118,12 @@ public static partial class UsageDetailsOperationsExtensions /// /// May be used to filter usageDetails by properties/resourceGroup, /// properties/resourceName, properties/resourceId, properties/chargeType, - /// properties/reservationId or tags. 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 (:). + /// properties/reservationId, properties/publisherType or tags. 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 (:). PublisherType Filter accepts two + /// values azure and marketplace and it is currently supported for Web Direct + /// Offer Type /// /// /// Skiptoken is only used if a previous operation returned a partial result. @@ -147,158 +151,6 @@ public static partial class UsageDetailsOperationsExtensions } } - /// - /// Download usage details data. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The scope associated with usage details operations. This includes - /// '/subscriptions/{subscriptionId}/' for subscription scope, - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for - /// resourceGroup scope, - /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - /// Billing Account scope, - /// '/providers/Microsoft.Billing/departments/{departmentId}' for Department - /// scope, - /// '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for - /// EnrollmentAccount scope and - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - /// Management Group scope. For subscription, billing account, department, - /// enrollment account and management group, you can also add billing period to - /// the scope using - /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. - /// to specify billing period at department scope use - /// '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - /// - /// - /// Allows to select different type of cost/usage records. Possible values - /// include: 'ActualCostMetricType', 'AmortizedCostMetricType', - /// 'UsageMetricType' - /// - public static UsageDetailsDownloadResponse Download(this IUsageDetailsOperations operations, string scope, string metric = default(string)) - { - return operations.DownloadAsync(scope, metric).GetAwaiter().GetResult(); - } - - /// - /// Download usage details data. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The scope associated with usage details operations. This includes - /// '/subscriptions/{subscriptionId}/' for subscription scope, - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for - /// resourceGroup scope, - /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - /// Billing Account scope, - /// '/providers/Microsoft.Billing/departments/{departmentId}' for Department - /// scope, - /// '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for - /// EnrollmentAccount scope and - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - /// Management Group scope. For subscription, billing account, department, - /// enrollment account and management group, you can also add billing period to - /// the scope using - /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. - /// to specify billing period at department scope use - /// '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - /// - /// - /// Allows to select different type of cost/usage records. Possible values - /// include: 'ActualCostMetricType', 'AmortizedCostMetricType', - /// 'UsageMetricType' - /// - /// - /// The cancellation token. - /// - public static async Task DownloadAsync(this IUsageDetailsOperations operations, string scope, string metric = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DownloadWithHttpMessagesAsync(scope, metric, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Download usage details data. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The scope associated with usage details operations. This includes - /// '/subscriptions/{subscriptionId}/' for subscription scope, - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for - /// resourceGroup scope, - /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - /// Billing Account scope, - /// '/providers/Microsoft.Billing/departments/{departmentId}' for Department - /// scope, - /// '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for - /// EnrollmentAccount scope and - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - /// Management Group scope. For subscription, billing account, department, - /// enrollment account and management group, you can also add billing period to - /// the scope using - /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. - /// to specify billing period at department scope use - /// '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - /// - /// - /// Allows to select different type of cost/usage records. Possible values - /// include: 'ActualCostMetricType', 'AmortizedCostMetricType', - /// 'UsageMetricType' - /// - public static UsageDetailsDownloadResponse BeginDownload(this IUsageDetailsOperations operations, string scope, string metric = default(string)) - { - return operations.BeginDownloadAsync(scope, metric).GetAwaiter().GetResult(); - } - - /// - /// Download usage details data. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The scope associated with usage details operations. This includes - /// '/subscriptions/{subscriptionId}/' for subscription scope, - /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for - /// resourceGroup scope, - /// '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for - /// Billing Account scope, - /// '/providers/Microsoft.Billing/departments/{departmentId}' for Department - /// scope, - /// '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for - /// EnrollmentAccount scope and - /// '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - /// Management Group scope. For subscription, billing account, department, - /// enrollment account and management group, you can also add billing period to - /// the scope using - /// '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. - /// to specify billing period at department scope use - /// '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}' - /// - /// - /// Allows to select different type of cost/usage records. Possible values - /// include: 'ActualCostMetricType', 'AmortizedCostMetricType', - /// 'UsageMetricType' - /// - /// - /// The cancellation token. - /// - public static async Task BeginDownloadAsync(this IUsageDetailsOperations operations, string scope, string metric = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginDownloadWithHttpMessagesAsync(scope, metric, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Lists the usage details for the defined scope. Usage details are available /// via this API only for May 1, 2014 or later. From 3fa1f0f6d98939afa5998ceb38fce4613a677bdd Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2019 05:01:29 +0000 Subject: [PATCH 22/23] Generated from 8cb028d8acfe861317992cff12232d4bbfc3a795 (#241) chore: jsonfmt consumption --- .../src/Generated/ReservationTransactionsOperations.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperations.cs b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperations.cs index 3c27b69bd293..b7195851b706 100644 --- a/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperations.cs +++ b/sdk/consumption/Microsoft.Azure.Management.Consumption/src/Generated/ReservationTransactionsOperations.cs @@ -106,7 +106,7 @@ internal ReservationTransactionsOperations(ConsumptionManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.consumption/reservationTransactions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions").ToString(); _url = _url.Replace("{billingAccountId}", System.Uri.EscapeDataString(billingAccountId)); List _queryParameters = new List(); if (filter != null) From c73d79744500e801ede057d60bf40ca9bdcc1604 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 26 Sep 2019 06:05:16 +0000 Subject: [PATCH 23/23] Generated from 0fdafe5376ca9140f2dd7e6552b51eb7e5c9aafc Peering: update java readme --- .../Generated/ILegacyPeeringsOperations.cs | 4 ++ .../src/Generated/IOperations.cs | 4 ++ .../src/Generated/IPeerAsnsOperations.cs | 4 ++ .../Generated/IPeeringLocationsOperations.cs | 4 ++ .../src/Generated/IPeeringManagementClient.cs | 16 +++++--- .../IPeeringServiceLocationsOperations.cs | 4 ++ .../IPeeringServicePrefixesOperations.cs | 4 ++ .../IPeeringServiceProvidersOperations.cs | 4 ++ .../Generated/IPeeringServicesOperations.cs | 8 +++- .../src/Generated/IPeeringsOperations.cs | 8 +++- .../src/Generated/IPrefixesOperations.cs | 4 ++ .../src/Generated/LegacyPeeringsOperations.cs | 4 ++ .../LegacyPeeringsOperationsExtensions.cs | 4 ++ .../src/Generated/Models/BgpSession.cs | 4 ++ .../CheckServiceProviderAvailabilityInput.cs | 4 ++ .../src/Generated/Models/ConnectionState.cs | 4 ++ .../src/Generated/Models/ContactInfo.cs | 4 ++ .../src/Generated/Models/DirectConnection.cs | 4 ++ .../Generated/Models/DirectPeeringFacility.cs | 4 ++ .../src/Generated/Models/DirectPeeringType.cs | 4 ++ .../src/Generated/Models/ErrorResponse.cs | 4 ++ .../Models/ErrorResponseException.cs | 4 ++ .../Generated/Models/ExchangeConnection.cs | 4 ++ .../Models/ExchangePeeringFacility.cs | 4 ++ .../src/Generated/Models/Family.cs | 4 ++ .../src/Generated/Models/Kind.cs | 4 ++ .../src/Generated/Models/LearnedType.cs | 4 ++ .../src/Generated/Models/Name.cs | 4 ++ .../src/Generated/Models/Operation.cs | 4 ++ .../Generated/Models/OperationDisplayInfo.cs | 4 ++ .../src/Generated/Models/Page.cs | 4 ++ .../src/Generated/Models/PeerAsn.cs | 4 ++ .../Generated/Models/PeeringBandwidthOffer.cs | 4 ++ .../src/Generated/Models/PeeringLocation.cs | 4 ++ .../Models/PeeringLocationPropertiesDirect.cs | 4 ++ .../PeeringLocationPropertiesExchange.cs | 4 ++ .../src/Generated/Models/PeeringModel.cs | 4 ++ .../Models/PeeringPropertiesDirect.cs | 4 ++ .../Models/PeeringPropertiesExchange.cs | 4 ++ .../src/Generated/Models/PeeringService.cs | 4 ++ .../Models/PeeringServiceLocation.cs | 4 ++ .../Generated/Models/PeeringServicePrefix.cs | 4 ++ .../Models/PeeringServiceProvider.cs | 4 ++ .../src/Generated/Models/PeeringSku.cs | 4 ++ .../Generated/Models/PrefixValidationState.cs | 4 ++ .../src/Generated/Models/ProvisioningState.cs | 4 ++ .../src/Generated/Models/Resource.cs | 4 ++ .../src/Generated/Models/ResourceTags.cs | 4 ++ .../Models/SessionAddressProvider.cs | 4 ++ .../src/Generated/Models/SessionStateV4.cs | 4 ++ .../src/Generated/Models/SessionStateV6.cs | 4 ++ .../src/Generated/Models/Size.cs | 4 ++ .../src/Generated/Models/SubResource.cs | 4 ++ .../src/Generated/Models/Tier.cs | 4 ++ .../src/Generated/Models/ValidationState.cs | 4 ++ .../src/Generated/Operations.cs | 4 ++ .../src/Generated/OperationsExtensions.cs | 4 ++ .../src/Generated/PeerAsnsOperations.cs | 4 ++ .../Generated/PeerAsnsOperationsExtensions.cs | 4 ++ .../Generated/PeeringLocationsOperations.cs | 4 ++ .../PeeringLocationsOperationsExtensions.cs | 4 ++ .../src/Generated/PeeringManagementClient.cs | 26 ++++++++----- .../PeeringManagementClientExtensions.cs | 28 +++++++++----- .../PeeringServiceLocationsOperations.cs | 4 ++ ...ingServiceLocationsOperationsExtensions.cs | 4 ++ .../PeeringServicePrefixesOperations.cs | 4 ++ ...ringServicePrefixesOperationsExtensions.cs | 4 ++ .../PeeringServiceProvidersOperations.cs | 4 ++ ...ingServiceProvidersOperationsExtensions.cs | 4 ++ .../Generated/PeeringServicesOperations.cs | 23 +++++++----- .../PeeringServicesOperationsExtensions.cs | 14 +++++-- .../src/Generated/PeeringsOperations.cs | 23 +++++++----- .../Generated/PeeringsOperationsExtensions.cs | 14 +++++-- .../src/Generated/PrefixesOperations.cs | 4 ++ .../Generated/PrefixesOperationsExtensions.cs | 4 ++ .../SdkInfo_PeeringManagementClient.cs | 37 +++++++++++++++++++ 76 files changed, 407 insertions(+), 54 deletions(-) create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/ILegacyPeeringsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/ILegacyPeeringsOperations.cs index f95591b8d989..32ba98539261 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/ILegacyPeeringsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/ILegacyPeeringsOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IOperations.cs index 24d846de18d7..3b50883f2ef7 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeerAsnsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeerAsnsOperations.cs index c2d8a945cae2..b1ac930e2c48 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeerAsnsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeerAsnsOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringLocationsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringLocationsOperations.cs index e8f5895d4930..6ffabfd9df99 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringLocationsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringLocationsOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringManagementClient.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringManagementClient.cs index 3c13cf4563bf..80274c97bc23 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringManagementClient.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringManagementClient.cs @@ -1,4 +1,8 @@ // +// 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. @@ -16,7 +20,7 @@ namespace Microsoft.Azure.Management.Peering using System.Threading.Tasks; /// - /// APIs to manage Peering resources through the Azure Resource Manager. + /// Peering Client /// public partial interface IPeeringManagementClient : System.IDisposable { @@ -123,9 +127,11 @@ public partial interface IPeeringManagementClient : System.IDisposable /// Checks if the peering service provider is present within 1000 miles /// of customer's location /// - /// - /// The CheckServiceProviderAvailabilityInput - /// indicating customer location and service provider. + /// + /// Gets or sets the PeeringServiceLocation + /// + /// + /// Gets or sets the PeeringServiceProvider /// /// /// The headers that will be added to request. @@ -133,7 +139,7 @@ public partial interface IPeeringManagementClient : System.IDisposable /// /// The cancellation token. /// - Task> CheckServiceProviderAvailabilityWithHttpMessagesAsync(CheckServiceProviderAvailabilityInput checkServiceProviderAvailabilityInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CheckServiceProviderAvailabilityWithHttpMessagesAsync(string peeringServiceLocation = default(string), string peeringServiceProvider = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceLocationsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceLocationsOperations.cs index 2077c3ff18ce..4542b3a6e069 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceLocationsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceLocationsOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServicePrefixesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServicePrefixesOperations.cs index e0bb14322943..616ef6ce2c7e 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServicePrefixesOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServicePrefixesOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceProvidersOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceProvidersOperations.cs index 9bc4e4b0cdbe..6f7e5fa560af 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceProvidersOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceProvidersOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServicesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServicesOperations.cs index e3bd51690a9a..9decb2909c55 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServicesOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServicesOperations.cs @@ -1,4 +1,8 @@ // +// 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. @@ -108,7 +112,7 @@ public partial interface IPeeringServicesOperations /// The name of the peering service. /// /// - /// The resource tags. + /// Gets or sets the tags, a dictionary of descriptors arm object /// /// /// The headers that will be added to request. @@ -125,7 +129,7 @@ public partial interface IPeeringServicesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string peeringServiceName, ResourceTags tags, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string peeringServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the peering services under the given subscription and /// resource group. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringsOperations.cs index 40fb8db251aa..6c0cbd197e7e 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringsOperations.cs @@ -1,4 +1,8 @@ // +// 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. @@ -108,7 +112,7 @@ public partial interface IPeeringsOperations /// The name of the peering. /// /// - /// The resource tags. + /// Gets or sets the tags, a dictionary of descriptors arm object /// /// /// The headers that will be added to request. @@ -125,7 +129,7 @@ public partial interface IPeeringsOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string peeringName, ResourceTags tags, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string peeringName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the peerings under the given subscription and resource /// group. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPrefixesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPrefixesOperations.cs index 34927dc72ef9..63d0f3650045 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPrefixesOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPrefixesOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperations.cs index 3cf31c6319d7..99dd96469659 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperationsExtensions.cs index 078c711c3099..77bb88c6daf6 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/BgpSession.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/BgpSession.cs index 040f6fa2d7b4..c661e56575b7 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/BgpSession.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/BgpSession.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/CheckServiceProviderAvailabilityInput.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/CheckServiceProviderAvailabilityInput.cs index 279d48f81376..24ef7f9c760e 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/CheckServiceProviderAvailabilityInput.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/CheckServiceProviderAvailabilityInput.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ConnectionState.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ConnectionState.cs index 6dc947f756bf..854cd63329ab 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ConnectionState.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ConnectionState.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactInfo.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactInfo.cs index d9cdbd9ae87a..73d7e8111531 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactInfo.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactInfo.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectConnection.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectConnection.cs index e5d4b5e2f2c2..3aa4fe6dd153 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectConnection.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectConnection.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectPeeringFacility.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectPeeringFacility.cs index efa35b18bf57..1bf764f9feeb 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectPeeringFacility.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectPeeringFacility.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectPeeringType.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectPeeringType.cs index 3ca527934b09..86a609020e8c 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectPeeringType.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/DirectPeeringType.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ErrorResponse.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ErrorResponse.cs index d9eb52c8742b..8754219779a5 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ErrorResponse.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ErrorResponse.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ErrorResponseException.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ErrorResponseException.cs index cec1576f2c45..9eced8ee065e 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ErrorResponseException.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ErrorResponseException.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ExchangeConnection.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ExchangeConnection.cs index 060fefabf744..48079d5d03f2 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ExchangeConnection.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ExchangeConnection.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ExchangePeeringFacility.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ExchangePeeringFacility.cs index eca74a8f6fdc..557fc135e136 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ExchangePeeringFacility.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ExchangePeeringFacility.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Family.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Family.cs index 5ea908359fb6..c665d28486d0 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Family.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Family.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Kind.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Kind.cs index 0674d99e0578..2e841e4fef3f 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Kind.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Kind.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/LearnedType.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/LearnedType.cs index c72c959e4b16..fa055cb03d2a 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/LearnedType.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/LearnedType.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Name.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Name.cs index 50b94fdcbfbc..facd278af481 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Name.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Name.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Operation.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Operation.cs index a13943b92238..0c1e561b991e 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Operation.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Operation.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/OperationDisplayInfo.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/OperationDisplayInfo.cs index 3dc6249a7037..b803cb4c26fc 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/OperationDisplayInfo.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/OperationDisplayInfo.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Page.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Page.cs index 31a43eb5bbf6..b8592e5aab38 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Page.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Page.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeerAsn.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeerAsn.cs index db1031ae4ffe..33b7cb00e7b7 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeerAsn.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeerAsn.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringBandwidthOffer.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringBandwidthOffer.cs index bf305d4f172c..af9a12dbcb07 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringBandwidthOffer.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringBandwidthOffer.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocation.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocation.cs index c58f7cf3f9d1..78f94db9d452 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocation.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocation.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocationPropertiesDirect.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocationPropertiesDirect.cs index 75921877b606..1cf995ef7a57 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocationPropertiesDirect.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocationPropertiesDirect.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocationPropertiesExchange.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocationPropertiesExchange.cs index 0c7d8349c348..69550fa50557 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocationPropertiesExchange.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringLocationPropertiesExchange.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringModel.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringModel.cs index f1992d57fcde..fcac6e70fa33 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringModel.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringModel.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringPropertiesDirect.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringPropertiesDirect.cs index 220e44d47127..59a0ffd94d52 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringPropertiesDirect.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringPropertiesDirect.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringPropertiesExchange.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringPropertiesExchange.cs index 7fc0aca62366..39ac553528b1 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringPropertiesExchange.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringPropertiesExchange.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringService.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringService.cs index 7062fb3408d2..6c92dfdd4f26 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringService.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringService.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceLocation.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceLocation.cs index d1b1f1b65aea..36c2394debe4 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceLocation.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceLocation.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServicePrefix.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServicePrefix.cs index f0377d0fcb4a..6c778e77a813 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServicePrefix.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServicePrefix.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceProvider.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceProvider.cs index cb0719e21dfd..1cbca93ee403 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceProvider.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceProvider.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringSku.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringSku.cs index 5f2706b991d2..6392406fc954 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringSku.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringSku.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PrefixValidationState.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PrefixValidationState.cs index 53e0ea4f61b2..bd6eb6dbdc8b 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PrefixValidationState.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PrefixValidationState.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ProvisioningState.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ProvisioningState.cs index 159af9cfb1cd..93e28e656b91 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ProvisioningState.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ProvisioningState.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Resource.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Resource.cs index b46ba7a28c67..f8328bbf9f3b 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Resource.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Resource.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ResourceTags.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ResourceTags.cs index f3f55cdfb29c..e3064128884b 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ResourceTags.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ResourceTags.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionAddressProvider.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionAddressProvider.cs index 8efa4d2a0583..6b424295f875 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionAddressProvider.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionAddressProvider.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionStateV4.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionStateV4.cs index 4f32bf3f5a0b..b439bc773f09 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionStateV4.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionStateV4.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionStateV6.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionStateV6.cs index b1f34a067265..9d3620d28872 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionStateV6.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SessionStateV6.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Size.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Size.cs index a204164bccda..75afcc848e14 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Size.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Size.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SubResource.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SubResource.cs index 9f5f1f9845e6..534c008149d3 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SubResource.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/SubResource.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Tier.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Tier.cs index 09d180b51ea1..82442b73bcf3 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Tier.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Tier.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ValidationState.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ValidationState.cs index fc3631a057f6..ba14a3a3e681 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ValidationState.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ValidationState.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Operations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Operations.cs index 40010abb26dd..1e758fcbf8e9 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Operations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Operations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/OperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/OperationsExtensions.cs index 3bb6e9c51924..8be78042ca7c 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/OperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/OperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeerAsnsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeerAsnsOperations.cs index 18eb0dbf57d2..a534188bc988 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeerAsnsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeerAsnsOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeerAsnsOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeerAsnsOperationsExtensions.cs index 2aa47f63508e..3944221030e9 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeerAsnsOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeerAsnsOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperations.cs index 23772b2ae156..98bc7adb7cb0 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperationsExtensions.cs index f47f220df1bc..4807bc9742a8 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClient.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClient.cs index 960bfd99d966..339a6fd5c5ca 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClient.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClient.cs @@ -1,4 +1,8 @@ // +// 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. @@ -20,7 +24,7 @@ namespace Microsoft.Azure.Management.Peering using System.Threading.Tasks; /// - /// APIs to manage Peering resources through the Azure Resource Manager. + /// Peering Client /// public partial class PeeringManagementClient : ServiceClient, IPeeringManagementClient, IAzureClient { @@ -412,9 +416,11 @@ private void Initialize() /// Checks if the peering service provider is present within 1000 miles of /// customer's location /// - /// - /// The CheckServiceProviderAvailabilityInput - /// indicating customer location and service provider. + /// + /// Gets or sets the PeeringServiceLocation + /// + /// + /// Gets or sets the PeeringServiceProvider /// /// /// Headers that will be added to request. @@ -437,12 +443,8 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task> CheckServiceProviderAvailabilityWithHttpMessagesAsync(CheckServiceProviderAvailabilityInput checkServiceProviderAvailabilityInput, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CheckServiceProviderAvailabilityWithHttpMessagesAsync(string peeringServiceLocation = default(string), string peeringServiceProvider = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (checkServiceProviderAvailabilityInput == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "checkServiceProviderAvailabilityInput"); - } if (SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); @@ -451,6 +453,12 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); } + CheckServiceProviderAvailabilityInput checkServiceProviderAvailabilityInput = new CheckServiceProviderAvailabilityInput(); + if (peeringServiceLocation != null || peeringServiceProvider != null) + { + checkServiceProviderAvailabilityInput.PeeringServiceLocation = peeringServiceLocation; + checkServiceProviderAvailabilityInput.PeeringServiceProvider = peeringServiceProvider; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClientExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClientExtensions.cs index 3cf93b236f66..370b366464d5 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClientExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClientExtensions.cs @@ -1,4 +1,8 @@ // +// 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. @@ -24,13 +28,15 @@ public static partial class PeeringManagementClientExtensions /// /// The operations group for this extension method. /// - /// - /// The CheckServiceProviderAvailabilityInput - /// indicating customer location and service provider. + /// + /// Gets or sets the PeeringServiceLocation /// - public static string CheckServiceProviderAvailability(this IPeeringManagementClient operations, CheckServiceProviderAvailabilityInput checkServiceProviderAvailabilityInput) + /// + /// Gets or sets the PeeringServiceProvider + /// + public static string CheckServiceProviderAvailability(this IPeeringManagementClient operations, string peeringServiceLocation = default(string), string peeringServiceProvider = default(string)) { - return operations.CheckServiceProviderAvailabilityAsync(checkServiceProviderAvailabilityInput).GetAwaiter().GetResult(); + return operations.CheckServiceProviderAvailabilityAsync(peeringServiceLocation, peeringServiceProvider).GetAwaiter().GetResult(); } /// @@ -40,16 +46,18 @@ public static string CheckServiceProviderAvailability(this IPeeringManagementCli /// /// The operations group for this extension method. /// - /// - /// The CheckServiceProviderAvailabilityInput - /// indicating customer location and service provider. + /// + /// Gets or sets the PeeringServiceLocation + /// + /// + /// Gets or sets the PeeringServiceProvider /// /// /// The cancellation token. /// - public static async Task CheckServiceProviderAvailabilityAsync(this IPeeringManagementClient operations, CheckServiceProviderAvailabilityInput checkServiceProviderAvailabilityInput, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CheckServiceProviderAvailabilityAsync(this IPeeringManagementClient operations, string peeringServiceLocation = default(string), string peeringServiceProvider = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CheckServiceProviderAvailabilityWithHttpMessagesAsync(checkServiceProviderAvailabilityInput, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CheckServiceProviderAvailabilityWithHttpMessagesAsync(peeringServiceLocation, peeringServiceProvider, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperations.cs index 54ec9fc8aa67..72a7c60090e6 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperationsExtensions.cs index 0d5431799281..1c14bcad8ac4 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicePrefixesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicePrefixesOperations.cs index 84ca6862ec3c..0f23284e10e3 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicePrefixesOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicePrefixesOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicePrefixesOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicePrefixesOperationsExtensions.cs index 6d797b9a21d8..1c7b121140e3 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicePrefixesOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicePrefixesOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceProvidersOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceProvidersOperations.cs index 94e4cba6f4aa..c87dd239921b 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceProvidersOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceProvidersOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceProvidersOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceProvidersOperationsExtensions.cs index 3aa3fc54cb62..899a2d16cc37 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceProvidersOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceProvidersOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicesOperations.cs index 5b7cb092a84c..969074805a68 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicesOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicesOperations.cs @@ -1,4 +1,8 @@ // +// 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. @@ -648,7 +652,7 @@ internal PeeringServicesOperations(PeeringManagementClient client) /// The name of the peering service. /// /// - /// The resource tags. + /// Gets or sets the tags, a dictionary of descriptors arm object /// /// /// Headers that will be added to request. @@ -671,7 +675,7 @@ internal PeeringServicesOperations(PeeringManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string peeringServiceName, ResourceTags tags, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string peeringServiceName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -681,10 +685,6 @@ internal PeeringServicesOperations(PeeringManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringServiceName"); } - if (tags == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tags"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -693,6 +693,11 @@ internal PeeringServicesOperations(PeeringManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + ResourceTags tags1 = new ResourceTags(); + if (tags != null) + { + tags1.Tags = tags; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -702,7 +707,7 @@ internal PeeringServicesOperations(PeeringManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("peeringServiceName", peeringServiceName); - tracingParameters.Add("tags", tags); + tracingParameters.Add("tags1", tags1); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -755,9 +760,9 @@ internal PeeringServicesOperations(PeeringManagementClient client) // Serialize Request string _requestContent = null; - if(tags != null) + if(tags1 != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tags, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tags1, 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"); } diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicesOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicesOperationsExtensions.cs index 135751d7332e..1c2cdfc0be82 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicesOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServicesOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. @@ -9,6 +13,8 @@ namespace Microsoft.Azure.Management.Peering using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -160,9 +166,9 @@ public static void Delete(this IPeeringServicesOperations operations, string res /// The name of the peering service. /// /// - /// The resource tags. + /// Gets or sets the tags, a dictionary of descriptors arm object /// - public static PeeringService Update(this IPeeringServicesOperations operations, string resourceGroupName, string peeringServiceName, ResourceTags tags) + public static PeeringService Update(this IPeeringServicesOperations operations, string resourceGroupName, string peeringServiceName, IDictionary tags = default(IDictionary)) { return operations.UpdateAsync(resourceGroupName, peeringServiceName, tags).GetAwaiter().GetResult(); } @@ -181,12 +187,12 @@ public static PeeringService Update(this IPeeringServicesOperations operations, /// The name of the peering service. /// /// - /// The resource tags. + /// Gets or sets the tags, a dictionary of descriptors arm object /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IPeeringServicesOperations operations, string resourceGroupName, string peeringServiceName, ResourceTags tags, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IPeeringServicesOperations operations, string resourceGroupName, string peeringServiceName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, peeringServiceName, tags, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringsOperations.cs index f500fb867401..05d4c7ccc3ef 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringsOperations.cs @@ -1,4 +1,8 @@ // +// 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. @@ -648,7 +652,7 @@ internal PeeringsOperations(PeeringManagementClient client) /// The name of the peering. /// /// - /// The resource tags. + /// Gets or sets the tags, a dictionary of descriptors arm object /// /// /// Headers that will be added to request. @@ -671,7 +675,7 @@ internal PeeringsOperations(PeeringManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string peeringName, ResourceTags tags, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string peeringName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -681,10 +685,6 @@ internal PeeringsOperations(PeeringManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); } - if (tags == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tags"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -693,6 +693,11 @@ internal PeeringsOperations(PeeringManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + ResourceTags tags1 = new ResourceTags(); + if (tags != null) + { + tags1.Tags = tags; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -702,7 +707,7 @@ internal PeeringsOperations(PeeringManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("peeringName", peeringName); - tracingParameters.Add("tags", tags); + tracingParameters.Add("tags1", tags1); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -755,9 +760,9 @@ internal PeeringsOperations(PeeringManagementClient client) // Serialize Request string _requestContent = null; - if(tags != null) + if(tags1 != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tags, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(tags1, 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"); } diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringsOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringsOperationsExtensions.cs index 67e42c4c8d65..3048ab59ccb8 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringsOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringsOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. @@ -9,6 +13,8 @@ namespace Microsoft.Azure.Management.Peering using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -160,9 +166,9 @@ public static void Delete(this IPeeringsOperations operations, string resourceGr /// The name of the peering. /// /// - /// The resource tags. + /// Gets or sets the tags, a dictionary of descriptors arm object /// - public static PeeringModel Update(this IPeeringsOperations operations, string resourceGroupName, string peeringName, ResourceTags tags) + public static PeeringModel Update(this IPeeringsOperations operations, string resourceGroupName, string peeringName, IDictionary tags = default(IDictionary)) { return operations.UpdateAsync(resourceGroupName, peeringName, tags).GetAwaiter().GetResult(); } @@ -181,12 +187,12 @@ public static PeeringModel Update(this IPeeringsOperations operations, string re /// The name of the peering. /// /// - /// The resource tags. + /// Gets or sets the tags, a dictionary of descriptors arm object /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this IPeeringsOperations operations, string resourceGroupName, string peeringName, ResourceTags tags, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IPeeringsOperations operations, string resourceGroupName, string peeringName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, peeringName, tags, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperations.cs index 57cb4ff48972..9b5473fe577d 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperations.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperationsExtensions.cs index c31750f1b6ab..74671d9b33e0 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperationsExtensions.cs @@ -1,4 +1,8 @@ // +// 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. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs new file mode 100644 index 000000000000..9343c90ffa9e --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs @@ -0,0 +1,37 @@ + +// +// 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.Peering +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_PeeringManagementClient + { + get + { + return new Tuple[] + { + new Tuple("Peering", "CheckServiceProviderAvailability", "2019-08-01-preview"), + new Tuple("Peering", "LegacyPeerings", "2019-08-01-preview"), + new Tuple("Peering", "Operations", "2019-08-01-preview"), + new Tuple("Peering", "PeerAsns", "2019-08-01-preview"), + new Tuple("Peering", "PeeringLocations", "2019-08-01-preview"), + new Tuple("Peering", "PeeringServiceLocations", "2019-08-01-preview"), + new Tuple("Peering", "PeeringServicePrefixes", "2019-08-01-preview"), + new Tuple("Peering", "PeeringServiceProviders", "2019-08-01-preview"), + new Tuple("Peering", "PeeringServices", "2019-08-01-preview"), + new Tuple("Peering", "Peerings", "2019-08-01-preview"), + new Tuple("Peering", "Prefixes", "2019-08-01-preview"), + }.AsEnumerable(); + } + } + } +}