diff --git a/sdk/peering/Azure.ResourceManager.Peering/api/Azure.ResourceManager.Peering.netstandard2.0.cs b/sdk/peering/Azure.ResourceManager.Peering/api/Azure.ResourceManager.Peering.netstandard2.0.cs index cb2ac46344cf..e80310b920cd 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/api/Azure.ResourceManager.Peering.netstandard2.0.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/api/Azure.ResourceManager.Peering.netstandard2.0.cs @@ -241,6 +241,8 @@ protected PeeringResource() { } public virtual Azure.ResourceManager.Peering.PeeringRegisteredPrefixCollection GetPeeringRegisteredPrefixes() { throw null; } public virtual Azure.Pageable GetReceivedRoutes(string prefix = null, string asPath = null, string originAsValidationState = null, string rpkiValidationState = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetReceivedRoutesAsync(string prefix = null, string asPath = null, string originAsValidationState = null, string rpkiValidationState = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetRpUnbilledPrefixes(bool? consolidate = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetRpUnbilledPrefixesAsync(bool? consolidate = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -944,4 +946,11 @@ public PeeringSku() { } public static bool operator !=(Azure.ResourceManager.Peering.Models.PeeringTier left, Azure.ResourceManager.Peering.Models.PeeringTier right) { throw null; } public override string ToString() { throw null; } } + public partial class RpUnbilledPrefix + { + internal RpUnbilledPrefix() { } + public string AzureRegion { get { throw null; } } + public int? PeerAsn { get { throw null; } } + public string Prefix { get { throw null; } } + } } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/ConnectionMonitorTestListResult.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/ConnectionMonitorTestListResult.cs index f0f37f3c3d77..1d81bb78db5e 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/ConnectionMonitorTestListResult.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/ConnectionMonitorTestListResult.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Peering.Models { - /// The paginated list of [T]. + /// The paginated list of Connection Monitor Tests. internal partial class ConnectionMonitorTestListResult { /// Initializes a new instance of ConnectionMonitorTestListResult. @@ -21,17 +21,17 @@ internal ConnectionMonitorTestListResult() } /// Initializes a new instance of ConnectionMonitorTestListResult. - /// The list of [T]. - /// The link to fetch the next page of [T]. + /// The list of Connection Monitor Tests. + /// The link to fetch the next page of Connection Monitor Tests. internal ConnectionMonitorTestListResult(IReadOnlyList value, string nextLink) { Value = value; NextLink = nextLink; } - /// The list of [T]. + /// The list of Connection Monitor Tests. public IReadOnlyList Value { get; } - /// The link to fetch the next page of [T]. + /// The link to fetch the next page of Connection Monitor Tests. public string NextLink { get; } } } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefix.Serialization.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefix.Serialization.cs new file mode 100644 index 000000000000..47f3e515d270 --- /dev/null +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefix.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Peering.Models +{ + public partial class RpUnbilledPrefix + { + internal static RpUnbilledPrefix DeserializeRpUnbilledPrefix(JsonElement element) + { + Optional prefix = default; + Optional azureRegion = default; + Optional peerAsn = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("prefix")) + { + prefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureRegion")) + { + azureRegion = property.Value.GetString(); + continue; + } + if (property.NameEquals("peerAsn")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + peerAsn = property.Value.GetInt32(); + continue; + } + } + return new RpUnbilledPrefix(prefix.Value, azureRegion.Value, Optional.ToNullable(peerAsn)); + } + } +} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefix.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefix.cs new file mode 100644 index 000000000000..34d93a55da91 --- /dev/null +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefix.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Peering.Models +{ + /// The Routing Preference unbilled prefix. + public partial class RpUnbilledPrefix + { + /// Initializes a new instance of RpUnbilledPrefix. + internal RpUnbilledPrefix() + { + } + + /// Initializes a new instance of RpUnbilledPrefix. + /// The prefix. + /// The Azure region. + /// The peer ASN. + internal RpUnbilledPrefix(string prefix, string azureRegion, int? peerAsn) + { + Prefix = prefix; + AzureRegion = azureRegion; + PeerAsn = peerAsn; + } + + /// The prefix. + public string Prefix { get; } + /// The Azure region. + public string AzureRegion { get; } + /// The peer ASN. + public int? PeerAsn { get; } + } +} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefixListResult.Serialization.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefixListResult.Serialization.cs new file mode 100644 index 000000000000..b0a0a579b708 --- /dev/null +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefixListResult.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Peering.Models +{ + internal partial class RpUnbilledPrefixListResult + { + internal static RpUnbilledPrefixListResult DeserializeRpUnbilledPrefixListResult(JsonElement element) + { + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RpUnbilledPrefix.DeserializeRpUnbilledPrefix(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new RpUnbilledPrefixListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefixListResult.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefixListResult.cs new file mode 100644 index 000000000000..55aef8809203 --- /dev/null +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/Models/RpUnbilledPrefixListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Peering.Models +{ + /// The paginated list of RP unbilled prefixes. + internal partial class RpUnbilledPrefixListResult + { + /// Initializes a new instance of RpUnbilledPrefixListResult. + internal RpUnbilledPrefixListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of RpUnbilledPrefixListResult. + /// The list of RP unbilled prefixes. + /// The link to fetch the next page of RP unbilled prefixes. + internal RpUnbilledPrefixListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The list of RP unbilled prefixes. + public IReadOnlyList Value { get; } + /// The link to fetch the next page of RP unbilled prefixes. + public string NextLink { get; } + } +} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringResource.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringResource.cs index 202db73da9c6..e09599012af3 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringResource.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/PeeringResource.cs @@ -38,6 +38,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly PeeringsRestOperations _peeringRestClient; private readonly ClientDiagnostics _receivedRoutesClientDiagnostics; private readonly ReceivedRoutesRestOperations _receivedRoutesRestClient; + private readonly ClientDiagnostics _rpUnbilledPrefixesClientDiagnostics; + private readonly RpUnbilledPrefixesRestOperations _rpUnbilledPrefixesRestClient; private readonly PeeringData _data; /// Initializes a new instance of the class for mocking. @@ -64,6 +66,8 @@ internal PeeringResource(ArmClient client, ResourceIdentifier id) : base(client, _peeringRestClient = new PeeringsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, peeringApiVersion); _receivedRoutesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Peering", ProviderConstants.DefaultProviderNamespace, Diagnostics); _receivedRoutesRestClient = new ReceivedRoutesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _rpUnbilledPrefixesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Peering", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _rpUnbilledPrefixesRestClient = new RpUnbilledPrefixesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -413,6 +417,92 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } + /// + /// Lists all of the RP unbilled prefixes for the specified peering + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/rpUnbilledPrefixes + /// Operation Id: RpUnbilledPrefixes_List + /// + /// Flag to enable consolidation prefixes. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetRpUnbilledPrefixesAsync(bool? consolidate = null, CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _rpUnbilledPrefixesClientDiagnostics.CreateScope("PeeringResource.GetRpUnbilledPrefixes"); + scope.Start(); + try + { + var response = await _rpUnbilledPrefixesRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, consolidate, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _rpUnbilledPrefixesClientDiagnostics.CreateScope("PeeringResource.GetRpUnbilledPrefixes"); + scope.Start(); + try + { + var response = await _rpUnbilledPrefixesRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, consolidate, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Lists all of the RP unbilled prefixes for the specified peering + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/rpUnbilledPrefixes + /// Operation Id: RpUnbilledPrefixes_List + /// + /// Flag to enable consolidation prefixes. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetRpUnbilledPrefixes(bool? consolidate = null, CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _rpUnbilledPrefixesClientDiagnostics.CreateScope("PeeringResource.GetRpUnbilledPrefixes"); + scope.Start(); + try + { + var response = _rpUnbilledPrefixesRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, consolidate, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _rpUnbilledPrefixesClientDiagnostics.CreateScope("PeeringResource.GetRpUnbilledPrefixes"); + scope.Start(); + try + { + var response = _rpUnbilledPrefixesRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, consolidate, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + /// /// Add a tag to the current resource. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/CdnPeeringPrefixesRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/CdnPeeringPrefixesRestOperations.cs index d37fec94da28..5596f3484825 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/CdnPeeringPrefixesRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/CdnPeeringPrefixesRestOperations.cs @@ -33,7 +33,7 @@ public CdnPeeringPrefixesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/ConnectionMonitorTestsRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/ConnectionMonitorTestsRestOperations.cs index a124a9694547..8a39786d9e8d 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/ConnectionMonitorTestsRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/ConnectionMonitorTestsRestOperations.cs @@ -33,7 +33,7 @@ public ConnectionMonitorTestsRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/LegacyPeeringsRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/LegacyPeeringsRestOperations.cs index 865895e851d7..9f459f082088 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/LegacyPeeringsRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/LegacyPeeringsRestOperations.cs @@ -33,7 +33,7 @@ public LegacyPeeringsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/LookingGlassRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/LookingGlassRestOperations.cs index bf1abec58b70..b2b5bd0f7e28 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/LookingGlassRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/LookingGlassRestOperations.cs @@ -33,7 +33,7 @@ public LookingGlassRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeerAsnsRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeerAsnsRestOperations.cs index f43d860011b9..f6722177e170 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeerAsnsRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeerAsnsRestOperations.cs @@ -33,7 +33,7 @@ public PeerAsnsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringLocationsRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringLocationsRestOperations.cs index f8a06f1960aa..80e7c5cd59e0 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringLocationsRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringLocationsRestOperations.cs @@ -33,7 +33,7 @@ public PeeringLocationsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringManagementRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringManagementRestOperations.cs index f0afecd0aacd..c37969ab6b84 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringManagementRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringManagementRestOperations.cs @@ -33,7 +33,7 @@ public PeeringManagementRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceCountriesRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceCountriesRestOperations.cs index b770017e6bc1..8f31c2ca7b3e 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceCountriesRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceCountriesRestOperations.cs @@ -33,7 +33,7 @@ public PeeringServiceCountriesRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceLocationsRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceLocationsRestOperations.cs index 3e43a3a6fbf7..597af901bc84 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceLocationsRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceLocationsRestOperations.cs @@ -33,7 +33,7 @@ public PeeringServiceLocationsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceProvidersRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceProvidersRestOperations.cs index 2018fbb8a86e..49e6b046fced 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceProvidersRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServiceProvidersRestOperations.cs @@ -33,7 +33,7 @@ public PeeringServiceProvidersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServicesRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServicesRestOperations.cs index 2f357bc0102e..47bc18182589 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServicesRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringServicesRestOperations.cs @@ -33,7 +33,7 @@ public PeeringServicesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringsRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringsRestOperations.cs index fa9758f37e4e..c0e34bfcc6bf 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringsRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PeeringsRestOperations.cs @@ -33,7 +33,7 @@ public PeeringsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PrefixesRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PrefixesRestOperations.cs index 91f80ce75219..08d86c83af4e 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PrefixesRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/PrefixesRestOperations.cs @@ -33,7 +33,7 @@ public PrefixesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/ReceivedRoutesRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/ReceivedRoutesRestOperations.cs index 031adfe1f9e1..3d97d0d48f95 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/ReceivedRoutesRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/ReceivedRoutesRestOperations.cs @@ -33,7 +33,7 @@ public ReceivedRoutesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RegisteredAsnsRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RegisteredAsnsRestOperations.cs index 4c7a8216ff27..1bc51439299d 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RegisteredAsnsRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RegisteredAsnsRestOperations.cs @@ -33,7 +33,7 @@ public RegisteredAsnsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RegisteredPrefixesRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RegisteredPrefixesRestOperations.cs index b03588a91d43..51b862b9e563 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RegisteredPrefixesRestOperations.cs +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RegisteredPrefixesRestOperations.cs @@ -33,7 +33,7 @@ public RegisteredPrefixesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-06-01"; + _apiVersion = apiVersion ?? "2022-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RpUnbilledPrefixesRestOperations.cs b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RpUnbilledPrefixesRestOperations.cs new file mode 100644 index 000000000000..f729cf828750 --- /dev/null +++ b/sdk/peering/Azure.ResourceManager.Peering/src/Generated/RestOperations/RpUnbilledPrefixesRestOperations.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Peering.Models; + +namespace Azure.ResourceManager.Peering +{ + internal partial class RpUnbilledPrefixesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RpUnbilledPrefixesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RpUnbilledPrefixesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-10-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string peeringName, bool? consolidate) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Peering/peerings/", false); + uri.AppendPath(peeringName, true); + uri.AppendPath("/rpUnbilledPrefixes", false); + if (consolidate != null) + { + uri.AppendQuery("consolidate", consolidate.Value, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all of the RP unbilled prefixes for the specified peering. + /// The Azure subscription ID. + /// The Azure resource group name. + /// The peering name. + /// Flag to enable consolidation prefixes. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string peeringName, bool? consolidate = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(peeringName, nameof(peeringName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, peeringName, consolidate); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RpUnbilledPrefixListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RpUnbilledPrefixListResult.DeserializeRpUnbilledPrefixListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all of the RP unbilled prefixes for the specified peering. + /// The Azure subscription ID. + /// The Azure resource group name. + /// The peering name. + /// Flag to enable consolidation prefixes. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string peeringName, bool? consolidate = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(peeringName, nameof(peeringName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, peeringName, consolidate); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RpUnbilledPrefixListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RpUnbilledPrefixListResult.DeserializeRpUnbilledPrefixListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string peeringName, bool? consolidate) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all of the RP unbilled prefixes for the specified peering. + /// The URL to the next page of results. + /// The Azure subscription ID. + /// The Azure resource group name. + /// The peering name. + /// Flag to enable consolidation prefixes. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string peeringName, bool? consolidate = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(peeringName, nameof(peeringName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, peeringName, consolidate); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RpUnbilledPrefixListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RpUnbilledPrefixListResult.DeserializeRpUnbilledPrefixListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all of the RP unbilled prefixes for the specified peering. + /// The URL to the next page of results. + /// The Azure subscription ID. + /// The Azure resource group name. + /// The peering name. + /// Flag to enable consolidation prefixes. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string peeringName, bool? consolidate = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(peeringName, nameof(peeringName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, peeringName, consolidate); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RpUnbilledPrefixListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RpUnbilledPrefixListResult.DeserializeRpUnbilledPrefixListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/peering/Azure.ResourceManager.Peering/src/autorest.md b/sdk/peering/Azure.ResourceManager.Peering/src/autorest.md index a8ff15badcf8..8c0035f4143f 100644 --- a/sdk/peering/Azure.ResourceManager.Peering/src/autorest.md +++ b/sdk/peering/Azure.ResourceManager.Peering/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Peering namespace: Azure.ResourceManager.Peering -require: https://github.com/Azure/azure-rest-api-specs/blob/aa8a23b8f92477d0fdce7af6ccffee1c604b3c56/specification/peering/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/peering/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true