From f64054d3cf6d7b01b09c55d843fa0e1097cc063a Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 10 Feb 2020 08:34:39 +0000 Subject: [PATCH] Generated from 7a631dc6ae614de7531a9e16cd96e25704728ca0 fixed comments --- .../Generated/ILegacyPeeringsOperations.cs | 5 +- .../Generated/IPeeringLocationsOperations.cs | 2 +- .../src/Generated/IPeeringManagementClient.cs | 19 +- .../IPeeringServiceCountriesOperations.cs | 68 ++ .../IPeeringServiceLocationsOperations.cs | 11 +- .../src/Generated/IPrefixesOperations.cs | 5 +- .../Generated/IRegisteredAsnsOperations.cs | 163 +++ .../IRegisteredPrefixesOperations.cs | 163 +++ .../src/Generated/LegacyPeeringsOperations.cs | 10 +- .../LegacyPeeringsOperationsExtensions.cs | 14 +- .../CheckServiceProviderAvailabilityInput.cs | 12 +- .../src/Generated/Models/ContactDetail.cs | 69 ++ .../src/Generated/Models/ContactInfo.cs | 61 - .../Generated/Models/DirectPeeringFacility.cs | 6 +- .../src/Generated/Models/DirectPeeringType.cs | 2 + .../src/Generated/Models/Name.cs | 26 - .../src/Generated/Models/PeerAsn.cs | 14 +- .../Models/PeeringPropertiesDirect.cs | 6 +- .../Generated/Models/PeeringRegisteredAsn.cs | 80 ++ .../Models/PeeringRegisteredPrefix.cs | 102 ++ .../src/Generated/Models/PeeringService.cs | 11 +- .../Generated/Models/PeeringServiceCountry.cs | 46 + .../Models/PeeringServiceLocation.cs | 2 +- .../Generated/Models/PeeringServicePrefix.cs | 11 +- .../src/Generated/Models/PeeringServiceSku.cs | 51 + .../src/Generated/Models/PeeringSku.cs | 10 +- .../src/Generated/Models/Role.cs | 25 + .../Generated/PeeringLocationsOperations.cs | 2 +- .../PeeringLocationsOperationsExtensions.cs | 4 +- .../src/Generated/PeeringManagementClient.cs | 24 +- .../PeeringManagementClientExtensions.cs | 8 +- .../PeeringServiceCountriesOperations.cs | 395 +++++++ ...ingServiceCountriesOperationsExtensions.cs | 87 ++ .../PeeringServiceLocationsOperations.cs | 16 +- ...ingServiceLocationsOperationsExtensions.cs | 26 +- .../src/Generated/PrefixesOperations.cs | 8 +- .../Generated/PrefixesOperationsExtensions.cs | 14 +- .../src/Generated/RegisteredAsnsOperations.cs | 1030 +++++++++++++++++ .../RegisteredAsnsOperationsExtensions.cs | 250 ++++ .../Generated/RegisteredPrefixesOperations.cs | 1030 +++++++++++++++++ .../RegisteredPrefixesOperationsExtensions.cs | 250 ++++ .../SdkInfo_PeeringManagementClient.cs | 39 + 42 files changed, 4013 insertions(+), 164 deletions(-) create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceCountriesOperations.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IRegisteredAsnsOperations.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IRegisteredPrefixesOperations.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactDetail.cs delete mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactInfo.cs delete mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Name.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringRegisteredAsn.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringRegisteredPrefix.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceCountry.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceSku.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Role.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceCountriesOperations.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceCountriesOperationsExtensions.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredAsnsOperations.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredAsnsOperationsExtensions.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredPrefixesOperations.cs create mode 100644 sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredPrefixesOperationsExtensions.cs 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 32ba98539261..a0c8babfcc6e 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/ILegacyPeeringsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/ILegacyPeeringsOperations.cs @@ -34,6 +34,9 @@ public partial interface ILegacyPeeringsOperations /// The kind of the peering. Possible values include: 'Direct', /// 'Exchange' /// + /// + /// The ASN number associated with a legacy peering. + /// /// /// The headers that will be added to request. /// @@ -49,7 +52,7 @@ public partial interface ILegacyPeeringsOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string peeringLocation, string kind, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string peeringLocation, string kind, int? asn = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the legacy peerings under the given subscription /// matching the specified kind and location. 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 6ffabfd9df99..d1af6abb9917 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringLocationsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringLocationsOperations.cs @@ -33,7 +33,7 @@ public partial interface IPeeringLocationsOperations /// /// /// The type of direct peering. Possible values include: 'Edge', - /// 'Transit', 'Cdn', 'Internal' + /// 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' /// /// /// The headers that will be added to request. 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 c6391eef793c..6806b2086259 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringManagementClient.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringManagementClient.cs @@ -93,11 +93,26 @@ public partial interface IPeeringManagementClient : System.IDisposable /// IPeeringLocationsOperations PeeringLocations { get; } + /// + /// Gets the IRegisteredAsnsOperations. + /// + IRegisteredAsnsOperations RegisteredAsns { get; } + + /// + /// Gets the IRegisteredPrefixesOperations. + /// + IRegisteredPrefixesOperations RegisteredPrefixes { get; } + /// /// Gets the IPeeringsOperations. /// IPeeringsOperations Peerings { get; } + /// + /// Gets the IPeeringServiceCountriesOperations. + /// + IPeeringServiceCountriesOperations PeeringServiceCountries { get; } + /// /// Gets the IPeeringServiceLocationsOperations. /// @@ -123,10 +138,10 @@ public partial interface IPeeringManagementClient : System.IDisposable /// of customer's location /// /// - /// Gets or sets the PeeringServiceLocation + /// Gets or sets the peering service location. /// /// - /// Gets or sets the PeeringServiceProvider + /// Gets or sets the peering service provider. /// /// /// The headers that will be added to request. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceCountriesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceCountriesOperations.cs new file mode 100644 index 000000000000..8026fea47848 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceCountriesOperations.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.Peering +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PeeringServiceCountriesOperations operations. + /// + public partial interface IPeeringServiceCountriesOperations + { + /// + /// Lists all of the available countries for peering service. + /// + /// + /// 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 countries for peering service. + /// + /// + /// 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/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceLocationsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceLocationsOperations.cs index 4542b3a6e069..79a8daedfa8f 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceLocationsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPeeringServiceLocationsOperations.cs @@ -24,9 +24,11 @@ namespace Microsoft.Azure.Management.Peering public partial interface IPeeringServiceLocationsOperations { /// - /// Lists all of the available peering service locations for the - /// specified kind of peering. + /// Lists all of the available locations for peering service. /// + /// + /// The country of interest, in which the locations are to be present. + /// /// /// The headers that will be added to request. /// @@ -42,10 +44,9 @@ public partial interface IPeeringServiceLocationsOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string country = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Lists all of the available peering service locations for the - /// specified kind of peering. + /// Lists all of the available locations for peering service. /// /// /// The NextLink from the previous successful call to List operation. 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 6598ad30d55b..c64b74839648 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPrefixesOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IPrefixesOperations.cs @@ -71,6 +71,9 @@ public partial interface IPrefixesOperations /// /// The prefix from which your traffic originates. /// + /// + /// The peering service prefix key + /// /// /// The headers that will be added to request. /// @@ -86,7 +89,7 @@ public partial interface IPrefixesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string peeringServiceName, string prefixName, string prefix = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string peeringServiceName, string prefixName, string prefix = default(string), string peeringServicePrefixKey = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes an existing prefix with the specified name under the given /// subscription, resource group and peering service. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IRegisteredAsnsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IRegisteredAsnsOperations.cs new file mode 100644 index 000000000000..48ac97b0a447 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IRegisteredAsnsOperations.cs @@ -0,0 +1,163 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated 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 Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RegisteredAsnsOperations operations. + /// + public partial interface IRegisteredAsnsOperations + { + /// + /// Gets an existing registered ASN with the specified name under the + /// given subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered ASN. + /// + /// + /// 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 peeringName, string registeredAsnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new registered ASN with the specified name under the + /// given subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the ASN. + /// + /// + /// The customer's ASN from which traffic originates. + /// + /// + /// 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 peeringName, string registeredAsnName, int? asn = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an existing registered ASN with the specified name under + /// the given subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered ASN. + /// + /// + /// 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 peeringName, string registeredAsnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all registered ASNs under the given subscription, resource + /// group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// 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>> ListByPeeringWithHttpMessagesAsync(string resourceGroupName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all registered ASNs under the given subscription, resource + /// group and peering. + /// + /// + /// 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>> ListByPeeringNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IRegisteredPrefixesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IRegisteredPrefixesOperations.cs new file mode 100644 index 000000000000..bcb337560cd2 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/IRegisteredPrefixesOperations.cs @@ -0,0 +1,163 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated 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 Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RegisteredPrefixesOperations operations. + /// + public partial interface IRegisteredPrefixesOperations + { + /// + /// Gets an existing registered prefix with the specified name under + /// the given subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// 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 peeringName, string registeredPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new registered prefix with the specified name under the + /// given subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// The customer's prefix from which traffic originates. + /// + /// + /// 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 peeringName, string registeredPrefixName, string prefix = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an existing registered prefix with the specified name under + /// the given subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// 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 peeringName, string registeredPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all registered prefixes under the given subscription, + /// resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// 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>> ListByPeeringWithHttpMessagesAsync(string resourceGroupName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all registered prefixes under the given subscription, + /// resource group and peering. + /// + /// + /// 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>> ListByPeeringNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} 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 99dd96469659..7ace3a92d703 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperations.cs @@ -60,6 +60,9 @@ internal LegacyPeeringsOperations(PeeringManagementClient client) /// /// The kind of the peering. Possible values include: 'Direct', 'Exchange' /// + /// + /// The ASN number associated with a legacy peering. + /// /// /// Headers that will be added to request. /// @@ -81,7 +84,7 @@ internal LegacyPeeringsOperations(PeeringManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string peeringLocation, string kind, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string peeringLocation, string kind, int? asn = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (peeringLocation == null) { @@ -108,6 +111,7 @@ internal LegacyPeeringsOperations(PeeringManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("peeringLocation", peeringLocation); tracingParameters.Add("kind", kind); + tracingParameters.Add("asn", asn); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -124,6 +128,10 @@ internal LegacyPeeringsOperations(PeeringManagementClient client) { _queryParameters.Add(string.Format("kind={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(kind, Client.SerializationSettings).Trim('"')))); } + if (asn != null) + { + _queryParameters.Add(string.Format("asn={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(asn, Client.SerializationSettings).Trim('"')))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); 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 77bb88c6daf6..6a134b540830 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/LegacyPeeringsOperationsExtensions.cs @@ -34,9 +34,12 @@ public static partial class LegacyPeeringsOperationsExtensions /// /// The kind of the peering. Possible values include: 'Direct', 'Exchange' /// - public static IPage List(this ILegacyPeeringsOperations operations, string peeringLocation, string kind) + /// + /// The ASN number associated with a legacy peering. + /// + public static IPage List(this ILegacyPeeringsOperations operations, string peeringLocation, string kind, int? asn = default(int?)) { - return operations.ListAsync(peeringLocation, kind).GetAwaiter().GetResult(); + return operations.ListAsync(peeringLocation, kind, asn).GetAwaiter().GetResult(); } /// @@ -52,12 +55,15 @@ public static IPage List(this ILegacyPeeringsOperations operations /// /// The kind of the peering. Possible values include: 'Direct', 'Exchange' /// + /// + /// The ASN number associated with a legacy peering. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this ILegacyPeeringsOperations operations, string peeringLocation, string kind, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this ILegacyPeeringsOperations operations, string peeringLocation, string kind, int? asn = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(peeringLocation, kind, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(peeringLocation, kind, asn, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } 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 24ef7f9c760e..ad0cd271559f 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 @@ -31,10 +31,10 @@ public CheckServiceProviderAvailabilityInput() /// Initializes a new instance of the /// CheckServiceProviderAvailabilityInput class. /// - /// Gets or sets the - /// PeeringServiceLocation - /// Gets or sets the - /// PeeringServiceProvider + /// Gets or sets the peering + /// service location. + /// Gets or sets the peering + /// service provider. public CheckServiceProviderAvailabilityInput(string peeringServiceLocation = default(string), string peeringServiceProvider = default(string)) { PeeringServiceLocation = peeringServiceLocation; @@ -48,13 +48,13 @@ public CheckServiceProviderAvailabilityInput() partial void CustomInit(); /// - /// Gets or sets the PeeringServiceLocation + /// Gets or sets the peering service location. /// [JsonProperty(PropertyName = "peeringServiceLocation")] public string PeeringServiceLocation { get; set; } /// - /// Gets or sets the PeeringServiceProvider + /// Gets or sets the peering service provider. /// [JsonProperty(PropertyName = "peeringServiceProvider")] public string PeeringServiceProvider { get; set; } diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactDetail.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactDetail.cs new file mode 100644 index 000000000000..8a6012947f3c --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactDetail.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.Peering.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The contact detail class. + /// + public partial class ContactDetail + { + /// + /// Initializes a new instance of the ContactDetail class. + /// + public ContactDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContactDetail class. + /// + /// The role of the contact. Possible values + /// include: 'Noc', 'Policy', 'Technical', 'Service', 'Other' + /// The e-mail address of the contact. + /// The phone number of the contact. + public ContactDetail(string role = default(string), string email = default(string), string phone = default(string)) + { + Role = role; + Email = email; + Phone = phone; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the role of the contact. Possible values include: + /// 'Noc', 'Policy', 'Technical', 'Service', 'Other' + /// + [JsonProperty(PropertyName = "role")] + public string Role { get; set; } + + /// + /// Gets or sets the e-mail address of the contact. + /// + [JsonProperty(PropertyName = "email")] + public string Email { get; set; } + + /// + /// Gets or sets the phone number of the contact. + /// + [JsonProperty(PropertyName = "phone")] + public string Phone { get; set; } + + } +} 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 deleted file mode 100644 index 73d7e8111531..000000000000 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/ContactInfo.cs +++ /dev/null @@ -1,61 +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.Peering.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The contact information of the peer. - /// - public partial class ContactInfo - { - /// - /// Initializes a new instance of the ContactInfo class. - /// - public ContactInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContactInfo class. - /// - /// The list of email addresses. - /// The list of contact numbers. - public ContactInfo(IList emails = default(IList), IList phone = default(IList)) - { - Emails = emails; - Phone = phone; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the list of email addresses. - /// - [JsonProperty(PropertyName = "emails")] - public IList Emails { get; set; } - - /// - /// Gets or sets the list of contact numbers. - /// - [JsonProperty(PropertyName = "phone")] - public IList Phone { get; set; } - - } -} 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 1bf764f9feeb..f374f44e0224 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 @@ -32,8 +32,8 @@ public DirectPeeringFacility() /// The address of the direct peering /// facility. /// The type of the direct peering. - /// Possible values include: 'Edge', 'Transit', 'Cdn', - /// 'Internal' + /// Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal', + /// 'Ix', 'IxRs' /// The PeeringDB.com ID of the /// facility. /// The PeeringDB.com URL of the @@ -60,7 +60,7 @@ public DirectPeeringFacility() /// /// Gets or sets the type of the direct peering. Possible values - /// include: 'Edge', 'Transit', 'Cdn', 'Internal' + /// include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' /// [JsonProperty(PropertyName = "directPeeringType")] public string DirectPeeringType { get; set; } 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 86a609020e8c..c211fd8dcf81 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 @@ -20,5 +20,7 @@ public static class DirectPeeringType public const string Transit = "Transit"; public const string Cdn = "Cdn"; public const string Internal = "Internal"; + public const string Ix = "Ix"; + public const string IxRs = "IxRs"; } } 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 deleted file mode 100644 index facd278af481..000000000000 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Name.cs +++ /dev/null @@ -1,26 +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.Peering.Models -{ - - /// - /// Defines values for Name. - /// - public static class Name - { - public const string BasicExchangeFree = "Basic_Exchange_Free"; - public const string BasicDirectFree = "Basic_Direct_Free"; - public const string PremiumDirectFree = "Premium_Direct_Free"; - public const string PremiumExchangeMetered = "Premium_Exchange_Metered"; - public const string PremiumDirectMetered = "Premium_Direct_Metered"; - public const string PremiumDirectUnlimited = "Premium_Direct_Unlimited"; - } -} 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 f0babc88e60a..66c3547932c3 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 @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.Peering.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -37,7 +39,7 @@ public PeerAsn() /// The type of the resource. /// The Autonomous System Number (ASN) of /// the peer. - /// The contact information of the + /// The contact details of the /// peer. /// The name of the peer. /// The validation state of the ASN @@ -45,11 +47,11 @@ public PeerAsn() /// 'Pending', 'Approved', 'Failed' /// The error message for the validation /// state - public PeerAsn(string name = default(string), string id = default(string), string type = default(string), int? peerAsnProperty = default(int?), ContactInfo peerContactInfo = default(ContactInfo), string peerName = default(string), string validationState = default(string), string errorMessage = default(string)) + public PeerAsn(string name = default(string), string id = default(string), string type = default(string), int? peerAsnProperty = default(int?), IList peerContactDetail = default(IList), string peerName = default(string), string validationState = default(string), string errorMessage = default(string)) : base(name, id, type) { PeerAsnProperty = peerAsnProperty; - PeerContactInfo = peerContactInfo; + PeerContactDetail = peerContactDetail; PeerName = peerName; ValidationState = validationState; ErrorMessage = errorMessage; @@ -68,10 +70,10 @@ public PeerAsn() public int? PeerAsnProperty { get; set; } /// - /// Gets or sets the contact information of the peer. + /// Gets or sets the contact details of the peer. /// - [JsonProperty(PropertyName = "properties.peerContactInfo")] - public ContactInfo PeerContactInfo { get; set; } + [JsonProperty(PropertyName = "properties.peerContactDetail")] + public IList PeerContactDetail { get; set; } /// /// Gets or sets the name of the peer. 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 8cc2356c744f..2bce9bddae0c 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 @@ -37,8 +37,8 @@ public PeeringPropertiesDirect() /// or not the peering is used for peering service. /// The reference of the peer ASN. /// The type of direct peering. - /// Possible values include: 'Edge', 'Transit', 'Cdn', - /// 'Internal' + /// Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal', + /// 'Ix', 'IxRs' public PeeringPropertiesDirect(IList connections = default(IList), bool? useForPeeringService = default(bool?), SubResource peerAsn = default(SubResource), string directPeeringType = default(string)) { Connections = connections; @@ -75,7 +75,7 @@ public PeeringPropertiesDirect() /// /// Gets or sets the type of direct peering. Possible values include: - /// 'Edge', 'Transit', 'Cdn', 'Internal' + /// 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' /// [JsonProperty(PropertyName = "directPeeringType")] public string DirectPeeringType { get; set; } diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringRegisteredAsn.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringRegisteredAsn.cs new file mode 100644 index 000000000000..86480d5b749d --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringRegisteredAsn.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.Peering.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The customer's ASN that is registered by the peering service provider. + /// + [Rest.Serialization.JsonTransformation] + public partial class PeeringRegisteredAsn : Resource + { + /// + /// Initializes a new instance of the PeeringRegisteredAsn class. + /// + public PeeringRegisteredAsn() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PeeringRegisteredAsn class. + /// + /// The name of the resource. + /// The ID of the resource. + /// The type of the resource. + /// The customer's ASN from which traffic + /// originates. + /// The peering service prefix + /// key that is to be shared with the customer. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public PeeringRegisteredAsn(string name = default(string), string id = default(string), string type = default(string), int? asn = default(int?), string peeringServicePrefixKey = default(string), string provisioningState = default(string)) + : base(name, id, type) + { + Asn = asn; + PeeringServicePrefixKey = peeringServicePrefixKey; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the customer's ASN from which traffic originates. + /// + [JsonProperty(PropertyName = "properties.asn")] + public int? Asn { get; set; } + + /// + /// Gets the peering service prefix key that is to be shared with the + /// customer. + /// + [JsonProperty(PropertyName = "properties.peeringServicePrefixKey")] + public string PeeringServicePrefixKey { get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringRegisteredPrefix.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringRegisteredPrefix.cs new file mode 100644 index 000000000000..d168f7d06494 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringRegisteredPrefix.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.Peering.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The customer's prefix that is registered by the peering service + /// provider. + /// + [Rest.Serialization.JsonTransformation] + public partial class PeeringRegisteredPrefix : Resource + { + /// + /// Initializes a new instance of the PeeringRegisteredPrefix class. + /// + public PeeringRegisteredPrefix() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PeeringRegisteredPrefix class. + /// + /// The name of the resource. + /// The ID of the resource. + /// The type of the resource. + /// The customer's prefix from which traffic + /// originates. + /// The prefix validation state. + /// Possible values include: 'None', 'Invalid', 'Verified', 'Failed', + /// 'Pending', 'Warning', 'Unknown' + /// The peering service prefix + /// key that is to be shared with the customer. + /// The error message associated with the + /// validation state, if any. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public PeeringRegisteredPrefix(string name = default(string), string id = default(string), string type = default(string), string prefix = default(string), string prefixValidationState = default(string), string peeringServicePrefixKey = default(string), string errorMessage = default(string), string provisioningState = default(string)) + : base(name, id, type) + { + Prefix = prefix; + PrefixValidationState = prefixValidationState; + PeeringServicePrefixKey = peeringServicePrefixKey; + ErrorMessage = errorMessage; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the customer's prefix from which traffic originates. + /// + [JsonProperty(PropertyName = "properties.prefix")] + public string Prefix { get; set; } + + /// + /// Gets the prefix validation state. Possible values include: 'None', + /// 'Invalid', 'Verified', 'Failed', 'Pending', 'Warning', 'Unknown' + /// + [JsonProperty(PropertyName = "properties.prefixValidationState")] + public string PrefixValidationState { get; private set; } + + /// + /// Gets the peering service prefix key that is to be shared with the + /// customer. + /// + [JsonProperty(PropertyName = "properties.peeringServicePrefixKey")] + public string PeeringServicePrefixKey { get; private set; } + + /// + /// Gets the error message associated with the validation state, if + /// any. + /// + [JsonProperty(PropertyName = "properties.errorMessage")] + public string ErrorMessage { get; private set; } + + /// + /// Gets the provisioning state of the resource. Possible values + /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} 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 6c92dfdd4f26..d5ced2386f6c 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 @@ -38,6 +38,8 @@ public PeeringService() /// The name of the resource. /// The ID of the resource. /// The type of the resource. + /// The SKU that defines the type of the peering + /// service. /// The PeeringServiceLocation of /// the Customer. /// The MAPS Provider @@ -46,9 +48,10 @@ public PeeringService() /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' /// The resource tags. - public PeeringService(string location, string name = default(string), string id = default(string), string type = default(string), string peeringServiceLocation = default(string), string peeringServiceProvider = default(string), string provisioningState = default(string), IDictionary tags = default(IDictionary)) + public PeeringService(string location, string name = default(string), string id = default(string), string type = default(string), PeeringServiceSku sku = default(PeeringServiceSku), string peeringServiceLocation = default(string), string peeringServiceProvider = default(string), string provisioningState = default(string), IDictionary tags = default(IDictionary)) : base(name, id, type) { + Sku = sku; PeeringServiceLocation = peeringServiceLocation; PeeringServiceProvider = peeringServiceProvider; ProvisioningState = provisioningState; @@ -62,6 +65,12 @@ public PeeringService() /// partial void CustomInit(); + /// + /// Gets or sets the SKU that defines the type of the peering service. + /// + [JsonProperty(PropertyName = "sku")] + public PeeringServiceSku Sku { get; set; } + /// /// Gets or sets the PeeringServiceLocation of the Customer. /// diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceCountry.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceCountry.cs new file mode 100644 index 000000000000..ea4c59230990 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceCountry.cs @@ -0,0 +1,46 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated 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.Models +{ + using System.Linq; + + /// + /// The peering service country. + /// + public partial class PeeringServiceCountry : Resource + { + /// + /// Initializes a new instance of the PeeringServiceCountry class. + /// + public PeeringServiceCountry() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PeeringServiceCountry class. + /// + /// The name of the resource. + /// The ID of the resource. + /// The type of the resource. + public PeeringServiceCountry(string name = default(string), string id = default(string), string type = default(string)) + : base(name, id, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} 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 36c2394debe4..d46ba5c1c422 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 @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Management.Peering.Models using System.Linq; /// - /// PeeringService location + /// The peering service location. /// [Rest.Serialization.JsonTransformation] public partial class PeeringServiceLocation : Resource 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 6b085308417c..f85e6c3b9296 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 @@ -48,10 +48,12 @@ public PeeringServicePrefix() /// state /// The list of events for peering service /// prefix + /// The peering service prefix + /// key /// The provisioning state of the /// resource. Possible values include: 'Succeeded', 'Updating', /// 'Deleting', 'Failed' - public PeeringServicePrefix(string name = default(string), string id = default(string), string type = default(string), string prefix = default(string), string prefixValidationState = default(string), string learnedType = default(string), string errorMessage = default(string), IList events = default(IList), string provisioningState = default(string)) + public PeeringServicePrefix(string name = default(string), string id = default(string), string type = default(string), string prefix = default(string), string prefixValidationState = default(string), string learnedType = default(string), string errorMessage = default(string), IList events = default(IList), string peeringServicePrefixKey = default(string), string provisioningState = default(string)) : base(name, id, type) { Prefix = prefix; @@ -59,6 +61,7 @@ public PeeringServicePrefix() LearnedType = learnedType; ErrorMessage = errorMessage; Events = events; + PeeringServicePrefixKey = peeringServicePrefixKey; ProvisioningState = provisioningState; CustomInit(); } @@ -100,6 +103,12 @@ public PeeringServicePrefix() [JsonProperty(PropertyName = "properties.events")] public IList Events { get; private set; } + /// + /// Gets or sets the peering service prefix key + /// + [JsonProperty(PropertyName = "properties.peeringServicePrefixKey")] + public string PeeringServicePrefixKey { get; set; } + /// /// Gets the provisioning state of the resource. Possible values /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceSku.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceSku.cs new file mode 100644 index 000000000000..3ffdbadf4b56 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/PeeringServiceSku.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.Peering.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The SKU that defines the type of the peering service. + /// + public partial class PeeringServiceSku + { + /// + /// Initializes a new instance of the PeeringServiceSku class. + /// + public PeeringServiceSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PeeringServiceSku class. + /// + /// The name of the peering service SKU. + public PeeringServiceSku(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 peering service SKU. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + } +} 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 6392406fc954..d2cb07fed4f1 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 @@ -29,10 +29,7 @@ public PeeringSku() /// /// Initializes a new instance of the PeeringSku class. /// - /// The name of the peering SKU. Possible values - /// include: 'Basic_Exchange_Free', 'Basic_Direct_Free', - /// 'Premium_Direct_Free', 'Premium_Exchange_Metered', - /// 'Premium_Direct_Metered', 'Premium_Direct_Unlimited' + /// The name of the peering SKU. /// The tier of the peering SKU. Possible values /// include: 'Basic', 'Premium' /// The family of the peering SKU. Possible values @@ -54,10 +51,7 @@ public PeeringSku() partial void CustomInit(); /// - /// Gets or sets the name of the peering SKU. Possible values include: - /// 'Basic_Exchange_Free', 'Basic_Direct_Free', 'Premium_Direct_Free', - /// 'Premium_Exchange_Metered', 'Premium_Direct_Metered', - /// 'Premium_Direct_Unlimited' + /// Gets or sets the name of the peering SKU. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Role.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Role.cs new file mode 100644 index 000000000000..848060abffd7 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/Models/Role.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.Peering.Models +{ + + /// + /// Defines values for Role. + /// + public static class Role + { + public const string Noc = "Noc"; + public const string Policy = "Policy"; + public const string Technical = "Technical"; + public const string Service = "Service"; + public const string Other = "Other"; + } +} 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 98bc7adb7cb0..e3da8c9c1266 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperations.cs @@ -59,7 +59,7 @@ internal PeeringLocationsOperations(PeeringManagementClient client) /// /// /// The type of direct peering. Possible values include: 'Edge', 'Transit', - /// 'Cdn', 'Internal' + /// 'Cdn', 'Internal', 'Ix', 'IxRs' /// /// /// Headers that will be added to request. 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 4807bc9742a8..8788fb6e9b6b 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringLocationsOperationsExtensions.cs @@ -33,7 +33,7 @@ public static partial class PeeringLocationsOperationsExtensions /// /// /// The type of direct peering. Possible values include: 'Edge', 'Transit', - /// 'Cdn', 'Internal' + /// 'Cdn', 'Internal', 'Ix', 'IxRs' /// public static IPage List(this IPeeringLocationsOperations operations, string kind, string directPeeringType = default(string)) { @@ -52,7 +52,7 @@ public static partial class PeeringLocationsOperationsExtensions /// /// /// The type of direct peering. Possible values include: 'Edge', 'Transit', - /// 'Cdn', 'Internal' + /// 'Cdn', 'Internal', 'Ix', 'IxRs' /// /// /// The cancellation token. 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 03bd2dde17e3..7e4737c6b86f 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClient.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClient.cs @@ -96,11 +96,26 @@ public partial class PeeringManagementClient : ServiceClient public virtual IPeeringLocationsOperations PeeringLocations { get; private set; } + /// + /// Gets the IRegisteredAsnsOperations. + /// + public virtual IRegisteredAsnsOperations RegisteredAsns { get; private set; } + + /// + /// Gets the IRegisteredPrefixesOperations. + /// + public virtual IRegisteredPrefixesOperations RegisteredPrefixes { get; private set; } + /// /// Gets the IPeeringsOperations. /// public virtual IPeeringsOperations Peerings { get; private set; } + /// + /// Gets the IPeeringServiceCountriesOperations. + /// + public virtual IPeeringServiceCountriesOperations PeeringServiceCountries { get; private set; } + /// /// Gets the IPeeringServiceLocationsOperations. /// @@ -366,13 +381,16 @@ private void Initialize() Operations = new Operations(this); PeerAsns = new PeerAsnsOperations(this); PeeringLocations = new PeeringLocationsOperations(this); + RegisteredAsns = new RegisteredAsnsOperations(this); + RegisteredPrefixes = new RegisteredPrefixesOperations(this); Peerings = new PeeringsOperations(this); + PeeringServiceCountries = new PeeringServiceCountriesOperations(this); PeeringServiceLocations = new PeeringServiceLocationsOperations(this); Prefixes = new PrefixesOperations(this); PeeringServiceProviders = new PeeringServiceProvidersOperations(this); PeeringServices = new PeeringServicesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-09-01-preview"; + ApiVersion = "2020-01-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -411,10 +429,10 @@ private void Initialize() /// customer's location /// /// - /// Gets or sets the PeeringServiceLocation + /// Gets or sets the peering service location. /// /// - /// Gets or sets the PeeringServiceProvider + /// Gets or sets the peering service provider. /// /// /// Headers that will be added to request. 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 370b366464d5..e9d9aca21b84 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClientExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringManagementClientExtensions.cs @@ -29,10 +29,10 @@ public static partial class PeeringManagementClientExtensions /// The operations group for this extension method. /// /// - /// Gets or sets the PeeringServiceLocation + /// Gets or sets the peering service location. /// /// - /// Gets or sets the PeeringServiceProvider + /// Gets or sets the peering service provider. /// public static string CheckServiceProviderAvailability(this IPeeringManagementClient operations, string peeringServiceLocation = default(string), string peeringServiceProvider = default(string)) { @@ -47,10 +47,10 @@ public static partial class PeeringManagementClientExtensions /// The operations group for this extension method. /// /// - /// Gets or sets the PeeringServiceLocation + /// Gets or sets the peering service location. /// /// - /// Gets or sets the PeeringServiceProvider + /// Gets or sets the peering service provider. /// /// /// The cancellation token. diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceCountriesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceCountriesOperations.cs new file mode 100644 index 000000000000..d748937717f0 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceCountriesOperations.cs @@ -0,0 +1,395 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated 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 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; + + /// + /// PeeringServiceCountriesOperations operations. + /// + internal partial class PeeringServiceCountriesOperations : IServiceOperations, IPeeringServiceCountriesOperations + { + /// + /// Initializes a new instance of the PeeringServiceCountriesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PeeringServiceCountriesOperations(PeeringManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PeeringManagementClient + /// + public PeeringManagementClient Client { get; private set; } + + /// + /// Lists all of the available countries for peering service. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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.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("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.Peering/peeringServiceCountries").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; + } + + /// + /// Lists all of the available countries for peering service. + /// + /// + /// 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/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceCountriesOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceCountriesOperationsExtensions.cs new file mode 100644 index 000000000000..7fca6db646c4 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceCountriesOperationsExtensions.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.Peering +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PeeringServiceCountriesOperations. + /// + public static partial class PeeringServiceCountriesOperationsExtensions + { + /// + /// Lists all of the available countries for peering service. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IPeeringServiceCountriesOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available countries for peering service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IPeeringServiceCountriesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all of the available countries for peering service. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IPeeringServiceCountriesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all of the available countries for peering service. + /// + /// + /// 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 IPeeringServiceCountriesOperations 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/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperations.cs index 72a7c60090e6..3e1eb9127950 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperations.cs @@ -51,9 +51,11 @@ internal PeeringServiceLocationsOperations(PeeringManagementClient client) public PeeringManagementClient Client { get; private set; } /// - /// Lists all of the available peering service locations for the specified kind - /// of peering. + /// Lists all of the available locations for peering service. /// + /// + /// The country of interest, in which the locations are to be present. + /// /// /// Headers that will be added to request. /// @@ -75,7 +77,7 @@ internal PeeringServiceLocationsOperations(PeeringManagementClient 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(string country = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -92,6 +94,7 @@ internal PeeringServiceLocationsOperations(PeeringManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("country", country); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -100,6 +103,10 @@ internal PeeringServiceLocationsOperations(PeeringManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceLocations").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (country != null) + { + _queryParameters.Add(string.Format("country={0}", System.Uri.EscapeDataString(country))); + } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -225,8 +232,7 @@ internal PeeringServiceLocationsOperations(PeeringManagementClient client) } /// - /// Lists all of the available peering service locations for the specified kind - /// of peering. + /// Lists all of the available locations for peering service. /// /// /// The NextLink from the previous successful call to List operation. 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 1c14bcad8ac4..cdafab1730ed 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PeeringServiceLocationsOperationsExtensions.cs @@ -22,38 +22,41 @@ namespace Microsoft.Azure.Management.Peering public static partial class PeeringServiceLocationsOperationsExtensions { /// - /// Lists all of the available peering service locations for the specified kind - /// of peering. + /// Lists all of the available locations for peering service. /// /// /// The operations group for this extension method. /// - public static IPage List(this IPeeringServiceLocationsOperations operations) + /// + /// The country of interest, in which the locations are to be present. + /// + public static IPage List(this IPeeringServiceLocationsOperations operations, string country = default(string)) { - return operations.ListAsync().GetAwaiter().GetResult(); + return operations.ListAsync(country).GetAwaiter().GetResult(); } /// - /// Lists all of the available peering service locations for the specified kind - /// of peering. + /// Lists all of the available locations for peering service. /// /// /// The operations group for this extension method. /// + /// + /// The country of interest, in which the locations are to be present. + /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IPeeringServiceLocationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IPeeringServiceLocationsOperations operations, string country = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(country, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Lists all of the available peering service locations for the specified kind - /// of peering. + /// Lists all of the available locations for peering service. /// /// /// The operations group for this extension method. @@ -67,8 +70,7 @@ public static IPage ListNext(this IPeeringServiceLocatio } /// - /// Lists all of the available peering service locations for the specified kind - /// of peering. + /// Lists all of the available locations for peering service. /// /// /// The operations group for this extension method. 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 f356239d117b..e4d4c35da625 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperations.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperations.cs @@ -275,6 +275,9 @@ internal PrefixesOperations(PeeringManagementClient client) /// /// The prefix from which your traffic originates. /// + /// + /// The peering service prefix key + /// /// /// Headers that will be added to request. /// @@ -296,7 +299,7 @@ internal PrefixesOperations(PeeringManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string peeringServiceName, string prefixName, string prefix = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string peeringServiceName, string prefixName, string prefix = default(string), string peeringServicePrefixKey = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -319,9 +322,10 @@ internal PrefixesOperations(PeeringManagementClient client) throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } PeeringServicePrefix peeringServicePrefix = new PeeringServicePrefix(); - if (prefix != null) + if (prefix != null || peeringServicePrefixKey != null) { peeringServicePrefix.Prefix = prefix; + peeringServicePrefix.PeeringServicePrefixKey = peeringServicePrefixKey; } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; 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 5c3e7b15af55..c632163dc89e 100644 --- a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperationsExtensions.cs +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/PrefixesOperationsExtensions.cs @@ -94,9 +94,12 @@ public static partial class PrefixesOperationsExtensions /// /// The prefix from which your traffic originates. /// - public static PeeringServicePrefix CreateOrUpdate(this IPrefixesOperations operations, string resourceGroupName, string peeringServiceName, string prefixName, string prefix = default(string)) + /// + /// The peering service prefix key + /// + public static PeeringServicePrefix CreateOrUpdate(this IPrefixesOperations operations, string resourceGroupName, string peeringServiceName, string prefixName, string prefix = default(string), string peeringServicePrefixKey = default(string)) { - return operations.CreateOrUpdateAsync(resourceGroupName, peeringServiceName, prefixName, prefix).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, peeringServiceName, prefixName, prefix, peeringServicePrefixKey).GetAwaiter().GetResult(); } /// @@ -118,12 +121,15 @@ public static partial class PrefixesOperationsExtensions /// /// The prefix from which your traffic originates. /// + /// + /// The peering service prefix key + /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IPrefixesOperations operations, string resourceGroupName, string peeringServiceName, string prefixName, string prefix = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IPrefixesOperations operations, string resourceGroupName, string peeringServiceName, string prefixName, string prefix = default(string), string peeringServicePrefixKey = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, peeringServiceName, prefixName, prefix, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, peeringServiceName, prefixName, prefix, peeringServicePrefixKey, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredAsnsOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredAsnsOperations.cs new file mode 100644 index 000000000000..122627bff511 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredAsnsOperations.cs @@ -0,0 +1,1030 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated 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 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; + + /// + /// RegisteredAsnsOperations operations. + /// + internal partial class RegisteredAsnsOperations : IServiceOperations, IRegisteredAsnsOperations + { + /// + /// Initializes a new instance of the RegisteredAsnsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RegisteredAsnsOperations(PeeringManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PeeringManagementClient + /// + public PeeringManagementClient Client { get; private set; } + + /// + /// Gets an existing registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered ASN. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 peeringName, string registeredAsnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (registeredAsnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registeredAsnName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("registeredAsnName", registeredAsnName); + 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.Peering/peerings/{peeringName}/registeredAsns/{registeredAsnName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{registeredAsnName}", System.Uri.EscapeDataString(registeredAsnName)); + _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 a new registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the ASN. + /// + /// + /// The customer's ASN from which traffic originates. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 peeringName, string registeredAsnName, int? asn = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (registeredAsnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registeredAsnName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + PeeringRegisteredAsn registeredAsn = new PeeringRegisteredAsn(); + if (asn != null) + { + registeredAsn.Asn = asn; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("registeredAsnName", registeredAsnName); + tracingParameters.Add("registeredAsn", registeredAsn); + 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.Peering/peerings/{peeringName}/registeredAsns/{registeredAsnName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{registeredAsnName}", System.Uri.EscapeDataString(registeredAsnName)); + _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(registeredAsn != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(registeredAsn, 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; + } + + /// + /// Deletes an existing registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered ASN. + /// + /// + /// 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 peeringName, string registeredAsnName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (registeredAsnName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registeredAsnName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("registeredAsnName", registeredAsnName); + 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.Peering/peerings/{peeringName}/registeredAsns/{registeredAsnName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{registeredAsnName}", System.Uri.EscapeDataString(registeredAsnName)); + _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("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; + } + + /// + /// Lists all registered ASNs under the given subscription, resource group and + /// peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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>> ListByPeeringWithHttpMessagesAsync(string resourceGroupName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByPeering", 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.Peering/peerings/{peeringName}/registeredAsns").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _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; + } + + /// + /// Lists all registered ASNs under the given subscription, resource group and + /// peering. + /// + /// + /// 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>> ListByPeeringNextWithHttpMessagesAsync(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, "ListByPeeringNext", 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/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredAsnsOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredAsnsOperationsExtensions.cs new file mode 100644 index 000000000000..00843cc8466a --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredAsnsOperationsExtensions.cs @@ -0,0 +1,250 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated 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 Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RegisteredAsnsOperations. + /// + public static partial class RegisteredAsnsOperationsExtensions + { + /// + /// Gets an existing registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered ASN. + /// + public static PeeringRegisteredAsn Get(this IRegisteredAsnsOperations operations, string resourceGroupName, string peeringName, string registeredAsnName) + { + return operations.GetAsync(resourceGroupName, peeringName, registeredAsnName).GetAwaiter().GetResult(); + } + + /// + /// Gets an existing registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered ASN. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IRegisteredAsnsOperations operations, string resourceGroupName, string peeringName, string registeredAsnName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, peeringName, registeredAsnName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the ASN. + /// + /// + /// The customer's ASN from which traffic originates. + /// + public static PeeringRegisteredAsn CreateOrUpdate(this IRegisteredAsnsOperations operations, string resourceGroupName, string peeringName, string registeredAsnName, int? asn = default(int?)) + { + return operations.CreateOrUpdateAsync(resourceGroupName, peeringName, registeredAsnName, asn).GetAwaiter().GetResult(); + } + + /// + /// Creates a new registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the ASN. + /// + /// + /// The customer's ASN from which traffic originates. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IRegisteredAsnsOperations operations, string resourceGroupName, string peeringName, string registeredAsnName, int? asn = default(int?), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, peeringName, registeredAsnName, asn, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an existing registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered ASN. + /// + public static void Delete(this IRegisteredAsnsOperations operations, string resourceGroupName, string peeringName, string registeredAsnName) + { + operations.DeleteAsync(resourceGroupName, peeringName, registeredAsnName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing registered ASN with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered ASN. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IRegisteredAsnsOperations operations, string resourceGroupName, string peeringName, string registeredAsnName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, peeringName, registeredAsnName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all registered ASNs under the given subscription, resource group and + /// peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + public static IPage ListByPeering(this IRegisteredAsnsOperations operations, string resourceGroupName, string peeringName) + { + return operations.ListByPeeringAsync(resourceGroupName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Lists all registered ASNs under the given subscription, resource group and + /// peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByPeeringAsync(this IRegisteredAsnsOperations operations, string resourceGroupName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByPeeringWithHttpMessagesAsync(resourceGroupName, peeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all registered ASNs under the given subscription, resource group and + /// peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByPeeringNext(this IRegisteredAsnsOperations operations, string nextPageLink) + { + return operations.ListByPeeringNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all registered ASNs under the given subscription, resource group and + /// peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByPeeringNextAsync(this IRegisteredAsnsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByPeeringNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredPrefixesOperations.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredPrefixesOperations.cs new file mode 100644 index 000000000000..27800197c94c --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredPrefixesOperations.cs @@ -0,0 +1,1030 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated 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 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; + + /// + /// RegisteredPrefixesOperations operations. + /// + internal partial class RegisteredPrefixesOperations : IServiceOperations, IRegisteredPrefixesOperations + { + /// + /// Initializes a new instance of the RegisteredPrefixesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RegisteredPrefixesOperations(PeeringManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the PeeringManagementClient + /// + public PeeringManagementClient Client { get; private set; } + + /// + /// Gets an existing registered prefix with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 peeringName, string registeredPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (registeredPrefixName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registeredPrefixName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("registeredPrefixName", registeredPrefixName); + 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.Peering/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{registeredPrefixName}", System.Uri.EscapeDataString(registeredPrefixName)); + _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 a new registered prefix with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// The customer's prefix from which traffic originates. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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 peeringName, string registeredPrefixName, string prefix = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (registeredPrefixName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registeredPrefixName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + PeeringRegisteredPrefix registeredPrefix = new PeeringRegisteredPrefix(); + if (prefix != null) + { + registeredPrefix.Prefix = prefix; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("registeredPrefixName", registeredPrefixName); + tracingParameters.Add("registeredPrefix", registeredPrefix); + 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.Peering/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{registeredPrefixName}", System.Uri.EscapeDataString(registeredPrefixName)); + _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(registeredPrefix != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(registeredPrefix, 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; + } + + /// + /// Deletes an existing registered prefix with the specified name under the + /// given subscription, resource group and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// 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 peeringName, string registeredPrefixName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + if (registeredPrefixName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "registeredPrefixName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("registeredPrefixName", registeredPrefixName); + 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.Peering/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _url = _url.Replace("{registeredPrefixName}", System.Uri.EscapeDataString(registeredPrefixName)); + _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("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; + } + + /// + /// Lists all registered prefixes under the given subscription, resource group + /// and peering. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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>> ListByPeeringWithHttpMessagesAsync(string resourceGroupName, string peeringName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (peeringName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "peeringName"); + } + 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("resourceGroupName", resourceGroupName); + tracingParameters.Add("peeringName", peeringName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByPeering", 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.Peering/peerings/{peeringName}/registeredPrefixes").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{peeringName}", System.Uri.EscapeDataString(peeringName)); + _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; + } + + /// + /// Lists all registered prefixes under the given subscription, resource group + /// and peering. + /// + /// + /// 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>> ListByPeeringNextWithHttpMessagesAsync(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, "ListByPeeringNext", 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/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredPrefixesOperationsExtensions.cs b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredPrefixesOperationsExtensions.cs new file mode 100644 index 000000000000..c96664b0a4f0 --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/RegisteredPrefixesOperationsExtensions.cs @@ -0,0 +1,250 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated 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 Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RegisteredPrefixesOperations. + /// + public static partial class RegisteredPrefixesOperationsExtensions + { + /// + /// Gets an existing registered prefix with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + public static PeeringRegisteredPrefix Get(this IRegisteredPrefixesOperations operations, string resourceGroupName, string peeringName, string registeredPrefixName) + { + return operations.GetAsync(resourceGroupName, peeringName, registeredPrefixName).GetAwaiter().GetResult(); + } + + /// + /// Gets an existing registered prefix with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IRegisteredPrefixesOperations operations, string resourceGroupName, string peeringName, string registeredPrefixName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, peeringName, registeredPrefixName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new registered prefix with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// The customer's prefix from which traffic originates. + /// + public static PeeringRegisteredPrefix CreateOrUpdate(this IRegisteredPrefixesOperations operations, string resourceGroupName, string peeringName, string registeredPrefixName, string prefix = default(string)) + { + return operations.CreateOrUpdateAsync(resourceGroupName, peeringName, registeredPrefixName, prefix).GetAwaiter().GetResult(); + } + + /// + /// Creates a new registered prefix with the specified name under the given + /// subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// The customer's prefix from which traffic originates. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IRegisteredPrefixesOperations operations, string resourceGroupName, string peeringName, string registeredPrefixName, string prefix = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, peeringName, registeredPrefixName, prefix, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes an existing registered prefix with the specified name under the + /// given subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + public static void Delete(this IRegisteredPrefixesOperations operations, string resourceGroupName, string peeringName, string registeredPrefixName) + { + operations.DeleteAsync(resourceGroupName, peeringName, registeredPrefixName).GetAwaiter().GetResult(); + } + + /// + /// Deletes an existing registered prefix with the specified name under the + /// given subscription, resource group and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The name of the registered prefix. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IRegisteredPrefixesOperations operations, string resourceGroupName, string peeringName, string registeredPrefixName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, peeringName, registeredPrefixName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all registered prefixes under the given subscription, resource group + /// and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + public static IPage ListByPeering(this IRegisteredPrefixesOperations operations, string resourceGroupName, string peeringName) + { + return operations.ListByPeeringAsync(resourceGroupName, peeringName).GetAwaiter().GetResult(); + } + + /// + /// Lists all registered prefixes under the given subscription, resource group + /// and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the peering. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByPeeringAsync(this IRegisteredPrefixesOperations operations, string resourceGroupName, string peeringName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByPeeringWithHttpMessagesAsync(resourceGroupName, peeringName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all registered prefixes under the given subscription, resource group + /// and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByPeeringNext(this IRegisteredPrefixesOperations operations, string nextPageLink) + { + return operations.ListByPeeringNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all registered prefixes under the given subscription, resource group + /// and peering. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByPeeringNextAsync(this IRegisteredPrefixesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByPeeringNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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..a5fdbbbf0e5b --- /dev/null +++ b/sdk/peering/Microsoft.Azure.Management.Peering/src/Generated/SdkInfo_PeeringManagementClient.cs @@ -0,0 +1,39 @@ + +// +// Code generated 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", "2020-01-01-preview"), + new Tuple("Peering", "LegacyPeerings", "2020-01-01-preview"), + new Tuple("Peering", "Operations", "2020-01-01-preview"), + new Tuple("Peering", "PeerAsns", "2020-01-01-preview"), + new Tuple("Peering", "PeeringLocations", "2020-01-01-preview"), + new Tuple("Peering", "PeeringServiceCountries", "2020-01-01-preview"), + new Tuple("Peering", "PeeringServiceLocations", "2020-01-01-preview"), + new Tuple("Peering", "PeeringServiceProviders", "2020-01-01-preview"), + new Tuple("Peering", "PeeringServices", "2020-01-01-preview"), + new Tuple("Peering", "Peerings", "2020-01-01-preview"), + new Tuple("Peering", "Prefixes", "2020-01-01-preview"), + new Tuple("Peering", "RegisteredAsns", "2020-01-01-preview"), + new Tuple("Peering", "RegisteredPrefixes", "2020-01-01-preview"), + }.AsEnumerable(); + } + } + } +}