diff --git a/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs new file mode 100644 index 0000000000000..c973ec69f8af1 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperations.cs @@ -0,0 +1,412 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Network +{ + using Microsoft.Azure; + using Microsoft.Azure.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; + + /// + /// AvailableEndpointServicesOperations operations. + /// + internal partial class AvailableEndpointServicesOperations : IServiceOperations, IAvailableEndpointServicesOperations + { + /// + /// Initializes a new instance of the AvailableEndpointServicesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AvailableEndpointServicesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The location to check available endpoint services. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2017-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + 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.Network/locations/{location}/virtualNetworkAvailableEndpointServices").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + 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; + } + + /// + /// List what values of endpoint services are available for use. + /// + /// + /// 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/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperationsExtensions.cs new file mode 100644 index 0000000000000..b40fe02a30f93 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/AvailableEndpointServicesOperationsExtensions.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.Network +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AvailableEndpointServicesOperations. + /// + public static partial class AvailableEndpointServicesOperationsExtensions + { + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location to check available endpoint services. + /// + public static IPage List(this IAvailableEndpointServicesOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location to check available endpoint services. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IAvailableEndpointServicesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IAvailableEndpointServicesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List what values of endpoint services are available for use. + /// + /// + /// 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 IAvailableEndpointServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/IAvailableEndpointServicesOperations.cs b/src/SDKs/Network/Management.Network/Generated/IAvailableEndpointServicesOperations.cs new file mode 100644 index 0000000000000..d17f006ce662f --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/IAvailableEndpointServicesOperations.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.Network +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AvailableEndpointServicesOperations operations. + /// + public partial interface IAvailableEndpointServicesOperations + { + /// + /// List what values of endpoint services are available for use. + /// + /// + /// The location to check available endpoint services. + /// + /// + /// 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 location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List what values of endpoint services are available for use. + /// + /// + /// 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/src/SDKs/Network/Management.Network/Generated/INetworkInterfacesOperations.cs b/src/SDKs/Network/Management.Network/Generated/INetworkInterfacesOperations.cs index f0c4fbfd2c564..ec2429eab571c 100644 --- a/src/SDKs/Network/Management.Network/Generated/INetworkInterfacesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/INetworkInterfacesOperations.cs @@ -167,7 +167,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - Task>> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network security groups applied to a network interface. /// @@ -192,7 +192,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - Task>> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about all network interfaces in a virtual machine /// in a virtual machine scale set. @@ -356,7 +356,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - Task>> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network security groups applied to a network interface. /// @@ -381,7 +381,7 @@ public partial interface INetworkInterfacesOperations /// /// Thrown when a required parameter is null /// - Task>> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all network interfaces in a subscription. /// @@ -427,50 +427,6 @@ public partial interface INetworkInterfacesOperations /// Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Gets all route tables applied to a network interface. - /// - /// - /// 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>> GetEffectiveRouteTableNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// 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>> ListEffectiveNetworkSecurityGroupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets information about all network interfaces in a virtual machine /// in a virtual machine scale set. /// @@ -515,49 +471,5 @@ public partial interface INetworkInterfacesOperations /// Thrown when a required parameter is null /// Task>> ListVirtualMachineScaleSetNetworkInterfacesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// 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>> BeginGetEffectiveRouteTableNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// 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>> BeginListEffectiveNetworkSecurityGroupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs index db5203d1f1ab1..d009611b801a5 100644 --- a/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/INetworkManagementClient.cs @@ -74,6 +74,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IApplicationGatewaysOperations ApplicationGateways { get; } + /// + /// Gets the IAvailableEndpointServicesOperations. + /// + IAvailableEndpointServicesOperations AvailableEndpointServices { get; } + /// /// Gets the IExpressRouteCircuitAuthorizationsOperations. /// diff --git a/src/SDKs/Network/Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.cs new file mode 100644 index 0000000000000..f994b927c7926 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/EffectiveNetworkSecurityGroupListResult.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.Network.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Response for list effective network security groups API service call. + /// + public partial class EffectiveNetworkSecurityGroupListResult + { + /// + /// Initializes a new instance of the + /// EffectiveNetworkSecurityGroupListResult class. + /// + public EffectiveNetworkSecurityGroupListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// EffectiveNetworkSecurityGroupListResult class. + /// + /// A list of effective network security + /// groups. + /// The URL to get the next set of + /// results. + public EffectiveNetworkSecurityGroupListResult(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 or sets a list of effective network security groups. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets the URL to get the next set of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/EffectiveRouteListResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/EffectiveRouteListResult.cs new file mode 100644 index 0000000000000..9aa9df6bfad45 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/EffectiveRouteListResult.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.Network.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Response for list effective route API service call. + /// + public partial class EffectiveRouteListResult + { + /// + /// Initializes a new instance of the EffectiveRouteListResult class. + /// + public EffectiveRouteListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveRouteListResult class. + /// + /// A list of effective routes. + /// The URL to get the next set of + /// results. + public EffectiveRouteListResult(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 or sets a list of effective routes. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets the URL to get the next set of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/EndpointServiceResult.cs b/src/SDKs/Network/Management.Network/Generated/Models/EndpointServiceResult.cs new file mode 100644 index 0000000000000..0b480ccf0be51 --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/EndpointServiceResult.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.Network.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Network; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Endpoint service. + /// + public partial class EndpointServiceResult : SubResource + { + /// + /// Initializes a new instance of the EndpointServiceResult class. + /// + public EndpointServiceResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EndpointServiceResult class. + /// + /// Resource ID. + /// Name of the endpoint service. + /// Type of the endpoint service. + public EndpointServiceResult(string id = default(string), string name = default(string), string type = default(string)) + : base(id) + { + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets name of the endpoint service. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets type of the endpoint service. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPropertiesFormat.cs b/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPropertiesFormat.cs new file mode 100644 index 0000000000000..641e41d7ebc2d --- /dev/null +++ b/src/SDKs/Network/Management.Network/Generated/Models/ServiceEndpointPropertiesFormat.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.Network.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.Network; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The service endpoint properties. + /// + public partial class ServiceEndpointPropertiesFormat + { + /// + /// Initializes a new instance of the ServiceEndpointPropertiesFormat + /// class. + /// + public ServiceEndpointPropertiesFormat() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceEndpointPropertiesFormat + /// class. + /// + /// The type of the endpoint service. + /// A list of locations. + /// The provisioning state of the + /// resource. + public ServiceEndpointPropertiesFormat(string service = default(string), IList locations = default(IList), string provisioningState = default(string)) + { + Service = service; + Locations = locations; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the type of the endpoint service. + /// + [JsonProperty(PropertyName = "service")] + public string Service { get; set; } + + /// + /// Gets or sets a list of locations. + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; set; } + + /// + /// Gets or sets the provisioning state of the resource. + /// + [JsonProperty(PropertyName = "provisioningState")] + public string ProvisioningState { get; set; } + + } +} diff --git a/src/SDKs/Network/Management.Network/Generated/Models/Subnet.cs b/src/SDKs/Network/Management.Network/Generated/Models/Subnet.cs index 7b51dcf0a5a79..f7efacaaac594 100644 --- a/src/SDKs/Network/Management.Network/Generated/Models/Subnet.cs +++ b/src/SDKs/Network/Management.Network/Generated/Models/Subnet.cs @@ -42,6 +42,8 @@ public Subnet() /// NetworkSecurityGroup resource. /// The reference of the RouteTable /// resource. + /// An array of service + /// endpoints. /// Gets an array of references to the /// network interface IP configurations using subnet. /// Gets an array of references @@ -53,12 +55,13 @@ public Subnet() /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), IList ipConfigurations = default(IList), IList resourceNavigationLinks = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) + public Subnet(string id = default(string), string addressPrefix = default(string), NetworkSecurityGroup networkSecurityGroup = default(NetworkSecurityGroup), RouteTable routeTable = default(RouteTable), IList serviceEndpoints = default(IList), IList ipConfigurations = default(IList), IList resourceNavigationLinks = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string)) : base(id) { AddressPrefix = addressPrefix; NetworkSecurityGroup = networkSecurityGroup; RouteTable = routeTable; + ServiceEndpoints = serviceEndpoints; IpConfigurations = ipConfigurations; ResourceNavigationLinks = resourceNavigationLinks; ProvisioningState = provisioningState; @@ -90,6 +93,12 @@ public Subnet() [JsonProperty(PropertyName = "properties.routeTable")] public RouteTable RouteTable { get; set; } + /// + /// Gets or sets an array of service endpoints. + /// + [JsonProperty(PropertyName = "properties.serviceEndpoints")] + public IList ServiceEndpoints { get; set; } + /// /// Gets an array of references to the network interface IP /// configurations using subnet. diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs index 456819d6c1fe6..c705eb274ac41 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperations.cs @@ -675,10 +675,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task>> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse> _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -697,10 +697,10 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// The cancellation token. /// - public async Task>> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse> _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1751,7 +1751,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginGetEffectiveRouteTableWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -1883,7 +1883,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient 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")) @@ -1896,7 +1896,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient 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) { @@ -1945,7 +1945,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(string resourceGroupName, string networkInterfaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -2077,7 +2077,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient 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")) @@ -2090,7 +2090,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient 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) { @@ -2455,44 +2455,6 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) return _result; } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> GetEffectiveRouteTableNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginGetEffectiveRouteTableNextWithHttpMessagesAsync(nextPageLink, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task>> ListEffectiveNetworkSecurityGroupsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse> _response = await BeginListEffectiveNetworkSecurityGroupsNextWithHttpMessagesAsync(nextPageLink, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Gets information about all network interfaces in a virtual machine in a /// virtual machine scale set. @@ -2840,351 +2802,5 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) return _result; } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// 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>> BeginGetEffectiveRouteTableNextWithHttpMessagesAsync(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, "BeginGetEffectiveRouteTableNext", 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 && (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; - } - - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// 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>> BeginListEffectiveNetworkSecurityGroupsNextWithHttpMessagesAsync(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, "BeginListEffectiveNetworkSecurityGroupsNext", 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 && (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; - } - } } diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs index f83903c366d28..4cdcf4e434df3 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkInterfacesOperationsExtensions.cs @@ -224,7 +224,7 @@ public static IPage List(this INetworkInterfacesOperations ope /// /// The name of the network interface. /// - public static IPage GetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + public static EffectiveRouteListResult GetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { return operations.GetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); } @@ -244,7 +244,7 @@ public static IPage GetEffectiveRouteTable(this INetworkInterfac /// /// The cancellation token. /// - public static async Task> GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -264,7 +264,7 @@ public static IPage GetEffectiveRouteTable(this INetworkInterfac /// /// The name of the network interface. /// - public static IPage ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + public static EffectiveNetworkSecurityGroupListResult ListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { return operations.ListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); } @@ -284,7 +284,7 @@ public static IPage ListEffectiveNetworkSecurityG /// /// The cancellation token. /// - public static async Task> ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -533,7 +533,7 @@ public static NetworkInterface BeginCreateOrUpdate(this INetworkInterfacesOperat /// /// The name of the network interface. /// - public static IPage BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + public static EffectiveRouteListResult BeginGetEffectiveRouteTable(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { return operations.BeginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); } @@ -553,7 +553,7 @@ public static IPage BeginGetEffectiveRouteTable(this INetworkInt /// /// The cancellation token. /// - public static async Task> BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginGetEffectiveRouteTableAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginGetEffectiveRouteTableWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -573,7 +573,7 @@ public static IPage BeginGetEffectiveRouteTable(this INetworkInt /// /// The name of the network interface. /// - public static IPage BeginListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) + public static EffectiveNetworkSecurityGroupListResult BeginListEffectiveNetworkSecurityGroups(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName) { return operations.BeginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).GetAwaiter().GetResult(); } @@ -593,7 +593,7 @@ public static IPage BeginListEffectiveNetworkSecu /// /// The cancellation token. /// - public static async Task> BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginListEffectiveNetworkSecurityGroupsAsync(this INetworkInterfacesOperations operations, string resourceGroupName, string networkInterfaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginListEffectiveNetworkSecurityGroupsWithHttpMessagesAsync(resourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false)) { @@ -669,74 +669,6 @@ public static IPage ListNext(this INetworkInterfacesOperations } } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetEffectiveRouteTableNext(this INetworkInterfacesOperations operations, string nextPageLink) - { - return operations.GetEffectiveRouteTableNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetEffectiveRouteTableNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetEffectiveRouteTableNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListEffectiveNetworkSecurityGroupsNext(this INetworkInterfacesOperations operations, string nextPageLink) - { - return operations.ListEffectiveNetworkSecurityGroupsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListEffectiveNetworkSecurityGroupsNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListEffectiveNetworkSecurityGroupsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets information about all network interfaces in a virtual machine in a /// virtual machine scale set. @@ -807,73 +739,5 @@ public static IPage ListVirtualMachineScaleSetNetworkInterface } } - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage BeginGetEffectiveRouteTableNext(this INetworkInterfacesOperations operations, string nextPageLink) - { - return operations.BeginGetEffectiveRouteTableNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all route tables applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> BeginGetEffectiveRouteTableNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginGetEffectiveRouteTableNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage BeginListEffectiveNetworkSecurityGroupsNext(this INetworkInterfacesOperations operations, string nextPageLink) - { - return operations.BeginListEffectiveNetworkSecurityGroupsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all network security groups applied to a network interface. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> BeginListEffectiveNetworkSecurityGroupsNextAsync(this INetworkInterfacesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginListEffectiveNetworkSecurityGroupsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - } } diff --git a/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs b/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs index e13455e7cd100..dad9c7e3c40c8 100644 --- a/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs +++ b/src/SDKs/Network/Management.Network/Generated/NetworkManagementClient.cs @@ -77,6 +77,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IApplicationGatewaysOperations ApplicationGateways { get; private set; } + /// + /// Gets the IAvailableEndpointServicesOperations. + /// + public virtual IAvailableEndpointServicesOperations AvailableEndpointServices { get; private set; } + /// /// Gets the IExpressRouteCircuitAuthorizationsOperations. /// @@ -439,6 +444,7 @@ public NetworkManagementClient(System.Uri baseUri, ServiceClientCredentials cred private void Initialize() { ApplicationGateways = new ApplicationGatewaysOperations(this); + AvailableEndpointServices = new AvailableEndpointServicesOperations(this); ExpressRouteCircuitAuthorizations = new ExpressRouteCircuitAuthorizationsOperations(this); ExpressRouteCircuitPeerings = new ExpressRouteCircuitPeeringsOperations(this); ExpressRouteCircuits = new ExpressRouteCircuitsOperations(this); diff --git a/src/SDKs/_metadata/network_resource-manager.txt b/src/SDKs/_metadata/network_resource-manager.txt index 2af28b4d135a2..72e399ee70ee7 100644 --- a/src/SDKs/_metadata/network_resource-manager.txt +++ b/src/SDKs/_metadata/network_resource-manager.txt @@ -1,9 +1,9 @@ -2017-08-15 00:35:17 UTC +2017-08-16 20:20:56 UTC 1) azure-rest-api-specs repository information GitHub user: Azure Branch: current -Commit: 2264e7b208abfc8b39d973717560658a6971a97f +Commit: 64c905ae24bc3e8aeca5503f7d770a8081ea7a85 2) AutoRest information Requested version: latest