From 52c9adb42064e536ecd22079f9b519297052d4d7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Jun 2021 05:00:24 +0000 Subject: [PATCH] CodeGen from PR 15004 in Azure/azure-rest-api-specs Merge 6499299d6c461b8efb750d5850f0e59ac7acdcea into 25af5c1c0fae2bc594c1932445d06209745f5917 --- .../CHANGELOG.md | 3 +- .../azure-resourcemanager-peering/README.md | 16 +- .../azure-resourcemanager-peering/pom.xml | 141 +-- .../peering/PeeringManager.java | 96 +- .../fluent/CdnPeeringPrefixesClient.java | 39 - .../peering/fluent/LegacyPeeringsClient.java | 3 +- .../fluent/PeeringManagementClient.java | 40 +- .../fluent/PeeringServiceCountriesClient.java | 36 - .../fluent/PeeringServiceLocationsClient.java | 7 +- .../fluent/PeeringServicePrefixesClient.java | 113 +++ .../peering/fluent/PrefixesClient.java | 124 +-- .../peering/fluent/ReceivedRoutesClient.java | 54 - .../peering/fluent/RegisteredAsnsClient.java | 146 --- .../fluent/RegisteredPrefixesClient.java | 148 --- .../fluent/models/CdnPeeringPrefixInner.java | 102 -- .../peering/fluent/models/PeerAsnInner.java | 44 +- .../models/PeeringReceivedRouteInner.java | 133 --- .../models/PeeringRegisteredAsnInner.java | 84 -- .../models/PeeringRegisteredPrefixInner.java | 115 --- .../models/PeeringServiceCountryInner.java | 24 - .../fluent/models/PeeringServiceInner.java | 100 +- .../models/PeeringServiceLocationInner.java | 2 +- .../models/PeeringServicePrefixInner.java | 77 +- .../models/PeeringServiceProviderInner.java | 28 - .../implementation/CdnPeeringPrefixImpl.java | 60 -- .../CdnPeeringPrefixesClientImpl.java | 316 ------ .../CdnPeeringPrefixesImpl.java | 46 - .../LegacyPeeringsClientImpl.java | 45 +- .../implementation/LegacyPeeringsImpl.java | 4 +- .../peering/implementation/PeerAsnImpl.java | 21 +- .../PeeringManagementClientImpl.java | 86 +- .../PeeringReceivedRouteImpl.java | 56 -- .../PeeringRegisteredAsnImpl.java | 149 --- .../PeeringRegisteredPrefixImpl.java | 158 --- .../PeeringServiceCountriesClientImpl.java | 295 ------ .../PeeringServiceCountriesImpl.java | 46 - .../PeeringServiceCountryImpl.java | 40 - .../implementation/PeeringServiceImpl.java | 28 - .../PeeringServiceLocationsClientImpl.java | 52 +- .../PeeringServiceLocationsImpl.java | 4 +- .../PeeringServicePrefixImpl.java | 47 +- .../PeeringServicePrefixesClientImpl.java | 635 ++++++++++++ ...l.java => PeeringServicePrefixesImpl.java} | 130 ++- .../PeeringServiceProviderImpl.java | 11 - .../implementation/PrefixesClientImpl.java | 718 +------------- .../peering/implementation/PrefixesImpl.java | 154 +-- .../ReceivedRoutesClientImpl.java | 482 --------- .../implementation/ReceivedRoutesImpl.java | 66 -- .../RegisteredAsnsClientImpl.java | 924 ----------------- .../RegisteredPrefixesClientImpl.java | 931 ------------------ .../RegisteredPrefixesImpl.java | 201 ---- .../peering/models/BgpSession.java | 26 +- .../peering/models/CdnPeeringPrefix.java | 73 -- .../models/CdnPeeringPrefixListResult.java | 81 -- .../peering/models/CdnPeeringPrefixes.java | 34 - ...CheckServiceProviderAvailabilityInput.java | 12 +- .../peering/models/ContactDetail.java | 102 -- .../peering/models/ContactInfo.java | 77 ++ .../peering/models/DirectConnection.java | 45 +- .../peering/models/DirectPeeringType.java | 6 - .../resourcemanager/peering/models/Enum0.java | 4 +- .../peering/models/ExchangeConnection.java | 15 - .../peering/models/LearnedType.java | 4 +- .../peering/models/LegacyPeerings.java | 3 +- .../resourcemanager/peering/models/Name.java | 46 + .../peering/models/PeerAsn.java | 38 +- .../PeeringLocationsDirectPeeringType.java | 6 - .../models/PeeringPropertiesDirect.java | 14 +- .../peering/models/PeeringReceivedRoute.java | 68 -- .../PeeringReceivedRouteListResult.java | 81 -- .../peering/models/PeeringRegisteredAsn.java | 163 --- .../PeeringRegisteredAsnListResult.java | 81 -- .../models/PeeringRegisteredPrefix.java | 177 ---- .../PeeringRegisteredPrefixListResult.java | 81 -- .../peering/models/PeeringService.java | 74 +- .../models/PeeringServiceCountries.java | 31 - .../peering/models/PeeringServiceCountry.java | 38 - .../PeeringServiceCountryListResult.java | 81 -- .../models/PeeringServiceLocations.java | 7 +- .../peering/models/PeeringServicePrefix.java | 84 +- .../models/PeeringServicePrefixEvent.java | 100 -- .../PeeringServicePrefixListResult.java | 14 +- .../models/PeeringServicePrefixes.java | 119 +++ .../models/PeeringServiceProvider.java | 8 - .../peering/models/PeeringServiceSku.java | 50 - .../peering/models/PeeringSku.java | 6 +- .../peering/models/PrefixValidationState.java | 3 - .../peering/models/Prefixes.java | 138 +-- .../peering/models/ReceivedRoutes.java | 49 - .../peering/models/RegisteredAsns.java | 153 --- .../peering/models/RegisteredPrefixes.java | 157 --- .../resourcemanager/peering/models/Role.java | 46 - 92 files changed, 1450 insertions(+), 8325 deletions(-) delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/CdnPeeringPrefixesClient.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceCountriesClient.java create mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServicePrefixesClient.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ReceivedRoutesClient.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/RegisteredAsnsClient.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/RegisteredPrefixesClient.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/CdnPeeringPrefixInner.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringReceivedRouteInner.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredAsnInner.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixInner.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceCountryInner.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesClientImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringReceivedRouteImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringRegisteredAsnImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringRegisteredPrefixImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountriesClientImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountriesImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountryImpl.java create mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixesClientImpl.java rename sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/{RegisteredAsnsImpl.java => PeeringServicePrefixesImpl.java} (52%) delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ReceivedRoutesClientImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ReceivedRoutesImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredAsnsClientImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredPrefixesClientImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredPrefixesImpl.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefix.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefixListResult.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefixes.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ContactDetail.java create mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ContactInfo.java create mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Name.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringReceivedRoute.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringReceivedRouteListResult.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredAsn.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredAsnListResult.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredPrefix.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredPrefixListResult.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountries.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountry.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountryListResult.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixEvent.java create mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixes.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceSku.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ReceivedRoutes.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/RegisteredAsns.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/RegisteredPrefixes.java delete mode 100644 sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Role.java diff --git a/sdk/peering/azure-resourcemanager-peering/CHANGELOG.md b/sdk/peering/azure-resourcemanager-peering/CHANGELOG.md index f85a9a1a1873..e024bb77d002 100644 --- a/sdk/peering/azure-resourcemanager-peering/CHANGELOG.md +++ b/sdk/peering/azure-resourcemanager-peering/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-06-28) +- Azure Resource Manager Peering client library for Java. This package contains Microsoft Azure SDK for Peering Management SDK. Peering Client. Package tag package-2019-08-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-19) diff --git a/sdk/peering/azure-resourcemanager-peering/README.md b/sdk/peering/azure-resourcemanager-peering/README.md index 56a50976a791..6c282ac53695 100644 --- a/sdk/peering/azure-resourcemanager-peering/README.md +++ b/sdk/peering/azure-resourcemanager-peering/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Peering client library for Java. -This package contains Microsoft Azure SDK for Peering Management SDK. Peering Client. Package tag package-2021-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Peering Management SDK. Peering Client. Package tag package-2019-08-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-peering - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,13 +74,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). 1. Fork it 1. Create your feature branch (`git checkout -b my-new-feature`) @@ -93,7 +95,7 @@ For details on contributing to this repository, see the [contributing guide](htt [docs]: https://azure.github.io/azure-sdk-for-java/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/peering/azure-resourcemanager-peering/pom.xml b/sdk/peering/azure-resourcemanager-peering/pom.xml index f59992bf6410..3c1ced826d4e 100644 --- a/sdk/peering/azure-resourcemanager-peering/pom.xml +++ b/sdk/peering/azure-resourcemanager-peering/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-peering - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-peering + 1.0.0-beta.2 + jar - Microsoft Azure SDK for Peering Management - This package contains Microsoft Azure SDK for Peering Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Peering Client. Package tag package-2021-01-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for Peering Management + This package contains Microsoft Azure SDK for Peering Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Peering Client. Package tag package-2019-08-01-preview. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.17.0 - - - com.azure - azure-core-management - 1.3.0 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/PeeringManager.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/PeeringManager.java index f06d8a6805ce..aba888cd69d5 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/PeeringManager.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/PeeringManager.java @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,40 +16,33 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.peering.fluent.PeeringManagementClient; -import com.azure.resourcemanager.peering.implementation.CdnPeeringPrefixesImpl; import com.azure.resourcemanager.peering.implementation.LegacyPeeringsImpl; import com.azure.resourcemanager.peering.implementation.OperationsImpl; import com.azure.resourcemanager.peering.implementation.PeerAsnsImpl; import com.azure.resourcemanager.peering.implementation.PeeringLocationsImpl; import com.azure.resourcemanager.peering.implementation.PeeringManagementClientBuilder; -import com.azure.resourcemanager.peering.implementation.PeeringServiceCountriesImpl; import com.azure.resourcemanager.peering.implementation.PeeringServiceLocationsImpl; +import com.azure.resourcemanager.peering.implementation.PeeringServicePrefixesImpl; import com.azure.resourcemanager.peering.implementation.PeeringServiceProvidersImpl; import com.azure.resourcemanager.peering.implementation.PeeringServicesImpl; import com.azure.resourcemanager.peering.implementation.PeeringsImpl; import com.azure.resourcemanager.peering.implementation.PrefixesImpl; -import com.azure.resourcemanager.peering.implementation.ReceivedRoutesImpl; -import com.azure.resourcemanager.peering.implementation.RegisteredAsnsImpl; -import com.azure.resourcemanager.peering.implementation.RegisteredPrefixesImpl; import com.azure.resourcemanager.peering.implementation.ResourceProvidersImpl; -import com.azure.resourcemanager.peering.models.CdnPeeringPrefixes; import com.azure.resourcemanager.peering.models.LegacyPeerings; import com.azure.resourcemanager.peering.models.Operations; import com.azure.resourcemanager.peering.models.PeerAsns; import com.azure.resourcemanager.peering.models.PeeringLocations; -import com.azure.resourcemanager.peering.models.PeeringServiceCountries; import com.azure.resourcemanager.peering.models.PeeringServiceLocations; +import com.azure.resourcemanager.peering.models.PeeringServicePrefixes; import com.azure.resourcemanager.peering.models.PeeringServiceProviders; import com.azure.resourcemanager.peering.models.PeeringServices; import com.azure.resourcemanager.peering.models.Peerings; import com.azure.resourcemanager.peering.models.Prefixes; -import com.azure.resourcemanager.peering.models.ReceivedRoutes; -import com.azure.resourcemanager.peering.models.RegisteredAsns; -import com.azure.resourcemanager.peering.models.RegisteredPrefixes; import com.azure.resourcemanager.peering.models.ResourceProviders; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -60,8 +52,6 @@ /** Entry point to PeeringManager. Peering Client. */ public final class PeeringManager { - private CdnPeeringPrefixes cdnPeeringPrefixes; - private ResourceProviders resourceProviders; private LegacyPeerings legacyPeerings; @@ -72,18 +62,12 @@ public final class PeeringManager { private PeeringLocations peeringLocations; - private RegisteredAsns registeredAsns; - - private RegisteredPrefixes registeredPrefixes; - private Peerings peerings; - private ReceivedRoutes receivedRoutes; - - private PeeringServiceCountries peeringServiceCountries; - private PeeringServiceLocations peeringServiceLocations; + private PeeringServicePrefixes peeringServicePrefixes; + private Prefixes prefixes; private PeeringServiceProviders peeringServiceProviders; @@ -133,6 +117,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -172,6 +157,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -228,6 +224,9 @@ public PeeringManager authenticate(TokenCredential credential, AzureProfile prof userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -237,10 +236,7 @@ public PeeringManager authenticate(TokenCredential credential, AzureProfile prof HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); @@ -253,14 +249,6 @@ public PeeringManager authenticate(TokenCredential credential, AzureProfile prof } } - /** @return Resource collection API of CdnPeeringPrefixes. */ - public CdnPeeringPrefixes cdnPeeringPrefixes() { - if (this.cdnPeeringPrefixes == null) { - this.cdnPeeringPrefixes = new CdnPeeringPrefixesImpl(clientObject.getCdnPeeringPrefixes(), this); - } - return cdnPeeringPrefixes; - } - /** @return Resource collection API of ResourceProviders. */ public ResourceProviders resourceProviders() { if (this.resourceProviders == null) { @@ -301,22 +289,6 @@ public PeeringLocations peeringLocations() { return peeringLocations; } - /** @return Resource collection API of RegisteredAsns. */ - public RegisteredAsns registeredAsns() { - if (this.registeredAsns == null) { - this.registeredAsns = new RegisteredAsnsImpl(clientObject.getRegisteredAsns(), this); - } - return registeredAsns; - } - - /** @return Resource collection API of RegisteredPrefixes. */ - public RegisteredPrefixes registeredPrefixes() { - if (this.registeredPrefixes == null) { - this.registeredPrefixes = new RegisteredPrefixesImpl(clientObject.getRegisteredPrefixes(), this); - } - return registeredPrefixes; - } - /** @return Resource collection API of Peerings. */ public Peerings peerings() { if (this.peerings == null) { @@ -325,23 +297,6 @@ public Peerings peerings() { return peerings; } - /** @return Resource collection API of ReceivedRoutes. */ - public ReceivedRoutes receivedRoutes() { - if (this.receivedRoutes == null) { - this.receivedRoutes = new ReceivedRoutesImpl(clientObject.getReceivedRoutes(), this); - } - return receivedRoutes; - } - - /** @return Resource collection API of PeeringServiceCountries. */ - public PeeringServiceCountries peeringServiceCountries() { - if (this.peeringServiceCountries == null) { - this.peeringServiceCountries = - new PeeringServiceCountriesImpl(clientObject.getPeeringServiceCountries(), this); - } - return peeringServiceCountries; - } - /** @return Resource collection API of PeeringServiceLocations. */ public PeeringServiceLocations peeringServiceLocations() { if (this.peeringServiceLocations == null) { @@ -351,6 +306,15 @@ public PeeringServiceLocations peeringServiceLocations() { return peeringServiceLocations; } + /** @return Resource collection API of PeeringServicePrefixes. */ + public PeeringServicePrefixes peeringServicePrefixes() { + if (this.peeringServicePrefixes == null) { + this.peeringServicePrefixes = + new PeeringServicePrefixesImpl(clientObject.getPeeringServicePrefixes(), this); + } + return peeringServicePrefixes; + } + /** @return Resource collection API of Prefixes. */ public Prefixes prefixes() { if (this.prefixes == null) { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/CdnPeeringPrefixesClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/CdnPeeringPrefixesClient.java deleted file mode 100644 index 50ed5b9c39aa..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/CdnPeeringPrefixesClient.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.CdnPeeringPrefixInner; - -/** An instance of this class provides access to all the operations defined in CdnPeeringPrefixesClient. */ -public interface CdnPeeringPrefixesClient { - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String peeringLocation); - - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String peeringLocation, Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LegacyPeeringsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LegacyPeeringsClient.java index c8cba0bec65e..44bc1b9315e3 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LegacyPeeringsClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LegacyPeeringsClient.java @@ -31,7 +31,6 @@ public interface LegacyPeeringsClient { * * @param peeringLocation The location of the peering. * @param kind The kind of the peering. - * @param asn The ASN number associated with a legacy peering. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -39,5 +38,5 @@ public interface LegacyPeeringsClient { * @return the paginated list of peerings. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context); + PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringManagementClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringManagementClient.java index 70c527cbb0ea..91da6d848e04 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringManagementClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringManagementClient.java @@ -44,13 +44,6 @@ public interface PeeringManagementClient { */ Duration getDefaultPollInterval(); - /** - * Gets the CdnPeeringPrefixesClient object to access its operations. - * - * @return the CdnPeeringPrefixesClient object. - */ - CdnPeeringPrefixesClient getCdnPeeringPrefixes(); - /** * Gets the ResourceProvidersClient object to access its operations. * @@ -86,20 +79,6 @@ public interface PeeringManagementClient { */ PeeringLocationsClient getPeeringLocations(); - /** - * Gets the RegisteredAsnsClient object to access its operations. - * - * @return the RegisteredAsnsClient object. - */ - RegisteredAsnsClient getRegisteredAsns(); - - /** - * Gets the RegisteredPrefixesClient object to access its operations. - * - * @return the RegisteredPrefixesClient object. - */ - RegisteredPrefixesClient getRegisteredPrefixes(); - /** * Gets the PeeringsClient object to access its operations. * @@ -108,25 +87,18 @@ public interface PeeringManagementClient { PeeringsClient getPeerings(); /** - * Gets the ReceivedRoutesClient object to access its operations. - * - * @return the ReceivedRoutesClient object. - */ - ReceivedRoutesClient getReceivedRoutes(); - - /** - * Gets the PeeringServiceCountriesClient object to access its operations. + * Gets the PeeringServiceLocationsClient object to access its operations. * - * @return the PeeringServiceCountriesClient object. + * @return the PeeringServiceLocationsClient object. */ - PeeringServiceCountriesClient getPeeringServiceCountries(); + PeeringServiceLocationsClient getPeeringServiceLocations(); /** - * Gets the PeeringServiceLocationsClient object to access its operations. + * Gets the PeeringServicePrefixesClient object to access its operations. * - * @return the PeeringServiceLocationsClient object. + * @return the PeeringServicePrefixesClient object. */ - PeeringServiceLocationsClient getPeeringServiceLocations(); + PeeringServicePrefixesClient getPeeringServicePrefixes(); /** * Gets the PrefixesClient object to access its operations. diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceCountriesClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceCountriesClient.java deleted file mode 100644 index 83b9d54e207f..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceCountriesClient.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.PeeringServiceCountryInner; - -/** An instance of this class provides access to all the operations defined in PeeringServiceCountriesClient. */ -public interface PeeringServiceCountriesClient { - /** - * Lists all of the available countries for peering service. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all of the available countries for peering service. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceLocationsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceLocationsClient.java index 69f837fdd14c..4eb5a2609ab9 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceLocationsClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceLocationsClient.java @@ -13,7 +13,7 @@ /** An instance of this class provides access to all the operations defined in PeeringServiceLocationsClient. */ public interface PeeringServiceLocationsClient { /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -23,9 +23,8 @@ public interface PeeringServiceLocationsClient { PagedIterable list(); /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * - * @param country The country of interest, in which the locations are to be present. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -33,5 +32,5 @@ public interface PeeringServiceLocationsClient { * @return the paginated list of peering service locations. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String country, Context context); + PagedIterable list(Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServicePrefixesClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServicePrefixesClient.java new file mode 100644 index 000000000000..ea07d29052ab --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServicePrefixesClient.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.peering.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner; + +/** An instance of this class provides access to all the operations defined in PeeringServicePrefixesClient. */ +public interface PeeringServicePrefixesClient { + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeeringServicePrefixInner get(String resourceGroupName, String peeringServiceName, String prefixName); + + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String peeringServiceName, String prefixName, Context context); + + /** + * Creates or updates the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param peeringServicePrefix The IP prefix for an peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeeringServicePrefixInner createOrUpdate( + String resourceGroupName, + String peeringServiceName, + String prefixName, + PeeringServicePrefixInner peeringServicePrefix); + + /** + * Creates or updates the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param peeringServicePrefix The IP prefix for an peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String peeringServiceName, + String prefixName, + PeeringServicePrefixInner peeringServicePrefix, + Context context); + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String peeringServiceName, String prefixName); + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String peeringServiceName, String prefixName, Context context); +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PrefixesClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PrefixesClient.java index ab6755d21576..0722cb0ff5b4 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PrefixesClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PrefixesClient.java @@ -7,142 +7,36 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner; /** An instance of this class provides access to all the operations defined in PrefixesClient. */ public interface PrefixesClient { /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PeeringServicePrefixInner get(String resourceGroupName, String peeringServiceName, String prefixName); - - /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param expand The properties to be expanded. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String peeringServiceName, String prefixName, String expand, Context context); - - /** - * Creates a new prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param peeringServicePrefix The properties needed to create a prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the peering service prefix class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PeeringServicePrefixInner createOrUpdate( - String resourceGroupName, - String peeringServiceName, - String prefixName, - PeeringServicePrefixInner peeringServicePrefix); - - /** - * Creates a new prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param peeringServicePrefix The properties needed to create a prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the peering service prefix class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String peeringServiceName, - String prefixName, - PeeringServicePrefixInner peeringServicePrefix, - Context context); - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String peeringServiceName, String prefixName); - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String peeringServiceName, String prefixName, Context context); - - /** - * Lists all prefixes under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeeringService(String resourceGroupName, String peeringServiceName); /** - * Lists all prefixes under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param expand The properties to be expanded. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeeringService( - String resourceGroupName, String peeringServiceName, String expand, Context context); + String resourceGroupName, String peeringServiceName, Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ReceivedRoutesClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ReceivedRoutesClient.java deleted file mode 100644 index 028c632042c3..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ReceivedRoutesClient.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.PeeringReceivedRouteInner; - -/** An instance of this class provides access to all the operations defined in ReceivedRoutesClient. */ -public interface ReceivedRoutesClient { - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPeering(String resourceGroupName, String peeringName); - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param prefix The optional prefix that can be used to filter the routes. - * @param asPath The optional AS path that can be used to filter the routes. - * @param originAsValidationState The optional origin AS validation state that can be used to filter the routes. - * @param rpkiValidationState The optional RPKI validation state that can be used to filter the routes. - * @param skipToken The optional page continuation token that is used in the event of paginated result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPeering( - String resourceGroupName, - String peeringName, - String prefix, - String asPath, - String originAsValidationState, - String rpkiValidationState, - String skipToken, - Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/RegisteredAsnsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/RegisteredAsnsClient.java deleted file mode 100644 index 36c7448d7392..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/RegisteredAsnsClient.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner; - -/** An instance of this class provides access to all the operations defined in RegisteredAsnsClient. */ -public interface RegisteredAsnsClient { - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PeeringRegisteredAsnInner get(String resourceGroupName, String peeringName, String registeredAsnName); - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String peeringName, String registeredAsnName, Context context); - - /** - * Creates a new registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the ASN. - * @param registeredAsn The properties needed to create a registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's ASN that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PeeringRegisteredAsnInner createOrUpdate( - String resourceGroupName, - String peeringName, - String registeredAsnName, - PeeringRegisteredAsnInner registeredAsn); - - /** - * Creates a new registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the ASN. - * @param registeredAsn The properties needed to create a registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's ASN that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String peeringName, - String registeredAsnName, - PeeringRegisteredAsnInner registeredAsn, - Context context); - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String peeringName, String registeredAsnName); - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String peeringName, String registeredAsnName, Context context); - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPeering(String resourceGroupName, String peeringName); - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPeering( - String resourceGroupName, String peeringName, Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/RegisteredPrefixesClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/RegisteredPrefixesClient.java deleted file mode 100644 index fb587e31173e..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/RegisteredPrefixesClient.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner; - -/** An instance of this class provides access to all the operations defined in RegisteredPrefixesClient. */ -public interface RegisteredPrefixesClient { - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PeeringRegisteredPrefixInner get(String resourceGroupName, String peeringName, String registeredPrefixName); - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context); - - /** - * Creates a new registered prefix with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param registeredPrefix The properties needed to create a registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's prefix that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PeeringRegisteredPrefixInner createOrUpdate( - String resourceGroupName, - String peeringName, - String registeredPrefixName, - PeeringRegisteredPrefixInner registeredPrefix); - - /** - * Creates a new registered prefix with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param registeredPrefix The properties needed to create a registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's prefix that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String peeringName, - String registeredPrefixName, - PeeringRegisteredPrefixInner registeredPrefix, - Context context); - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String peeringName, String registeredPrefixName); - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context); - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPeering(String resourceGroupName, String peeringName); - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByPeering( - String resourceGroupName, String peeringName, Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/CdnPeeringPrefixInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/CdnPeeringPrefixInner.java deleted file mode 100644 index aae2b0bb7dc9..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/CdnPeeringPrefixInner.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The CDN peering prefix. */ -@JsonFlatten -@Immutable -public class CdnPeeringPrefixInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CdnPeeringPrefixInner.class); - - /* - * The prefix. - */ - @JsonProperty(value = "properties.prefix", access = JsonProperty.Access.WRITE_ONLY) - private String prefix; - - /* - * The Azure region. - */ - @JsonProperty(value = "properties.azureRegion", access = JsonProperty.Access.WRITE_ONLY) - private String azureRegion; - - /* - * The Azure service. - */ - @JsonProperty(value = "properties.azureService", access = JsonProperty.Access.WRITE_ONLY) - private String azureService; - - /* - * The flag that indicates whether or not this is the primary region. - */ - @JsonProperty(value = "properties.isPrimaryRegion", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isPrimaryRegion; - - /* - * The BGP Community - */ - @JsonProperty(value = "properties.bgpCommunity", access = JsonProperty.Access.WRITE_ONLY) - private String bgpCommunity; - - /** - * Get the prefix property: The prefix. - * - * @return the prefix value. - */ - public String prefix() { - return this.prefix; - } - - /** - * Get the azureRegion property: The Azure region. - * - * @return the azureRegion value. - */ - public String azureRegion() { - return this.azureRegion; - } - - /** - * Get the azureService property: The Azure service. - * - * @return the azureService value. - */ - public String azureService() { - return this.azureService; - } - - /** - * Get the isPrimaryRegion property: The flag that indicates whether or not this is the primary region. - * - * @return the isPrimaryRegion value. - */ - public Boolean isPrimaryRegion() { - return this.isPrimaryRegion; - } - - /** - * Get the bgpCommunity property: The BGP Community. - * - * @return the bgpCommunity value. - */ - public String bgpCommunity() { - return this.bgpCommunity; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnInner.java index 562bcd708fd0..a0875ff82e1f 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnInner.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnInner.java @@ -8,11 +8,10 @@ import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.models.ContactDetail; +import com.azure.resourcemanager.peering.models.ContactInfo; import com.azure.resourcemanager.peering.models.ValidationState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; /** The essential information related to the peer's ASN. */ @JsonFlatten @@ -27,10 +26,10 @@ public class PeerAsnInner extends ProxyResource { private Integer peerAsn; /* - * The contact details of the peer. + * The contact information of the peer. */ - @JsonProperty(value = "properties.peerContactDetail") - private List peerContactDetail; + @JsonProperty(value = "properties.peerContactInfo") + private ContactInfo peerContactInfo; /* * The name of the peer. @@ -44,12 +43,6 @@ public class PeerAsnInner extends ProxyResource { @JsonProperty(value = "properties.validationState") private ValidationState validationState; - /* - * The error message for the validation state - */ - @JsonProperty(value = "properties.errorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String errorMessage; - /** * Get the peerAsn property: The Autonomous System Number (ASN) of the peer. * @@ -71,22 +64,22 @@ public PeerAsnInner withPeerAsn(Integer peerAsn) { } /** - * Get the peerContactDetail property: The contact details of the peer. + * Get the peerContactInfo property: The contact information of the peer. * - * @return the peerContactDetail value. + * @return the peerContactInfo value. */ - public List peerContactDetail() { - return this.peerContactDetail; + public ContactInfo peerContactInfo() { + return this.peerContactInfo; } /** - * Set the peerContactDetail property: The contact details of the peer. + * Set the peerContactInfo property: The contact information of the peer. * - * @param peerContactDetail the peerContactDetail value to set. + * @param peerContactInfo the peerContactInfo value to set. * @return the PeerAsnInner object itself. */ - public PeerAsnInner withPeerContactDetail(List peerContactDetail) { - this.peerContactDetail = peerContactDetail; + public PeerAsnInner withPeerContactInfo(ContactInfo peerContactInfo) { + this.peerContactInfo = peerContactInfo; return this; } @@ -130,23 +123,14 @@ public PeerAsnInner withValidationState(ValidationState validationState) { return this; } - /** - * Get the errorMessage property: The error message for the validation state. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (peerContactDetail() != null) { - peerContactDetail().forEach(e -> e.validate()); + if (peerContactInfo() != null) { + peerContactInfo().validate(); } } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringReceivedRouteInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringReceivedRouteInner.java deleted file mode 100644 index ce5d8d729f52..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringReceivedRouteInner.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The properties that define a received route. */ -@Immutable -public final class PeeringReceivedRouteInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringReceivedRouteInner.class); - - /* - * The prefix. - */ - @JsonProperty(value = "prefix", access = JsonProperty.Access.WRITE_ONLY) - private String prefix; - - /* - * The next hop for the prefix. - */ - @JsonProperty(value = "nextHop", access = JsonProperty.Access.WRITE_ONLY) - private String nextHop; - - /* - * The AS path for the prefix. - */ - @JsonProperty(value = "asPath", access = JsonProperty.Access.WRITE_ONLY) - private String asPath; - - /* - * The origin AS change information for the prefix. - */ - @JsonProperty(value = "originAsValidationState", access = JsonProperty.Access.WRITE_ONLY) - private String originAsValidationState; - - /* - * The RPKI validation state for the prefix and origin AS that's listed in - * the AS path. - */ - @JsonProperty(value = "rpkiValidationState", access = JsonProperty.Access.WRITE_ONLY) - private String rpkiValidationState; - - /* - * The authority which holds the Route Origin Authorization record for the - * prefix, if any. - */ - @JsonProperty(value = "trustAnchor", access = JsonProperty.Access.WRITE_ONLY) - private String trustAnchor; - - /* - * The received timestamp associated with the prefix. - */ - @JsonProperty(value = "receivedTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private String receivedTimestamp; - - /** - * Get the prefix property: The prefix. - * - * @return the prefix value. - */ - public String prefix() { - return this.prefix; - } - - /** - * Get the nextHop property: The next hop for the prefix. - * - * @return the nextHop value. - */ - public String nextHop() { - return this.nextHop; - } - - /** - * Get the asPath property: The AS path for the prefix. - * - * @return the asPath value. - */ - public String asPath() { - return this.asPath; - } - - /** - * Get the originAsValidationState property: The origin AS change information for the prefix. - * - * @return the originAsValidationState value. - */ - public String originAsValidationState() { - return this.originAsValidationState; - } - - /** - * Get the rpkiValidationState property: The RPKI validation state for the prefix and origin AS that's listed in the - * AS path. - * - * @return the rpkiValidationState value. - */ - public String rpkiValidationState() { - return this.rpkiValidationState; - } - - /** - * Get the trustAnchor property: The authority which holds the Route Origin Authorization record for the prefix, if - * any. - * - * @return the trustAnchor value. - */ - public String trustAnchor() { - return this.trustAnchor; - } - - /** - * Get the receivedTimestamp property: The received timestamp associated with the prefix. - * - * @return the receivedTimestamp value. - */ - public String receivedTimestamp() { - return this.receivedTimestamp; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredAsnInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredAsnInner.java deleted file mode 100644 index 5c842bd1c148..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredAsnInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The customer's ASN that is registered by the peering service provider. */ -@JsonFlatten -@Fluent -public class PeeringRegisteredAsnInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringRegisteredAsnInner.class); - - /* - * The customer's ASN from which traffic originates. - */ - @JsonProperty(value = "properties.asn") - private Integer asn; - - /* - * The peering service prefix key that is to be shared with the customer. - */ - @JsonProperty(value = "properties.peeringServicePrefixKey", access = JsonProperty.Access.WRITE_ONLY) - private String peeringServicePrefixKey; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Get the asn property: The customer's ASN from which traffic originates. - * - * @return the asn value. - */ - public Integer asn() { - return this.asn; - } - - /** - * Set the asn property: The customer's ASN from which traffic originates. - * - * @param asn the asn value to set. - * @return the PeeringRegisteredAsnInner object itself. - */ - public PeeringRegisteredAsnInner withAsn(Integer asn) { - this.asn = asn; - return this; - } - - /** - * Get the peeringServicePrefixKey property: The peering service prefix key that is to be shared with the customer. - * - * @return the peeringServicePrefixKey value. - */ - public String peeringServicePrefixKey() { - return this.peeringServicePrefixKey; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixInner.java deleted file mode 100644 index 0be2d0ffa58c..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixInner.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.models.PrefixValidationState; -import com.azure.resourcemanager.peering.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The customer's prefix that is registered by the peering service provider. */ -@JsonFlatten -@Fluent -public class PeeringRegisteredPrefixInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringRegisteredPrefixInner.class); - - /* - * The customer's prefix from which traffic originates. - */ - @JsonProperty(value = "properties.prefix") - private String prefix; - - /* - * The prefix validation state. - */ - @JsonProperty(value = "properties.prefixValidationState", access = JsonProperty.Access.WRITE_ONLY) - private PrefixValidationState prefixValidationState; - - /* - * The peering service prefix key that is to be shared with the customer. - */ - @JsonProperty(value = "properties.peeringServicePrefixKey", access = JsonProperty.Access.WRITE_ONLY) - private String peeringServicePrefixKey; - - /* - * The error message associated with the validation state, if any. - */ - @JsonProperty(value = "properties.errorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String errorMessage; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - - /** - * Get the prefix property: The customer's prefix from which traffic originates. - * - * @return the prefix value. - */ - public String prefix() { - return this.prefix; - } - - /** - * Set the prefix property: The customer's prefix from which traffic originates. - * - * @param prefix the prefix value to set. - * @return the PeeringRegisteredPrefixInner object itself. - */ - public PeeringRegisteredPrefixInner withPrefix(String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Get the prefixValidationState property: The prefix validation state. - * - * @return the prefixValidationState value. - */ - public PrefixValidationState prefixValidationState() { - return this.prefixValidationState; - } - - /** - * Get the peeringServicePrefixKey property: The peering service prefix key that is to be shared with the customer. - * - * @return the peeringServicePrefixKey value. - */ - public String peeringServicePrefixKey() { - return this.peeringServicePrefixKey; - } - - /** - * Get the errorMessage property: The error message associated with the validation state, if any. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceCountryInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceCountryInner.java deleted file mode 100644 index 8770e2db5098..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceCountryInner.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** The peering service country. */ -@Immutable -public final class PeeringServiceCountryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceCountryInner.class); - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceInner.java index 749f22d16f86..60579c680d8a 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceInner.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceInner.java @@ -8,7 +8,6 @@ import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.models.PeeringServiceSku; import com.azure.resourcemanager.peering.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,12 +19,6 @@ public class PeeringServiceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceInner.class); - /* - * The SKU that defines the type of the peering service. - */ - @JsonProperty(value = "sku") - private PeeringServiceSku sku; - /* * The location of the resource. */ @@ -39,13 +32,13 @@ public class PeeringServiceInner extends ProxyResource { private Map tags; /* - * The location (state/province) of the customer. + * The PeeringServiceLocation of the Customer. */ @JsonProperty(value = "properties.peeringServiceLocation") private String peeringServiceLocation; /* - * The name of the service provider. + * The MAPS Provider Name. */ @JsonProperty(value = "properties.peeringServiceProvider") private String peeringServiceProvider; @@ -56,40 +49,6 @@ public class PeeringServiceInner extends ProxyResource { @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /* - * The primary peering (Microsoft/service provider) location to be used for - * customer traffic. - */ - @JsonProperty(value = "properties.providerPrimaryPeeringLocation") - private String providerPrimaryPeeringLocation; - - /* - * The backup peering (Microsoft/service provider) location to be used for - * customer traffic. - */ - @JsonProperty(value = "properties.providerBackupPeeringLocation") - private String providerBackupPeeringLocation; - - /** - * Get the sku property: The SKU that defines the type of the peering service. - * - * @return the sku value. - */ - public PeeringServiceSku sku() { - return this.sku; - } - - /** - * Set the sku property: The SKU that defines the type of the peering service. - * - * @param sku the sku value to set. - * @return the PeeringServiceInner object itself. - */ - public PeeringServiceInner withSku(PeeringServiceSku sku) { - this.sku = sku; - return this; - } - /** * Get the location property: The location of the resource. * @@ -131,7 +90,7 @@ public PeeringServiceInner withTags(Map tags) { } /** - * Get the peeringServiceLocation property: The location (state/province) of the customer. + * Get the peeringServiceLocation property: The PeeringServiceLocation of the Customer. * * @return the peeringServiceLocation value. */ @@ -140,7 +99,7 @@ public String peeringServiceLocation() { } /** - * Set the peeringServiceLocation property: The location (state/province) of the customer. + * Set the peeringServiceLocation property: The PeeringServiceLocation of the Customer. * * @param peeringServiceLocation the peeringServiceLocation value to set. * @return the PeeringServiceInner object itself. @@ -151,7 +110,7 @@ public PeeringServiceInner withPeeringServiceLocation(String peeringServiceLocat } /** - * Get the peeringServiceProvider property: The name of the service provider. + * Get the peeringServiceProvider property: The MAPS Provider Name. * * @return the peeringServiceProvider value. */ @@ -160,7 +119,7 @@ public String peeringServiceProvider() { } /** - * Set the peeringServiceProvider property: The name of the service provider. + * Set the peeringServiceProvider property: The MAPS Provider Name. * * @param peeringServiceProvider the peeringServiceProvider value to set. * @return the PeeringServiceInner object itself. @@ -179,59 +138,12 @@ public ProvisioningState provisioningState() { return this.provisioningState; } - /** - * Get the providerPrimaryPeeringLocation property: The primary peering (Microsoft/service provider) location to be - * used for customer traffic. - * - * @return the providerPrimaryPeeringLocation value. - */ - public String providerPrimaryPeeringLocation() { - return this.providerPrimaryPeeringLocation; - } - - /** - * Set the providerPrimaryPeeringLocation property: The primary peering (Microsoft/service provider) location to be - * used for customer traffic. - * - * @param providerPrimaryPeeringLocation the providerPrimaryPeeringLocation value to set. - * @return the PeeringServiceInner object itself. - */ - public PeeringServiceInner withProviderPrimaryPeeringLocation(String providerPrimaryPeeringLocation) { - this.providerPrimaryPeeringLocation = providerPrimaryPeeringLocation; - return this; - } - - /** - * Get the providerBackupPeeringLocation property: The backup peering (Microsoft/service provider) location to be - * used for customer traffic. - * - * @return the providerBackupPeeringLocation value. - */ - public String providerBackupPeeringLocation() { - return this.providerBackupPeeringLocation; - } - - /** - * Set the providerBackupPeeringLocation property: The backup peering (Microsoft/service provider) location to be - * used for customer traffic. - * - * @param providerBackupPeeringLocation the providerBackupPeeringLocation value to set. - * @return the PeeringServiceInner object itself. - */ - public PeeringServiceInner withProviderBackupPeeringLocation(String providerBackupPeeringLocation) { - this.providerBackupPeeringLocation = providerBackupPeeringLocation; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sku() != null) { - sku().validate(); - } if (location() == null) { throw logger .logExceptionAsError( diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationInner.java index f8a70650d7e3..01cb8ab58267 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationInner.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationInner.java @@ -11,7 +11,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The peering service location. */ +/** PeeringService location. */ @JsonFlatten @Fluent public class PeeringServiceLocationInner extends ProxyResource { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServicePrefixInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServicePrefixInner.java index 841e9636f4db..383aa3a0b103 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServicePrefixInner.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServicePrefixInner.java @@ -9,12 +9,10 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.peering.models.LearnedType; -import com.azure.resourcemanager.peering.models.PeeringServicePrefixEvent; import com.azure.resourcemanager.peering.models.PrefixValidationState; import com.azure.resourcemanager.peering.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; /** The peering service prefix class. */ @JsonFlatten @@ -23,7 +21,7 @@ public class PeeringServicePrefixInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicePrefixInner.class); /* - * The prefix from which your traffic originates. + * Valid route prefix */ @JsonProperty(value = "properties.prefix") private String prefix; @@ -31,33 +29,15 @@ public class PeeringServicePrefixInner extends ProxyResource { /* * The prefix validation state */ - @JsonProperty(value = "properties.prefixValidationState", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "properties.prefixValidationState") private PrefixValidationState prefixValidationState; /* * The prefix learned type */ - @JsonProperty(value = "properties.learnedType", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "properties.learnedType") private LearnedType learnedType; - /* - * The error message for validation state - */ - @JsonProperty(value = "properties.errorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String errorMessage; - - /* - * The list of events for peering service prefix - */ - @JsonProperty(value = "properties.events", access = JsonProperty.Access.WRITE_ONLY) - private List events; - - /* - * The peering service prefix key - */ - @JsonProperty(value = "properties.peeringServicePrefixKey") - private String peeringServicePrefixKey; - /* * The provisioning state of the resource. */ @@ -65,7 +45,7 @@ public class PeeringServicePrefixInner extends ProxyResource { private ProvisioningState provisioningState; /** - * Get the prefix property: The prefix from which your traffic originates. + * Get the prefix property: Valid route prefix. * * @return the prefix value. */ @@ -74,7 +54,7 @@ public String prefix() { } /** - * Set the prefix property: The prefix from which your traffic originates. + * Set the prefix property: Valid route prefix. * * @param prefix the prefix value to set. * @return the PeeringServicePrefixInner object itself. @@ -94,49 +74,33 @@ public PrefixValidationState prefixValidationState() { } /** - * Get the learnedType property: The prefix learned type. + * Set the prefixValidationState property: The prefix validation state. * - * @return the learnedType value. - */ - public LearnedType learnedType() { - return this.learnedType; - } - - /** - * Get the errorMessage property: The error message for validation state. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - - /** - * Get the events property: The list of events for peering service prefix. - * - * @return the events value. + * @param prefixValidationState the prefixValidationState value to set. + * @return the PeeringServicePrefixInner object itself. */ - public List events() { - return this.events; + public PeeringServicePrefixInner withPrefixValidationState(PrefixValidationState prefixValidationState) { + this.prefixValidationState = prefixValidationState; + return this; } /** - * Get the peeringServicePrefixKey property: The peering service prefix key. + * Get the learnedType property: The prefix learned type. * - * @return the peeringServicePrefixKey value. + * @return the learnedType value. */ - public String peeringServicePrefixKey() { - return this.peeringServicePrefixKey; + public LearnedType learnedType() { + return this.learnedType; } /** - * Set the peeringServicePrefixKey property: The peering service prefix key. + * Set the learnedType property: The prefix learned type. * - * @param peeringServicePrefixKey the peeringServicePrefixKey value to set. + * @param learnedType the learnedType value to set. * @return the PeeringServicePrefixInner object itself. */ - public PeeringServicePrefixInner withPeeringServicePrefixKey(String peeringServicePrefixKey) { - this.peeringServicePrefixKey = peeringServicePrefixKey; + public PeeringServicePrefixInner withLearnedType(LearnedType learnedType) { + this.learnedType = learnedType; return this; } @@ -155,8 +119,5 @@ public ProvisioningState provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (events() != null) { - events().forEach(e -> e.validate()); - } } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderInner.java index da060a5aa1da..850b738ff1e7 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderInner.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderInner.java @@ -10,7 +10,6 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; /** PeeringService provider. */ @JsonFlatten @@ -24,13 +23,6 @@ public class PeeringServiceProviderInner extends ProxyResource { @JsonProperty(value = "properties.serviceProviderName") private String serviceProviderName; - /* - * The list of locations at which the service provider peers with - * Microsoft. - */ - @JsonProperty(value = "properties.peeringLocations") - private List peeringLocations; - /** * Get the serviceProviderName property: The name of the service provider. * @@ -51,26 +43,6 @@ public PeeringServiceProviderInner withServiceProviderName(String serviceProvide return this; } - /** - * Get the peeringLocations property: The list of locations at which the service provider peers with Microsoft. - * - * @return the peeringLocations value. - */ - public List peeringLocations() { - return this.peeringLocations; - } - - /** - * Set the peeringLocations property: The list of locations at which the service provider peers with Microsoft. - * - * @param peeringLocations the peeringLocations value to set. - * @return the PeeringServiceProviderInner object itself. - */ - public PeeringServiceProviderInner withPeeringLocations(List peeringLocations) { - this.peeringLocations = peeringLocations; - return this; - } - /** * Validates the instance. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixImpl.java deleted file mode 100644 index eef26890de86..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.resourcemanager.peering.fluent.models.CdnPeeringPrefixInner; -import com.azure.resourcemanager.peering.models.CdnPeeringPrefix; - -public final class CdnPeeringPrefixImpl implements CdnPeeringPrefix { - private CdnPeeringPrefixInner innerObject; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - CdnPeeringPrefixImpl( - CdnPeeringPrefixInner innerObject, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String prefix() { - return this.innerModel().prefix(); - } - - public String azureRegion() { - return this.innerModel().azureRegion(); - } - - public String azureService() { - return this.innerModel().azureService(); - } - - public Boolean isPrimaryRegion() { - return this.innerModel().isPrimaryRegion(); - } - - public String bgpCommunity() { - return this.innerModel().bgpCommunity(); - } - - public CdnPeeringPrefixInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesClientImpl.java deleted file mode 100644 index d8e93e1c95e6..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesClientImpl.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.CdnPeeringPrefixesClient; -import com.azure.resourcemanager.peering.fluent.models.CdnPeeringPrefixInner; -import com.azure.resourcemanager.peering.models.CdnPeeringPrefixListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CdnPeeringPrefixesClient. */ -public final class CdnPeeringPrefixesClientImpl implements CdnPeeringPrefixesClient { - private final ClientLogger logger = new ClientLogger(CdnPeeringPrefixesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final CdnPeeringPrefixesService service; - - /** The service client containing this operation class. */ - private final PeeringManagementClientImpl client; - - /** - * Initializes an instance of CdnPeeringPrefixesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CdnPeeringPrefixesClientImpl(PeeringManagementClientImpl client) { - this.service = - RestProxy.create(CdnPeeringPrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PeeringManagementClientCdnPeeringPrefixes to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PeeringManagementCli") - private interface CdnPeeringPrefixesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/cdnPeeringPrefixes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("peeringLocation") String peeringLocation, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String peeringLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (peeringLocation == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringLocation is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - peeringLocation, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String peeringLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (peeringLocation == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringLocation is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - peeringLocation, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String peeringLocation) { - return new PagedFlux<>( - () -> listSinglePageAsync(peeringLocation), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String peeringLocation, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(peeringLocation, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String peeringLocation) { - return new PagedIterable<>(listAsync(peeringLocation)); - } - - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String peeringLocation, Context context) { - return new PagedIterable<>(listAsync(peeringLocation, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesImpl.java deleted file mode 100644 index 4594b349f43b..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.CdnPeeringPrefixesClient; -import com.azure.resourcemanager.peering.fluent.models.CdnPeeringPrefixInner; -import com.azure.resourcemanager.peering.models.CdnPeeringPrefix; -import com.azure.resourcemanager.peering.models.CdnPeeringPrefixes; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class CdnPeeringPrefixesImpl implements CdnPeeringPrefixes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CdnPeeringPrefixesImpl.class); - - private final CdnPeeringPrefixesClient innerClient; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - public CdnPeeringPrefixesImpl( - CdnPeeringPrefixesClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String peeringLocation) { - PagedIterable inner = this.serviceClient().list(peeringLocation); - return Utils.mapPage(inner, inner1 -> new CdnPeeringPrefixImpl(inner1, this.manager())); - } - - public PagedIterable list(String peeringLocation, Context context) { - PagedIterable inner = this.serviceClient().list(peeringLocation, context); - return Utils.mapPage(inner, inner1 -> new CdnPeeringPrefixImpl(inner1, this.manager())); - } - - private CdnPeeringPrefixesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsClientImpl.java index 544847e55a06..39c706e451f2 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsClientImpl.java @@ -68,7 +68,6 @@ Mono> list( @HostParam("$host") String endpoint, @QueryParam("peeringLocation") String peeringLocation, @QueryParam("kind") LegacyPeeringsKind kind, - @QueryParam("asn") Integer asn, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -90,15 +89,13 @@ Mono> listNext( * * @param peeringLocation The location of the peering. * @param kind The kind of the peering. - * @param asn The ASN number associated with a legacy peering. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of peerings. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String peeringLocation, LegacyPeeringsKind kind, Integer asn) { + private Mono> listSinglePageAsync(String peeringLocation, LegacyPeeringsKind kind) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -127,7 +124,6 @@ private Mono> listSinglePageAsync( this.client.getEndpoint(), peeringLocation, kind, - asn, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -149,7 +145,6 @@ private Mono> listSinglePageAsync( * * @param peeringLocation The location of the peering. * @param kind The kind of the peering. - * @param asn The ASN number associated with a legacy peering. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -158,7 +153,7 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context) { + String peeringLocation, LegacyPeeringsKind kind, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -185,7 +180,6 @@ private Mono> listSinglePageAsync( this.client.getEndpoint(), peeringLocation, kind, - asn, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -201,23 +195,6 @@ private Mono> listSinglePageAsync( null)); } - /** - * Lists all of the legacy peerings under the given subscription matching the specified kind and location. - * - * @param peeringLocation The location of the peering. - * @param kind The kind of the peering. - * @param asn The ASN number associated with a legacy peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peerings. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String peeringLocation, LegacyPeeringsKind kind, Integer asn) { - return new PagedFlux<>( - () -> listSinglePageAsync(peeringLocation, kind, asn), nextLink -> listNextSinglePageAsync(nextLink)); - } - /** * Lists all of the legacy peerings under the given subscription matching the specified kind and location. * @@ -230,9 +207,8 @@ private PagedFlux listAsync(String peeringLocation, LegacyPeerings */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String peeringLocation, LegacyPeeringsKind kind) { - final Integer asn = null; return new PagedFlux<>( - () -> listSinglePageAsync(peeringLocation, kind, asn), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(peeringLocation, kind), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -240,7 +216,6 @@ private PagedFlux listAsync(String peeringLocation, LegacyPeerings * * @param peeringLocation The location of the peering. * @param kind The kind of the peering. - * @param asn The ASN number associated with a legacy peering. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -248,10 +223,9 @@ private PagedFlux listAsync(String peeringLocation, LegacyPeerings * @return the paginated list of peerings. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context) { + private PagedFlux listAsync(String peeringLocation, LegacyPeeringsKind kind, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(peeringLocation, kind, asn, context), + () -> listSinglePageAsync(peeringLocation, kind, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -267,8 +241,7 @@ private PagedFlux listAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String peeringLocation, LegacyPeeringsKind kind) { - final Integer asn = null; - return new PagedIterable<>(listAsync(peeringLocation, kind, asn)); + return new PagedIterable<>(listAsync(peeringLocation, kind)); } /** @@ -276,7 +249,6 @@ public PagedIterable list(String peeringLocation, LegacyPeeringsKi * * @param peeringLocation The location of the peering. * @param kind The kind of the peering. - * @param asn The ASN number associated with a legacy peering. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -284,9 +256,8 @@ public PagedIterable list(String peeringLocation, LegacyPeeringsKi * @return the paginated list of peerings. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context) { - return new PagedIterable<>(listAsync(peeringLocation, kind, asn, context)); + public PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Context context) { + return new PagedIterable<>(listAsync(peeringLocation, kind, context)); } /** diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsImpl.java index 9633dbf063a9..7911f4419542 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsImpl.java @@ -32,8 +32,8 @@ public PagedIterable list(String peeringLocation, LegacyPeeringsKind ki return Utils.mapPage(inner, inner1 -> new PeeringImpl(inner1, this.manager())); } - public PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context) { - PagedIterable inner = this.serviceClient().list(peeringLocation, kind, asn, context); + public PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Context context) { + PagedIterable inner = this.serviceClient().list(peeringLocation, kind, context); return Utils.mapPage(inner, inner1 -> new PeeringImpl(inner1, this.manager())); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnImpl.java index 8c01d2524817..dadf641455a7 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnImpl.java @@ -6,11 +6,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeerAsnInner; -import com.azure.resourcemanager.peering.models.ContactDetail; +import com.azure.resourcemanager.peering.models.ContactInfo; import com.azure.resourcemanager.peering.models.PeerAsn; import com.azure.resourcemanager.peering.models.ValidationState; -import java.util.Collections; -import java.util.List; public final class PeerAsnImpl implements PeerAsn, PeerAsn.Definition, PeerAsn.Update { private PeerAsnInner innerObject; @@ -33,13 +31,8 @@ public Integer peerAsn() { return this.innerModel().peerAsn(); } - public List peerContactDetail() { - List inner = this.innerModel().peerContactDetail(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public ContactInfo peerContactInfo() { + return this.innerModel().peerContactInfo(); } public String peerName() { @@ -50,10 +43,6 @@ public ValidationState validationState() { return this.innerModel().validationState(); } - public String errorMessage() { - return this.innerModel().errorMessage(); - } - public PeerAsnInner innerModel() { return this.innerObject; } @@ -137,8 +126,8 @@ public PeerAsnImpl withPeerAsn(Integer peerAsn) { return this; } - public PeerAsnImpl withPeerContactDetail(List peerContactDetail) { - this.innerModel().withPeerContactDetail(peerContactDetail); + public PeerAsnImpl withPeerContactInfo(ContactInfo peerContactInfo) { + this.innerModel().withPeerContactInfo(peerContactInfo); return this; } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientImpl.java index 1f10890a52f1..e7b8b9e33be0 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientImpl.java @@ -21,21 +21,17 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.peering.fluent.CdnPeeringPrefixesClient; import com.azure.resourcemanager.peering.fluent.LegacyPeeringsClient; import com.azure.resourcemanager.peering.fluent.OperationsClient; import com.azure.resourcemanager.peering.fluent.PeerAsnsClient; import com.azure.resourcemanager.peering.fluent.PeeringLocationsClient; import com.azure.resourcemanager.peering.fluent.PeeringManagementClient; -import com.azure.resourcemanager.peering.fluent.PeeringServiceCountriesClient; import com.azure.resourcemanager.peering.fluent.PeeringServiceLocationsClient; +import com.azure.resourcemanager.peering.fluent.PeeringServicePrefixesClient; import com.azure.resourcemanager.peering.fluent.PeeringServiceProvidersClient; import com.azure.resourcemanager.peering.fluent.PeeringServicesClient; import com.azure.resourcemanager.peering.fluent.PeeringsClient; import com.azure.resourcemanager.peering.fluent.PrefixesClient; -import com.azure.resourcemanager.peering.fluent.ReceivedRoutesClient; -import com.azure.resourcemanager.peering.fluent.RegisteredAsnsClient; -import com.azure.resourcemanager.peering.fluent.RegisteredPrefixesClient; import com.azure.resourcemanager.peering.fluent.ResourceProvidersClient; import java.io.IOException; import java.lang.reflect.Type; @@ -124,18 +120,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The CdnPeeringPrefixesClient object to access its operations. */ - private final CdnPeeringPrefixesClient cdnPeeringPrefixes; - - /** - * Gets the CdnPeeringPrefixesClient object to access its operations. - * - * @return the CdnPeeringPrefixesClient object. - */ - public CdnPeeringPrefixesClient getCdnPeeringPrefixes() { - return this.cdnPeeringPrefixes; - } - /** The ResourceProvidersClient object to access its operations. */ private final ResourceProvidersClient resourceProviders; @@ -196,30 +180,6 @@ public PeeringLocationsClient getPeeringLocations() { return this.peeringLocations; } - /** The RegisteredAsnsClient object to access its operations. */ - private final RegisteredAsnsClient registeredAsns; - - /** - * Gets the RegisteredAsnsClient object to access its operations. - * - * @return the RegisteredAsnsClient object. - */ - public RegisteredAsnsClient getRegisteredAsns() { - return this.registeredAsns; - } - - /** The RegisteredPrefixesClient object to access its operations. */ - private final RegisteredPrefixesClient registeredPrefixes; - - /** - * Gets the RegisteredPrefixesClient object to access its operations. - * - * @return the RegisteredPrefixesClient object. - */ - public RegisteredPrefixesClient getRegisteredPrefixes() { - return this.registeredPrefixes; - } - /** The PeeringsClient object to access its operations. */ private final PeeringsClient peerings; @@ -232,30 +192,6 @@ public PeeringsClient getPeerings() { return this.peerings; } - /** The ReceivedRoutesClient object to access its operations. */ - private final ReceivedRoutesClient receivedRoutes; - - /** - * Gets the ReceivedRoutesClient object to access its operations. - * - * @return the ReceivedRoutesClient object. - */ - public ReceivedRoutesClient getReceivedRoutes() { - return this.receivedRoutes; - } - - /** The PeeringServiceCountriesClient object to access its operations. */ - private final PeeringServiceCountriesClient peeringServiceCountries; - - /** - * Gets the PeeringServiceCountriesClient object to access its operations. - * - * @return the PeeringServiceCountriesClient object. - */ - public PeeringServiceCountriesClient getPeeringServiceCountries() { - return this.peeringServiceCountries; - } - /** The PeeringServiceLocationsClient object to access its operations. */ private final PeeringServiceLocationsClient peeringServiceLocations; @@ -268,6 +204,18 @@ public PeeringServiceLocationsClient getPeeringServiceLocations() { return this.peeringServiceLocations; } + /** The PeeringServicePrefixesClient object to access its operations. */ + private final PeeringServicePrefixesClient peeringServicePrefixes; + + /** + * Gets the PeeringServicePrefixesClient object to access its operations. + * + * @return the PeeringServicePrefixesClient object. + */ + public PeeringServicePrefixesClient getPeeringServicePrefixes() { + return this.peeringServicePrefixes; + } + /** The PrefixesClient object to access its operations. */ private final PrefixesClient prefixes; @@ -326,19 +274,15 @@ public PeeringServicesClient getPeeringServices() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-01-01"; - this.cdnPeeringPrefixes = new CdnPeeringPrefixesClientImpl(this); + this.apiVersion = "2019-08-01-preview"; this.resourceProviders = new ResourceProvidersClientImpl(this); this.legacyPeerings = new LegacyPeeringsClientImpl(this); this.operations = new OperationsClientImpl(this); this.peerAsns = new PeerAsnsClientImpl(this); this.peeringLocations = new PeeringLocationsClientImpl(this); - this.registeredAsns = new RegisteredAsnsClientImpl(this); - this.registeredPrefixes = new RegisteredPrefixesClientImpl(this); this.peerings = new PeeringsClientImpl(this); - this.receivedRoutes = new ReceivedRoutesClientImpl(this); - this.peeringServiceCountries = new PeeringServiceCountriesClientImpl(this); this.peeringServiceLocations = new PeeringServiceLocationsClientImpl(this); + this.peeringServicePrefixes = new PeeringServicePrefixesClientImpl(this); this.prefixes = new PrefixesClientImpl(this); this.peeringServiceProviders = new PeeringServiceProvidersClientImpl(this); this.peeringServices = new PeeringServicesClientImpl(this); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringReceivedRouteImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringReceivedRouteImpl.java deleted file mode 100644 index 2efef6b118d5..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringReceivedRouteImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.resourcemanager.peering.fluent.models.PeeringReceivedRouteInner; -import com.azure.resourcemanager.peering.models.PeeringReceivedRoute; - -public final class PeeringReceivedRouteImpl implements PeeringReceivedRoute { - private PeeringReceivedRouteInner innerObject; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - PeeringReceivedRouteImpl( - PeeringReceivedRouteInner innerObject, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String prefix() { - return this.innerModel().prefix(); - } - - public String nextHop() { - return this.innerModel().nextHop(); - } - - public String asPath() { - return this.innerModel().asPath(); - } - - public String originAsValidationState() { - return this.innerModel().originAsValidationState(); - } - - public String rpkiValidationState() { - return this.innerModel().rpkiValidationState(); - } - - public String trustAnchor() { - return this.innerModel().trustAnchor(); - } - - public String receivedTimestamp() { - return this.innerModel().receivedTimestamp(); - } - - public PeeringReceivedRouteInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringRegisteredAsnImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringRegisteredAsnImpl.java deleted file mode 100644 index dd30bedb8aeb..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringRegisteredAsnImpl.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner; -import com.azure.resourcemanager.peering.models.PeeringRegisteredAsn; -import com.azure.resourcemanager.peering.models.ProvisioningState; - -public final class PeeringRegisteredAsnImpl - implements PeeringRegisteredAsn, PeeringRegisteredAsn.Definition, PeeringRegisteredAsn.Update { - private PeeringRegisteredAsnInner innerObject; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Integer asn() { - return this.innerModel().asn(); - } - - public String peeringServicePrefixKey() { - return this.innerModel().peeringServicePrefixKey(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public PeeringRegisteredAsnInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String peeringName; - - private String registeredAsnName; - - public PeeringRegisteredAsnImpl withExistingPeering(String resourceGroupName, String peeringName) { - this.resourceGroupName = resourceGroupName; - this.peeringName = peeringName; - return this; - } - - public PeeringRegisteredAsn create() { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredAsns() - .createOrUpdateWithResponse( - resourceGroupName, peeringName, registeredAsnName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public PeeringRegisteredAsn create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredAsns() - .createOrUpdateWithResponse( - resourceGroupName, peeringName, registeredAsnName, this.innerModel(), context) - .getValue(); - return this; - } - - PeeringRegisteredAsnImpl(String name, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerObject = new PeeringRegisteredAsnInner(); - this.serviceManager = serviceManager; - this.registeredAsnName = name; - } - - public PeeringRegisteredAsnImpl update() { - return this; - } - - public PeeringRegisteredAsn apply() { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredAsns() - .createOrUpdateWithResponse( - resourceGroupName, peeringName, registeredAsnName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public PeeringRegisteredAsn apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredAsns() - .createOrUpdateWithResponse( - resourceGroupName, peeringName, registeredAsnName, this.innerModel(), context) - .getValue(); - return this; - } - - PeeringRegisteredAsnImpl( - PeeringRegisteredAsnInner innerObject, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); - this.registeredAsnName = Utils.getValueFromIdByName(innerObject.id(), "registeredAsns"); - } - - public PeeringRegisteredAsn refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredAsns() - .getWithResponse(resourceGroupName, peeringName, registeredAsnName, Context.NONE) - .getValue(); - return this; - } - - public PeeringRegisteredAsn refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredAsns() - .getWithResponse(resourceGroupName, peeringName, registeredAsnName, context) - .getValue(); - return this; - } - - public PeeringRegisteredAsnImpl withAsn(Integer asn) { - this.innerModel().withAsn(asn); - return this; - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringRegisteredPrefixImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringRegisteredPrefixImpl.java deleted file mode 100644 index 2c35c1ac2b34..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringRegisteredPrefixImpl.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner; -import com.azure.resourcemanager.peering.models.PeeringRegisteredPrefix; -import com.azure.resourcemanager.peering.models.PrefixValidationState; -import com.azure.resourcemanager.peering.models.ProvisioningState; - -public final class PeeringRegisteredPrefixImpl - implements PeeringRegisteredPrefix, PeeringRegisteredPrefix.Definition, PeeringRegisteredPrefix.Update { - private PeeringRegisteredPrefixInner innerObject; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String prefix() { - return this.innerModel().prefix(); - } - - public PrefixValidationState prefixValidationState() { - return this.innerModel().prefixValidationState(); - } - - public String peeringServicePrefixKey() { - return this.innerModel().peeringServicePrefixKey(); - } - - public String errorMessage() { - return this.innerModel().errorMessage(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public PeeringRegisteredPrefixInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String peeringName; - - private String registeredPrefixName; - - public PeeringRegisteredPrefixImpl withExistingPeering(String resourceGroupName, String peeringName) { - this.resourceGroupName = resourceGroupName; - this.peeringName = peeringName; - return this; - } - - public PeeringRegisteredPrefix create() { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredPrefixes() - .createOrUpdateWithResponse( - resourceGroupName, peeringName, registeredPrefixName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public PeeringRegisteredPrefix create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredPrefixes() - .createOrUpdateWithResponse( - resourceGroupName, peeringName, registeredPrefixName, this.innerModel(), context) - .getValue(); - return this; - } - - PeeringRegisteredPrefixImpl(String name, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerObject = new PeeringRegisteredPrefixInner(); - this.serviceManager = serviceManager; - this.registeredPrefixName = name; - } - - public PeeringRegisteredPrefixImpl update() { - return this; - } - - public PeeringRegisteredPrefix apply() { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredPrefixes() - .createOrUpdateWithResponse( - resourceGroupName, peeringName, registeredPrefixName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public PeeringRegisteredPrefix apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredPrefixes() - .createOrUpdateWithResponse( - resourceGroupName, peeringName, registeredPrefixName, this.innerModel(), context) - .getValue(); - return this; - } - - PeeringRegisteredPrefixImpl( - PeeringRegisteredPrefixInner innerObject, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.peeringName = Utils.getValueFromIdByName(innerObject.id(), "peerings"); - this.registeredPrefixName = Utils.getValueFromIdByName(innerObject.id(), "registeredPrefixes"); - } - - public PeeringRegisteredPrefix refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredPrefixes() - .getWithResponse(resourceGroupName, peeringName, registeredPrefixName, Context.NONE) - .getValue(); - return this; - } - - public PeeringRegisteredPrefix refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getRegisteredPrefixes() - .getWithResponse(resourceGroupName, peeringName, registeredPrefixName, context) - .getValue(); - return this; - } - - public PeeringRegisteredPrefixImpl withPrefix(String prefix) { - this.innerModel().withPrefix(prefix); - return this; - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountriesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountriesClientImpl.java deleted file mode 100644 index f608089da9e3..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountriesClientImpl.java +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.PeeringServiceCountriesClient; -import com.azure.resourcemanager.peering.fluent.models.PeeringServiceCountryInner; -import com.azure.resourcemanager.peering.models.PeeringServiceCountryListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PeeringServiceCountriesClient. */ -public final class PeeringServiceCountriesClientImpl implements PeeringServiceCountriesClient { - private final ClientLogger logger = new ClientLogger(PeeringServiceCountriesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final PeeringServiceCountriesService service; - - /** The service client containing this operation class. */ - private final PeeringManagementClientImpl client; - - /** - * Initializes an instance of PeeringServiceCountriesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PeeringServiceCountriesClientImpl(PeeringManagementClientImpl client) { - this.service = - RestProxy - .create(PeeringServiceCountriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PeeringManagementClientPeeringServiceCountries to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PeeringManagementCli") - private interface PeeringServiceCountriesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceCountries") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all of the available countries for peering service. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all of the available countries for peering service. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all of the available countries for peering service. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available countries for peering service. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all of the available countries for peering service. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all of the available countries for peering service. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountriesImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountriesImpl.java deleted file mode 100644 index 1ee72e2e2bae..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountriesImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.PeeringServiceCountriesClient; -import com.azure.resourcemanager.peering.fluent.models.PeeringServiceCountryInner; -import com.azure.resourcemanager.peering.models.PeeringServiceCountries; -import com.azure.resourcemanager.peering.models.PeeringServiceCountry; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class PeeringServiceCountriesImpl implements PeeringServiceCountries { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceCountriesImpl.class); - - private final PeeringServiceCountriesClient innerClient; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - public PeeringServiceCountriesImpl( - PeeringServiceCountriesClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new PeeringServiceCountryImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new PeeringServiceCountryImpl(inner1, this.manager())); - } - - private PeeringServiceCountriesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountryImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountryImpl.java deleted file mode 100644 index c7e0fda49b47..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceCountryImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.resourcemanager.peering.fluent.models.PeeringServiceCountryInner; -import com.azure.resourcemanager.peering.models.PeeringServiceCountry; - -public final class PeeringServiceCountryImpl implements PeeringServiceCountry { - private PeeringServiceCountryInner innerObject; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - PeeringServiceCountryImpl( - PeeringServiceCountryInner innerObject, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public PeeringServiceCountryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceImpl.java index 1aa0c5de92de..b5eb5d342e56 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceImpl.java @@ -8,7 +8,6 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeeringServiceInner; import com.azure.resourcemanager.peering.models.PeeringService; -import com.azure.resourcemanager.peering.models.PeeringServiceSku; import com.azure.resourcemanager.peering.models.ProvisioningState; import com.azure.resourcemanager.peering.models.ResourceTags; import java.util.Collections; @@ -31,10 +30,6 @@ public String type() { return this.innerModel().type(); } - public PeeringServiceSku sku() { - return this.innerModel().sku(); - } - public String location() { return this.innerModel().location(); } @@ -60,14 +55,6 @@ public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } - public String providerPrimaryPeeringLocation() { - return this.innerModel().providerPrimaryPeeringLocation(); - } - - public String providerBackupPeeringLocation() { - return this.innerModel().providerBackupPeeringLocation(); - } - public Region region() { return Region.fromName(this.regionName()); } @@ -194,11 +181,6 @@ public PeeringServiceImpl withTags(Map tags) { } } - public PeeringServiceImpl withSku(PeeringServiceSku sku) { - this.innerModel().withSku(sku); - return this; - } - public PeeringServiceImpl withPeeringServiceLocation(String peeringServiceLocation) { this.innerModel().withPeeringServiceLocation(peeringServiceLocation); return this; @@ -209,16 +191,6 @@ public PeeringServiceImpl withPeeringServiceProvider(String peeringServiceProvid return this; } - public PeeringServiceImpl withProviderPrimaryPeeringLocation(String providerPrimaryPeeringLocation) { - this.innerModel().withProviderPrimaryPeeringLocation(providerPrimaryPeeringLocation); - return this; - } - - public PeeringServiceImpl withProviderBackupPeeringLocation(String providerBackupPeeringLocation) { - this.innerModel().withProviderBackupPeeringLocation(providerBackupPeeringLocation); - return this; - } - private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsClientImpl.java index 1d7d178816c1..61e1d3aa00e8 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsClientImpl.java @@ -66,7 +66,6 @@ private interface PeeringServiceLocationsService { @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, - @QueryParam("country") String country, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -84,16 +83,14 @@ Mono> listNext( } /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * - * @param country The country of interest, in which the locations are to be present. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of peering service locations. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String country) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono .error( @@ -113,7 +110,6 @@ private Mono> listSinglePageAsync(Str service .list( this.client.getEndpoint(), - country, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -131,9 +127,8 @@ private Mono> listSinglePageAsync(Str } /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * - * @param country The country of interest, in which the locations are to be present. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -141,7 +136,7 @@ private Mono> listSinglePageAsync(Str * @return the paginated list of peering service locations. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String country, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -159,7 +154,6 @@ private Mono> listSinglePageAsync(Str return service .list( this.client.getEndpoint(), - country, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -176,21 +170,7 @@ private Mono> listSinglePageAsync(Str } /** - * Lists all of the available locations for peering service. - * - * @param country The country of interest, in which the locations are to be present. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service locations. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String country) { - return new PagedFlux<>(() -> listSinglePageAsync(country), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -198,14 +178,12 @@ private PagedFlux listAsync(String country) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - final String country = null; - return new PagedFlux<>(() -> listSinglePageAsync(country), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * - * @param country The country of interest, in which the locations are to be present. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -213,13 +191,13 @@ private PagedFlux listAsync() { * @return the paginated list of peering service locations. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String country, Context context) { + private PagedFlux listAsync(Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(country, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -227,14 +205,12 @@ private PagedFlux listAsync(String country, Context */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - final String country = null; - return new PagedIterable<>(listAsync(country)); + return new PagedIterable<>(listAsync()); } /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * - * @param country The country of interest, in which the locations are to be present. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -242,8 +218,8 @@ public PagedIterable list() { * @return the paginated list of peering service locations. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String country, Context context) { - return new PagedIterable<>(listAsync(country, context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsImpl.java index 810cb5a2713e..4156a11b36e0 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsImpl.java @@ -31,8 +31,8 @@ public PagedIterable list() { return Utils.mapPage(inner, inner1 -> new PeeringServiceLocationImpl(inner1, this.manager())); } - public PagedIterable list(String country, Context context) { - PagedIterable inner = this.serviceClient().list(country, context); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); return Utils.mapPage(inner, inner1 -> new PeeringServiceLocationImpl(inner1, this.manager())); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixImpl.java index a5ad8dc4665e..3cd6540144c6 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixImpl.java @@ -8,11 +8,8 @@ import com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner; import com.azure.resourcemanager.peering.models.LearnedType; import com.azure.resourcemanager.peering.models.PeeringServicePrefix; -import com.azure.resourcemanager.peering.models.PeeringServicePrefixEvent; import com.azure.resourcemanager.peering.models.PrefixValidationState; import com.azure.resourcemanager.peering.models.ProvisioningState; -import java.util.Collections; -import java.util.List; public final class PeeringServicePrefixImpl implements PeeringServicePrefix, PeeringServicePrefix.Definition, PeeringServicePrefix.Update { @@ -44,23 +41,6 @@ public LearnedType learnedType() { return this.innerModel().learnedType(); } - public String errorMessage() { - return this.innerModel().errorMessage(); - } - - public List events() { - List inner = this.innerModel().events(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String peeringServicePrefixKey() { - return this.innerModel().peeringServicePrefixKey(); - } - public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } @@ -89,7 +69,7 @@ public PeeringServicePrefix create() { this.innerObject = serviceManager .serviceClient() - .getPrefixes() + .getPeeringServicePrefixes() .createOrUpdateWithResponse( resourceGroupName, peeringServiceName, prefixName, this.innerModel(), Context.NONE) .getValue(); @@ -100,7 +80,7 @@ public PeeringServicePrefix create(Context context) { this.innerObject = serviceManager .serviceClient() - .getPrefixes() + .getPeeringServicePrefixes() .createOrUpdateWithResponse( resourceGroupName, peeringServiceName, prefixName, this.innerModel(), context) .getValue(); @@ -121,7 +101,7 @@ public PeeringServicePrefix apply() { this.innerObject = serviceManager .serviceClient() - .getPrefixes() + .getPeeringServicePrefixes() .createOrUpdateWithResponse( resourceGroupName, peeringServiceName, prefixName, this.innerModel(), Context.NONE) .getValue(); @@ -132,7 +112,7 @@ public PeeringServicePrefix apply(Context context) { this.innerObject = serviceManager .serviceClient() - .getPrefixes() + .getPeeringServicePrefixes() .createOrUpdateWithResponse( resourceGroupName, peeringServiceName, prefixName, this.innerModel(), context) .getValue(); @@ -149,23 +129,21 @@ public PeeringServicePrefix apply(Context context) { } public PeeringServicePrefix refresh() { - String localExpand = null; this.innerObject = serviceManager .serviceClient() - .getPrefixes() - .getWithResponse(resourceGroupName, peeringServiceName, prefixName, localExpand, Context.NONE) + .getPeeringServicePrefixes() + .getWithResponse(resourceGroupName, peeringServiceName, prefixName, Context.NONE) .getValue(); return this; } public PeeringServicePrefix refresh(Context context) { - String localExpand = null; this.innerObject = serviceManager .serviceClient() - .getPrefixes() - .getWithResponse(resourceGroupName, peeringServiceName, prefixName, localExpand, context) + .getPeeringServicePrefixes() + .getWithResponse(resourceGroupName, peeringServiceName, prefixName, context) .getValue(); return this; } @@ -175,8 +153,13 @@ public PeeringServicePrefixImpl withPrefix(String prefix) { return this; } - public PeeringServicePrefixImpl withPeeringServicePrefixKey(String peeringServicePrefixKey) { - this.innerModel().withPeeringServicePrefixKey(peeringServicePrefixKey); + public PeeringServicePrefixImpl withPrefixValidationState(PrefixValidationState prefixValidationState) { + this.innerModel().withPrefixValidationState(prefixValidationState); + return this; + } + + public PeeringServicePrefixImpl withLearnedType(LearnedType learnedType) { + this.innerModel().withLearnedType(learnedType); return this; } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixesClientImpl.java new file mode 100644 index 000000000000..f20e802151a9 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixesClientImpl.java @@ -0,0 +1,635 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.peering.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.peering.fluent.PeeringServicePrefixesClient; +import com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PeeringServicePrefixesClient. */ +public final class PeeringServicePrefixesClientImpl implements PeeringServicePrefixesClient { + private final ClientLogger logger = new ClientLogger(PeeringServicePrefixesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final PeeringServicePrefixesService service; + + /** The service client containing this operation class. */ + private final PeeringManagementClientImpl client; + + /** + * Initializes an instance of PeeringServicePrefixesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PeeringServicePrefixesClientImpl(PeeringManagementClientImpl client) { + this.service = + RestProxy + .create(PeeringServicePrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PeeringManagementClientPeeringServicePrefixes to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PeeringManagementCli") + private interface PeeringServicePrefixesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" + + "/peeringServices/{peeringServiceName}/prefixes/{prefixName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("peeringServiceName") String peeringServiceName, + @PathParam("prefixName") String prefixName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" + + "/peeringServices/{peeringServiceName}/prefixes/{prefixName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("peeringServiceName") String peeringServiceName, + @PathParam("prefixName") String prefixName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PeeringServicePrefixInner peeringServicePrefix, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" + + "/peeringServices/{peeringServiceName}/prefixes/{prefixName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("peeringServiceName") String peeringServiceName, + @PathParam("prefixName") String prefixName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String peeringServiceName, String prefixName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (peeringServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); + } + if (prefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + prefixName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String peeringServiceName, String prefixName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (peeringServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); + } + if (prefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + prefixName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String peeringServiceName, String prefixName) { + return getWithResponseAsync(resourceGroupName, peeringServiceName, prefixName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeeringServicePrefixInner get(String resourceGroupName, String peeringServiceName, String prefixName) { + return getAsync(resourceGroupName, peeringServiceName, prefixName).block(); + } + + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String peeringServiceName, String prefixName, Context context) { + return getWithResponseAsync(resourceGroupName, peeringServiceName, prefixName, context).block(); + } + + /** + * Creates or updates the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param peeringServicePrefix The IP prefix for an peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String peeringServiceName, + String prefixName, + PeeringServicePrefixInner peeringServicePrefix) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (peeringServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); + } + if (prefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (peeringServicePrefix == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringServicePrefix is required and cannot be null.")); + } else { + peeringServicePrefix.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + prefixName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + peeringServicePrefix, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param peeringServicePrefix The IP prefix for an peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String peeringServiceName, + String prefixName, + PeeringServicePrefixInner peeringServicePrefix, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (peeringServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); + } + if (prefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (peeringServicePrefix == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringServicePrefix is required and cannot be null.")); + } else { + peeringServicePrefix.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + prefixName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + peeringServicePrefix, + accept, + context); + } + + /** + * Creates or updates the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param peeringServicePrefix The IP prefix for an peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String peeringServiceName, + String prefixName, + PeeringServicePrefixInner peeringServicePrefix) { + return createOrUpdateWithResponseAsync(resourceGroupName, peeringServiceName, prefixName, peeringServicePrefix) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Creates or updates the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param peeringServicePrefix The IP prefix for an peering. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeeringServicePrefixInner createOrUpdate( + String resourceGroupName, + String peeringServiceName, + String prefixName, + PeeringServicePrefixInner peeringServicePrefix) { + return createOrUpdateAsync(resourceGroupName, peeringServiceName, prefixName, peeringServicePrefix).block(); + } + + /** + * Creates or updates the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param peeringServicePrefix The IP prefix for an peering. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String peeringServiceName, + String prefixName, + PeeringServicePrefixInner peeringServicePrefix, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, peeringServiceName, prefixName, peeringServicePrefix, context) + .block(); + } + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String peeringServiceName, String prefixName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (peeringServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); + } + if (prefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + prefixName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String peeringServiceName, String prefixName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (peeringServiceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); + } + if (prefixName == null) { + return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + prefixName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String peeringServiceName, String prefixName) { + return deleteWithResponseAsync(resourceGroupName, peeringServiceName, prefixName) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String peeringServiceName, String prefixName) { + deleteAsync(resourceGroupName, peeringServiceName, prefixName).block(); + } + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String peeringServiceName, String prefixName, Context context) { + return deleteWithResponseAsync(resourceGroupName, peeringServiceName, prefixName, context).block(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredAsnsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixesImpl.java similarity index 52% rename from sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredAsnsImpl.java rename to sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixesImpl.java index bc2139090745..1d759b0acf33 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredAsnsImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixesImpl.java @@ -4,77 +4,63 @@ package com.azure.resourcemanager.peering.implementation; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.RegisteredAsnsClient; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner; -import com.azure.resourcemanager.peering.models.PeeringRegisteredAsn; -import com.azure.resourcemanager.peering.models.RegisteredAsns; +import com.azure.resourcemanager.peering.fluent.PeeringServicePrefixesClient; +import com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner; +import com.azure.resourcemanager.peering.models.PeeringServicePrefix; +import com.azure.resourcemanager.peering.models.PeeringServicePrefixes; import com.fasterxml.jackson.annotation.JsonIgnore; -public final class RegisteredAsnsImpl implements RegisteredAsns { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredAsnsImpl.class); +public final class PeeringServicePrefixesImpl implements PeeringServicePrefixes { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicePrefixesImpl.class); - private final RegisteredAsnsClient innerClient; + private final PeeringServicePrefixesClient innerClient; private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - public RegisteredAsnsImpl( - RegisteredAsnsClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) { + public PeeringServicePrefixesImpl( + PeeringServicePrefixesClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PeeringRegisteredAsn get(String resourceGroupName, String peeringName, String registeredAsnName) { - PeeringRegisteredAsnInner inner = this.serviceClient().get(resourceGroupName, peeringName, registeredAsnName); + public PeeringServicePrefix get(String resourceGroupName, String peeringServiceName, String prefixName) { + PeeringServicePrefixInner inner = this.serviceClient().get(resourceGroupName, peeringServiceName, prefixName); if (inner != null) { - return new PeeringRegisteredAsnImpl(inner, this.manager()); + return new PeeringServicePrefixImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse( - String resourceGroupName, String peeringName, String registeredAsnName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, peeringName, registeredAsnName, context); + public Response getWithResponse( + String resourceGroupName, String peeringServiceName, String prefixName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, peeringServiceName, prefixName, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PeeringRegisteredAsnImpl(inner.getValue(), this.manager())); + new PeeringServicePrefixImpl(inner.getValue(), this.manager())); } else { return null; } } - public void delete(String resourceGroupName, String peeringName, String registeredAsnName) { - this.serviceClient().delete(resourceGroupName, peeringName, registeredAsnName); + public void delete(String resourceGroupName, String peeringServiceName, String prefixName) { + this.serviceClient().delete(resourceGroupName, peeringServiceName, prefixName); } public Response deleteWithResponse( - String resourceGroupName, String peeringName, String registeredAsnName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, peeringName, registeredAsnName, context); + String resourceGroupName, String peeringServiceName, String prefixName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, peeringServiceName, prefixName, context); } - public PagedIterable listByPeering(String resourceGroupName, String peeringName) { - PagedIterable inner = - this.serviceClient().listByPeering(resourceGroupName, peeringName); - return Utils.mapPage(inner, inner1 -> new PeeringRegisteredAsnImpl(inner1, this.manager())); - } - - public PagedIterable listByPeering( - String resourceGroupName, String peeringName, Context context) { - PagedIterable inner = - this.serviceClient().listByPeering(resourceGroupName, peeringName, context); - return Utils.mapPage(inner, inner1 -> new PeeringRegisteredAsnImpl(inner1, this.manager())); - } - - public PeeringRegisteredAsn getById(String id) { + public PeeringServicePrefix getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -83,25 +69,25 @@ public PeeringRegisteredAsn getById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String peeringName = Utils.getValueFromIdByName(id, "peerings"); - if (peeringName == null) { + String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); + if (peeringServiceName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); } - String registeredAsnName = Utils.getValueFromIdByName(id, "registeredAsns"); - if (registeredAsnName == null) { + String prefixName = Utils.getValueFromIdByName(id, "prefixes"); + if (prefixName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'registeredAsns'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); } - return this.getWithResponse(resourceGroupName, peeringName, registeredAsnName, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, peeringServiceName, prefixName, Context.NONE).getValue(); } - public Response getByIdWithResponse(String id, Context context) { + public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -110,22 +96,22 @@ public Response getByIdWithResponse(String id, Context con String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String peeringName = Utils.getValueFromIdByName(id, "peerings"); - if (peeringName == null) { + String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); + if (peeringServiceName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); } - String registeredAsnName = Utils.getValueFromIdByName(id, "registeredAsns"); - if (registeredAsnName == null) { + String prefixName = Utils.getValueFromIdByName(id, "prefixes"); + if (prefixName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'registeredAsns'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); } - return this.getWithResponse(resourceGroupName, peeringName, registeredAsnName, context); + return this.getWithResponse(resourceGroupName, peeringServiceName, prefixName, context); } public void deleteById(String id) { @@ -137,22 +123,22 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String peeringName = Utils.getValueFromIdByName(id, "peerings"); - if (peeringName == null) { + String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); + if (peeringServiceName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); } - String registeredAsnName = Utils.getValueFromIdByName(id, "registeredAsns"); - if (registeredAsnName == null) { + String prefixName = Utils.getValueFromIdByName(id, "prefixes"); + if (prefixName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'registeredAsns'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); } - this.deleteWithResponse(resourceGroupName, peeringName, registeredAsnName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, peeringServiceName, prefixName, Context.NONE).getValue(); } public Response deleteByIdWithResponse(String id, Context context) { @@ -164,25 +150,25 @@ public Response deleteByIdWithResponse(String id, Context context) { String .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String peeringName = Utils.getValueFromIdByName(id, "peerings"); - if (peeringName == null) { + String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); + if (peeringServiceName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); + String + .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); } - String registeredAsnName = Utils.getValueFromIdByName(id, "registeredAsns"); - if (registeredAsnName == null) { + String prefixName = Utils.getValueFromIdByName(id, "prefixes"); + if (prefixName == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'registeredAsns'.", id))); + String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); } - return this.deleteWithResponse(resourceGroupName, peeringName, registeredAsnName, context); + return this.deleteWithResponse(resourceGroupName, peeringServiceName, prefixName, context); } - private RegisteredAsnsClient serviceClient() { + private PeeringServicePrefixesClient serviceClient() { return this.innerClient; } @@ -190,7 +176,7 @@ private com.azure.resourcemanager.peering.PeeringManager manager() { return this.serviceManager; } - public PeeringRegisteredAsnImpl define(String name) { - return new PeeringRegisteredAsnImpl(name, this.manager()); + public PeeringServicePrefixImpl define(String name) { + return new PeeringServicePrefixImpl(name, this.manager()); } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProviderImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProviderImpl.java index bdcdc77d7458..3aee4cc5491c 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProviderImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProviderImpl.java @@ -6,8 +6,6 @@ import com.azure.resourcemanager.peering.fluent.models.PeeringServiceProviderInner; import com.azure.resourcemanager.peering.models.PeeringServiceProvider; -import java.util.Collections; -import java.util.List; public final class PeeringServiceProviderImpl implements PeeringServiceProvider { private PeeringServiceProviderInner innerObject; @@ -36,15 +34,6 @@ public String serviceProviderName() { return this.innerModel().serviceProviderName(); } - public List peeringLocations() { - List inner = this.innerModel().peeringLocations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - public PeeringServiceProviderInner innerModel() { return this.innerObject; } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesClientImpl.java index df6c887e50a1..0b463b820f91 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesClientImpl.java @@ -4,8 +4,6 @@ package com.azure.resourcemanager.peering.implementation; -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; @@ -13,7 +11,6 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -61,56 +58,6 @@ public final class PrefixesClientImpl implements PrefixesClient { @Host("{$host}") @ServiceInterface(name = "PeeringManagementCli") private interface PrefixesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" - + "/peeringServices/{peeringServiceName}/prefixes/{prefixName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringServiceName") String peeringServiceName, - @PathParam("prefixName") String prefixName, - @QueryParam("$expand") String expand, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" - + "/peeringServices/{peeringServiceName}/prefixes/{prefixName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringServiceName") String peeringServiceName, - @PathParam("prefixName") String prefixName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PeeringServicePrefixInner peeringServicePrefix, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" - + "/peeringServices/{peeringServiceName}/prefixes/{prefixName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringServiceName") String peeringServiceName, - @PathParam("prefixName") String prefixName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" @@ -121,7 +68,6 @@ Mono> listByPeeringService( @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("peeringServiceName") String peeringServiceName, - @QueryParam("$expand") String expand, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -139,588 +85,18 @@ Mono> listByPeeringServiceNext( } /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param expand The properties to be expanded. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String peeringServiceName, String prefixName, String expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); - } - if (prefixName == null) { - return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - peeringServiceName, - prefixName, - expand, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param expand The properties to be expanded. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String peeringServiceName, String prefixName, String expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); - } - if (prefixName == null) { - return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - peeringServiceName, - prefixName, - expand, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param expand The properties to be expanded. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String peeringServiceName, String prefixName, String expand) { - return getWithResponseAsync(resourceGroupName, peeringServiceName, prefixName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String peeringServiceName, String prefixName) { - final String expand = null; - return getWithResponseAsync(resourceGroupName, peeringServiceName, prefixName, expand) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PeeringServicePrefixInner get(String resourceGroupName, String peeringServiceName, String prefixName) { - final String expand = null; - return getAsync(resourceGroupName, peeringServiceName, prefixName, expand).block(); - } - - /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param expand The properties to be expanded. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String peeringServiceName, String prefixName, String expand, Context context) { - return getWithResponseAsync(resourceGroupName, peeringServiceName, prefixName, expand, context).block(); - } - - /** - * Creates a new prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param peeringServicePrefix The properties needed to create a prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the peering service prefix class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String peeringServiceName, - String prefixName, - PeeringServicePrefixInner peeringServicePrefix) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); - } - if (prefixName == null) { - return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (peeringServicePrefix == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringServicePrefix is required and cannot be null.")); - } else { - peeringServicePrefix.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - peeringServiceName, - prefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - peeringServicePrefix, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param peeringServicePrefix The properties needed to create a prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the peering service prefix class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String peeringServiceName, - String prefixName, - PeeringServicePrefixInner peeringServicePrefix, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); - } - if (prefixName == null) { - return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (peeringServicePrefix == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringServicePrefix is required and cannot be null.")); - } else { - peeringServicePrefix.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - peeringServiceName, - prefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - peeringServicePrefix, - accept, - context); - } - - /** - * Creates a new prefix with the specified name under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param peeringServicePrefix The properties needed to create a prefix. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the peering service prefix class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String peeringServiceName, - String prefixName, - PeeringServicePrefixInner peeringServicePrefix) { - return createOrUpdateWithResponseAsync(resourceGroupName, peeringServiceName, prefixName, peeringServicePrefix) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param peeringServicePrefix The properties needed to create a prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the peering service prefix class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PeeringServicePrefixInner createOrUpdate( - String resourceGroupName, - String peeringServiceName, - String prefixName, - PeeringServicePrefixInner peeringServicePrefix) { - return createOrUpdateAsync(resourceGroupName, peeringServiceName, prefixName, peeringServicePrefix).block(); - } - - /** - * Creates a new prefix with the specified name under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param peeringServicePrefix The properties needed to create a prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the peering service prefix class. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String peeringServiceName, - String prefixName, - PeeringServicePrefixInner peeringServicePrefix, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, peeringServiceName, prefixName, peeringServicePrefix, context) - .block(); - } - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String peeringServiceName, String prefixName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); - } - if (prefixName == null) { - return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - peeringServiceName, - prefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String peeringServiceName, String prefixName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter peeringServiceName is required and cannot be null.")); - } - if (prefixName == null) { - return Mono.error(new IllegalArgumentException("Parameter prefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - peeringServiceName, - prefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String peeringServiceName, String prefixName) { - return deleteWithResponseAsync(resourceGroupName, peeringServiceName, prefixName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String peeringServiceName, String prefixName) { - deleteAsync(resourceGroupName, peeringServiceName, prefixName).block(); - } - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String peeringServiceName, String prefixName, Context context) { - return deleteWithResponseAsync(resourceGroupName, peeringServiceName, prefixName, context).block(); - } - - /** - * Lists all prefixes under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param expand The properties to be expanded. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringServiceSinglePageAsync( - String resourceGroupName, String peeringServiceName, String expand) { + String resourceGroupName, String peeringServiceName) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -750,7 +126,6 @@ private Mono> listByPeeringServiceSingl this.client.getEndpoint(), resourceGroupName, peeringServiceName, - expand, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -768,20 +143,19 @@ private Mono> listByPeeringServiceSingl } /** - * Lists all prefixes under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param expand The properties to be expanded. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringServiceSinglePageAsync( - String resourceGroupName, String peeringServiceName, String expand, Context context) { + String resourceGroupName, String peeringServiceName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -809,7 +183,6 @@ private Mono> listByPeeringServiceSingl this.client.getEndpoint(), resourceGroupName, peeringServiceName, - expand, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -826,96 +199,73 @@ private Mono> listByPeeringServiceSingl } /** - * Lists all prefixes under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param expand The properties to be expanded. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPeeringServiceAsync( - String resourceGroupName, String peeringServiceName, String expand) { - return new PagedFlux<>( - () -> listByPeeringServiceSinglePageAsync(resourceGroupName, peeringServiceName, expand), - nextLink -> listByPeeringServiceNextSinglePageAsync(nextLink)); - } - - /** - * Lists all prefixes under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringServiceAsync( String resourceGroupName, String peeringServiceName) { - final String expand = null; return new PagedFlux<>( - () -> listByPeeringServiceSinglePageAsync(resourceGroupName, peeringServiceName, expand), + () -> listByPeeringServiceSinglePageAsync(resourceGroupName, peeringServiceName), nextLink -> listByPeeringServiceNextSinglePageAsync(nextLink)); } /** - * Lists all prefixes under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param expand The properties to be expanded. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringServiceAsync( - String resourceGroupName, String peeringServiceName, String expand, Context context) { + String resourceGroupName, String peeringServiceName, Context context) { return new PagedFlux<>( - () -> listByPeeringServiceSinglePageAsync(resourceGroupName, peeringServiceName, expand, context), + () -> listByPeeringServiceSinglePageAsync(resourceGroupName, peeringServiceName, context), nextLink -> listByPeeringServiceNextSinglePageAsync(nextLink, context)); } /** - * Lists all prefixes under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeeringService( String resourceGroupName, String peeringServiceName) { - final String expand = null; - return new PagedIterable<>(listByPeeringServiceAsync(resourceGroupName, peeringServiceName, expand)); + return new PagedIterable<>(listByPeeringServiceAsync(resourceGroupName, peeringServiceName)); } /** - * Lists all prefixes under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param expand The properties to be expanded. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeeringService( - String resourceGroupName, String peeringServiceName, String expand, Context context) { - return new PagedIterable<>(listByPeeringServiceAsync(resourceGroupName, peeringServiceName, expand, context)); + String resourceGroupName, String peeringServiceName, Context context) { + return new PagedIterable<>(listByPeeringServiceAsync(resourceGroupName, peeringServiceName, context)); } /** @@ -925,7 +275,7 @@ public PagedIterable listByPeeringService( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringServiceNextSinglePageAsync(String nextLink) { @@ -962,7 +312,7 @@ private Mono> listByPeeringServiceNextS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringServiceNextSinglePageAsync( diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesImpl.java index 7b6c5a890d2c..e357579b4533 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesImpl.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.peering.implementation; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.peering.fluent.PrefixesClient; @@ -27,39 +25,6 @@ public PrefixesImpl(PrefixesClient innerClient, com.azure.resourcemanager.peerin this.serviceManager = serviceManager; } - public PeeringServicePrefix get(String resourceGroupName, String peeringServiceName, String prefixName) { - PeeringServicePrefixInner inner = this.serviceClient().get(resourceGroupName, peeringServiceName, prefixName); - if (inner != null) { - return new PeeringServicePrefixImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String peeringServiceName, String prefixName, String expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, peeringServiceName, prefixName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PeeringServicePrefixImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String peeringServiceName, String prefixName) { - this.serviceClient().delete(resourceGroupName, peeringServiceName, prefixName); - } - - public Response deleteWithResponse( - String resourceGroupName, String peeringServiceName, String prefixName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, peeringServiceName, prefixName, context); - } - public PagedIterable listByPeeringService( String resourceGroupName, String peeringServiceName) { PagedIterable inner = @@ -68,123 +33,12 @@ public PagedIterable listByPeeringService( } public PagedIterable listByPeeringService( - String resourceGroupName, String peeringServiceName, String expand, Context context) { + String resourceGroupName, String peeringServiceName, Context context) { PagedIterable inner = - this.serviceClient().listByPeeringService(resourceGroupName, peeringServiceName, expand, context); + this.serviceClient().listByPeeringService(resourceGroupName, peeringServiceName, context); return Utils.mapPage(inner, inner1 -> new PeeringServicePrefixImpl(inner1, this.manager())); } - public PeeringServicePrefix getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); - if (peeringServiceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); - } - String prefixName = Utils.getValueFromIdByName(id, "prefixes"); - if (prefixName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); - } - String localExpand = null; - return this - .getWithResponse(resourceGroupName, peeringServiceName, prefixName, localExpand, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, String expand, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); - if (peeringServiceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); - } - String prefixName = Utils.getValueFromIdByName(id, "prefixes"); - if (prefixName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); - } - return this.getWithResponse(resourceGroupName, peeringServiceName, prefixName, expand, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); - if (peeringServiceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); - } - String prefixName = Utils.getValueFromIdByName(id, "prefixes"); - if (prefixName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); - } - this.deleteWithResponse(resourceGroupName, peeringServiceName, prefixName, Context.NONE).getValue(); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); - if (peeringServiceName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); - } - String prefixName = Utils.getValueFromIdByName(id, "prefixes"); - if (prefixName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); - } - return this.deleteWithResponse(resourceGroupName, peeringServiceName, prefixName, context); - } - private PrefixesClient serviceClient() { return this.innerClient; } @@ -192,8 +46,4 @@ private PrefixesClient serviceClient() { private com.azure.resourcemanager.peering.PeeringManager manager() { return this.serviceManager; } - - public PeeringServicePrefixImpl define(String name) { - return new PeeringServicePrefixImpl(name, this.manager()); - } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ReceivedRoutesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ReceivedRoutesClientImpl.java deleted file mode 100644 index c966fd5a4fa6..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ReceivedRoutesClientImpl.java +++ /dev/null @@ -1,482 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.ReceivedRoutesClient; -import com.azure.resourcemanager.peering.fluent.models.PeeringReceivedRouteInner; -import com.azure.resourcemanager.peering.models.PeeringReceivedRouteListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ReceivedRoutesClient. */ -public final class ReceivedRoutesClientImpl implements ReceivedRoutesClient { - private final ClientLogger logger = new ClientLogger(ReceivedRoutesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ReceivedRoutesService service; - - /** The service client containing this operation class. */ - private final PeeringManagementClientImpl client; - - /** - * Initializes an instance of ReceivedRoutesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ReceivedRoutesClientImpl(PeeringManagementClientImpl client) { - this.service = - RestProxy.create(ReceivedRoutesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PeeringManagementClientReceivedRoutes to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PeeringManagementCli") - private interface ReceivedRoutesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/receivedRoutes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPeering( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @QueryParam("prefix") String prefix, - @QueryParam("asPath") String asPath, - @QueryParam("originAsValidationState") String originAsValidationState, - @QueryParam("rpkiValidationState") String rpkiValidationState, - @QueryParam("$skipToken") String skipToken, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPeeringNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param prefix The optional prefix that can be used to filter the routes. - * @param asPath The optional AS path that can be used to filter the routes. - * @param originAsValidationState The optional origin AS validation state that can be used to filter the routes. - * @param rpkiValidationState The optional RPKI validation state that can be used to filter the routes. - * @param skipToken The optional page continuation token that is used in the event of paginated result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringSinglePageAsync( - String resourceGroupName, - String peeringName, - String prefix, - String asPath, - String originAsValidationState, - String rpkiValidationState, - String skipToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByPeering( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - prefix, - asPath, - originAsValidationState, - rpkiValidationState, - skipToken, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param prefix The optional prefix that can be used to filter the routes. - * @param asPath The optional AS path that can be used to filter the routes. - * @param originAsValidationState The optional origin AS validation state that can be used to filter the routes. - * @param rpkiValidationState The optional RPKI validation state that can be used to filter the routes. - * @param skipToken The optional page continuation token that is used in the event of paginated result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringSinglePageAsync( - String resourceGroupName, - String peeringName, - String prefix, - String asPath, - String originAsValidationState, - String rpkiValidationState, - String skipToken, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPeering( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - prefix, - asPath, - originAsValidationState, - rpkiValidationState, - skipToken, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param prefix The optional prefix that can be used to filter the routes. - * @param asPath The optional AS path that can be used to filter the routes. - * @param originAsValidationState The optional origin AS validation state that can be used to filter the routes. - * @param rpkiValidationState The optional RPKI validation state that can be used to filter the routes. - * @param skipToken The optional page continuation token that is used in the event of paginated result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPeeringAsync( - String resourceGroupName, - String peeringName, - String prefix, - String asPath, - String originAsValidationState, - String rpkiValidationState, - String skipToken) { - return new PagedFlux<>( - () -> - listByPeeringSinglePageAsync( - resourceGroupName, - peeringName, - prefix, - asPath, - originAsValidationState, - rpkiValidationState, - skipToken), - nextLink -> listByPeeringNextSinglePageAsync(nextLink)); - } - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPeeringAsync(String resourceGroupName, String peeringName) { - final String prefix = null; - final String asPath = null; - final String originAsValidationState = null; - final String rpkiValidationState = null; - final String skipToken = null; - return new PagedFlux<>( - () -> - listByPeeringSinglePageAsync( - resourceGroupName, - peeringName, - prefix, - asPath, - originAsValidationState, - rpkiValidationState, - skipToken), - nextLink -> listByPeeringNextSinglePageAsync(nextLink)); - } - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param prefix The optional prefix that can be used to filter the routes. - * @param asPath The optional AS path that can be used to filter the routes. - * @param originAsValidationState The optional origin AS validation state that can be used to filter the routes. - * @param rpkiValidationState The optional RPKI validation state that can be used to filter the routes. - * @param skipToken The optional page continuation token that is used in the event of paginated result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPeeringAsync( - String resourceGroupName, - String peeringName, - String prefix, - String asPath, - String originAsValidationState, - String rpkiValidationState, - String skipToken, - Context context) { - return new PagedFlux<>( - () -> - listByPeeringSinglePageAsync( - resourceGroupName, - peeringName, - prefix, - asPath, - originAsValidationState, - rpkiValidationState, - skipToken, - context), - nextLink -> listByPeeringNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPeering(String resourceGroupName, String peeringName) { - final String prefix = null; - final String asPath = null; - final String originAsValidationState = null; - final String rpkiValidationState = null; - final String skipToken = null; - return new PagedIterable<>( - listByPeeringAsync( - resourceGroupName, - peeringName, - prefix, - asPath, - originAsValidationState, - rpkiValidationState, - skipToken)); - } - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param prefix The optional prefix that can be used to filter the routes. - * @param asPath The optional AS path that can be used to filter the routes. - * @param originAsValidationState The optional origin AS validation state that can be used to filter the routes. - * @param rpkiValidationState The optional RPKI validation state that can be used to filter the routes. - * @param skipToken The optional page continuation token that is used in the event of paginated result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPeering( - String resourceGroupName, - String peeringName, - String prefix, - String asPath, - String originAsValidationState, - String rpkiValidationState, - String skipToken, - Context context) { - return new PagedIterable<>( - listByPeeringAsync( - resourceGroupName, - peeringName, - prefix, - asPath, - originAsValidationState, - rpkiValidationState, - skipToken, - context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPeeringNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPeeringNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ReceivedRoutesImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ReceivedRoutesImpl.java deleted file mode 100644 index 0c2ad7795e25..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ReceivedRoutesImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.ReceivedRoutesClient; -import com.azure.resourcemanager.peering.fluent.models.PeeringReceivedRouteInner; -import com.azure.resourcemanager.peering.models.PeeringReceivedRoute; -import com.azure.resourcemanager.peering.models.ReceivedRoutes; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ReceivedRoutesImpl implements ReceivedRoutes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReceivedRoutesImpl.class); - - private final ReceivedRoutesClient innerClient; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - public ReceivedRoutesImpl( - ReceivedRoutesClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByPeering(String resourceGroupName, String peeringName) { - PagedIterable inner = - this.serviceClient().listByPeering(resourceGroupName, peeringName); - return Utils.mapPage(inner, inner1 -> new PeeringReceivedRouteImpl(inner1, this.manager())); - } - - public PagedIterable listByPeering( - String resourceGroupName, - String peeringName, - String prefix, - String asPath, - String originAsValidationState, - String rpkiValidationState, - String skipToken, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByPeering( - resourceGroupName, - peeringName, - prefix, - asPath, - originAsValidationState, - rpkiValidationState, - skipToken, - context); - return Utils.mapPage(inner, inner1 -> new PeeringReceivedRouteImpl(inner1, this.manager())); - } - - private ReceivedRoutesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredAsnsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredAsnsClientImpl.java deleted file mode 100644 index cf90b31f394b..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredAsnsClientImpl.java +++ /dev/null @@ -1,924 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.RegisteredAsnsClient; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner; -import com.azure.resourcemanager.peering.models.PeeringRegisteredAsnListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RegisteredAsnsClient. */ -public final class RegisteredAsnsClientImpl implements RegisteredAsnsClient { - private final ClientLogger logger = new ClientLogger(RegisteredAsnsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RegisteredAsnsService service; - - /** The service client containing this operation class. */ - private final PeeringManagementClientImpl client; - - /** - * Initializes an instance of RegisteredAsnsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegisteredAsnsClientImpl(PeeringManagementClientImpl client) { - this.service = - RestProxy.create(RegisteredAsnsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PeeringManagementClientRegisteredAsns to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PeeringManagementCli") - private interface RegisteredAsnsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/registeredAsns/{registeredAsnName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @PathParam("registeredAsnName") String registeredAsnName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/registeredAsns/{registeredAsnName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @PathParam("registeredAsnName") String registeredAsnName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PeeringRegisteredAsnInner registeredAsn, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/registeredAsns/{registeredAsnName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @PathParam("registeredAsnName") String registeredAsnName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/registeredAsns") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPeering( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPeeringNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String peeringName, String registeredAsnName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredAsnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredAsnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredAsnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String peeringName, String registeredAsnName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredAsnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredAsnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredAsnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String peeringName, String registeredAsnName) { - return getWithResponseAsync(resourceGroupName, peeringName, registeredAsnName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PeeringRegisteredAsnInner get(String resourceGroupName, String peeringName, String registeredAsnName) { - return getAsync(resourceGroupName, peeringName, registeredAsnName).block(); - } - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String peeringName, String registeredAsnName, Context context) { - return getWithResponseAsync(resourceGroupName, peeringName, registeredAsnName, context).block(); - } - - /** - * Creates a new registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the ASN. - * @param registeredAsn The properties needed to create a registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's ASN that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String peeringName, - String registeredAsnName, - PeeringRegisteredAsnInner registeredAsn) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredAsnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredAsnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (registeredAsn == null) { - return Mono.error(new IllegalArgumentException("Parameter registeredAsn is required and cannot be null.")); - } else { - registeredAsn.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredAsnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - registeredAsn, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the ASN. - * @param registeredAsn The properties needed to create a registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's ASN that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String peeringName, - String registeredAsnName, - PeeringRegisteredAsnInner registeredAsn, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredAsnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredAsnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (registeredAsn == null) { - return Mono.error(new IllegalArgumentException("Parameter registeredAsn is required and cannot be null.")); - } else { - registeredAsn.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredAsnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - registeredAsn, - accept, - context); - } - - /** - * Creates a new registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the ASN. - * @param registeredAsn The properties needed to create a registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's ASN that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String peeringName, - String registeredAsnName, - PeeringRegisteredAsnInner registeredAsn) { - return createOrUpdateWithResponseAsync(resourceGroupName, peeringName, registeredAsnName, registeredAsn) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the ASN. - * @param registeredAsn The properties needed to create a registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's ASN that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PeeringRegisteredAsnInner createOrUpdate( - String resourceGroupName, - String peeringName, - String registeredAsnName, - PeeringRegisteredAsnInner registeredAsn) { - return createOrUpdateAsync(resourceGroupName, peeringName, registeredAsnName, registeredAsn).block(); - } - - /** - * Creates a new registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the ASN. - * @param registeredAsn The properties needed to create a registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's ASN that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String peeringName, - String registeredAsnName, - PeeringRegisteredAsnInner registeredAsn, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, peeringName, registeredAsnName, registeredAsn, context) - .block(); - } - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String peeringName, String registeredAsnName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredAsnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredAsnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredAsnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String peeringName, String registeredAsnName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredAsnName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredAsnName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredAsnName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String peeringName, String registeredAsnName) { - return deleteWithResponseAsync(resourceGroupName, peeringName, registeredAsnName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String peeringName, String registeredAsnName) { - deleteAsync(resourceGroupName, peeringName, registeredAsnName).block(); - } - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String peeringName, String registeredAsnName, Context context) { - return deleteWithResponseAsync(resourceGroupName, peeringName, registeredAsnName, context).block(); - } - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringSinglePageAsync( - String resourceGroupName, String peeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByPeering( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringSinglePageAsync( - String resourceGroupName, String peeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPeering( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPeeringAsync(String resourceGroupName, String peeringName) { - return new PagedFlux<>( - () -> listByPeeringSinglePageAsync(resourceGroupName, peeringName), - nextLink -> listByPeeringNextSinglePageAsync(nextLink)); - } - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPeeringAsync( - String resourceGroupName, String peeringName, Context context) { - return new PagedFlux<>( - () -> listByPeeringSinglePageAsync(resourceGroupName, peeringName, context), - nextLink -> listByPeeringNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPeering(String resourceGroupName, String peeringName) { - return new PagedIterable<>(listByPeeringAsync(resourceGroupName, peeringName)); - } - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPeering( - String resourceGroupName, String peeringName, Context context) { - return new PagedIterable<>(listByPeeringAsync(resourceGroupName, peeringName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPeeringNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPeeringNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredPrefixesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredPrefixesClientImpl.java deleted file mode 100644 index d7713578ad08..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredPrefixesClientImpl.java +++ /dev/null @@ -1,931 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.RegisteredPrefixesClient; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner; -import com.azure.resourcemanager.peering.models.PeeringRegisteredPrefixListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RegisteredPrefixesClient. */ -public final class RegisteredPrefixesClientImpl implements RegisteredPrefixesClient { - private final ClientLogger logger = new ClientLogger(RegisteredPrefixesClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final RegisteredPrefixesService service; - - /** The service client containing this operation class. */ - private final PeeringManagementClientImpl client; - - /** - * Initializes an instance of RegisteredPrefixesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegisteredPrefixesClientImpl(PeeringManagementClientImpl client) { - this.service = - RestProxy.create(RegisteredPrefixesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for PeeringManagementClientRegisteredPrefixes to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "PeeringManagementCli") - private interface RegisteredPrefixesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/registeredPrefixes/{registeredPrefixName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @PathParam("registeredPrefixName") String registeredPrefixName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/registeredPrefixes/{registeredPrefixName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @PathParam("registeredPrefixName") String registeredPrefixName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PeeringRegisteredPrefixInner registeredPrefix, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/registeredPrefixes/{registeredPrefixName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @PathParam("registeredPrefixName") String registeredPrefixName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" - + "/{peeringName}/registeredPrefixes") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPeering( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("peeringName") String peeringName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByPeeringNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String peeringName, String registeredPrefixName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredPrefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredPrefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String peeringName, String registeredPrefixName) { - return getWithResponseAsync(resourceGroupName, peeringName, registeredPrefixName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PeeringRegisteredPrefixInner get(String resourceGroupName, String peeringName, String registeredPrefixName) { - return getAsync(resourceGroupName, peeringName, registeredPrefixName).block(); - } - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context) { - return getWithResponseAsync(resourceGroupName, peeringName, registeredPrefixName, context).block(); - } - - /** - * Creates a new registered prefix with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param registeredPrefix The properties needed to create a registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's prefix that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String peeringName, - String registeredPrefixName, - PeeringRegisteredPrefixInner registeredPrefix) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (registeredPrefix == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredPrefix is required and cannot be null.")); - } else { - registeredPrefix.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredPrefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - registeredPrefix, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a new registered prefix with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param registeredPrefix The properties needed to create a registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's prefix that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String peeringName, - String registeredPrefixName, - PeeringRegisteredPrefixInner registeredPrefix, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (registeredPrefix == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredPrefix is required and cannot be null.")); - } else { - registeredPrefix.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredPrefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - registeredPrefix, - accept, - context); - } - - /** - * Creates a new registered prefix with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param registeredPrefix The properties needed to create a registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's prefix that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String peeringName, - String registeredPrefixName, - PeeringRegisteredPrefixInner registeredPrefix) { - return createOrUpdateWithResponseAsync(resourceGroupName, peeringName, registeredPrefixName, registeredPrefix) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates a new registered prefix with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param registeredPrefix The properties needed to create a registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's prefix that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PeeringRegisteredPrefixInner createOrUpdate( - String resourceGroupName, - String peeringName, - String registeredPrefixName, - PeeringRegisteredPrefixInner registeredPrefix) { - return createOrUpdateAsync(resourceGroupName, peeringName, registeredPrefixName, registeredPrefix).block(); - } - - /** - * Creates a new registered prefix with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param registeredPrefix The properties needed to create a registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the customer's prefix that is registered by the peering service provider. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String peeringName, - String registeredPrefixName, - PeeringRegisteredPrefixInner registeredPrefix, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, peeringName, registeredPrefixName, registeredPrefix, context) - .block(); - } - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String peeringName, String registeredPrefixName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredPrefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (registeredPrefixName == null) { - return Mono - .error(new IllegalArgumentException("Parameter registeredPrefixName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - registeredPrefixName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); - } - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String peeringName, String registeredPrefixName) { - return deleteWithResponseAsync(resourceGroupName, peeringName, registeredPrefixName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String peeringName, String registeredPrefixName) { - deleteAsync(resourceGroupName, peeringName, registeredPrefixName).block(); - } - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context) { - return deleteWithResponseAsync(resourceGroupName, peeringName, registeredPrefixName, context).block(); - } - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringSinglePageAsync( - String resourceGroupName, String peeringName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByPeering( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringSinglePageAsync( - String resourceGroupName, String peeringName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (peeringName == null) { - return Mono.error(new IllegalArgumentException("Parameter peeringName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPeering( - this.client.getEndpoint(), - resourceGroupName, - peeringName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPeeringAsync(String resourceGroupName, String peeringName) { - return new PagedFlux<>( - () -> listByPeeringSinglePageAsync(resourceGroupName, peeringName), - nextLink -> listByPeeringNextSinglePageAsync(nextLink)); - } - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByPeeringAsync( - String resourceGroupName, String peeringName, Context context) { - return new PagedFlux<>( - () -> listByPeeringSinglePageAsync(resourceGroupName, peeringName, context), - nextLink -> listByPeeringNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPeering(String resourceGroupName, String peeringName) { - return new PagedIterable<>(listByPeeringAsync(resourceGroupName, peeringName)); - } - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByPeering( - String resourceGroupName, String peeringName, Context context) { - return new PagedIterable<>(listByPeeringAsync(resourceGroupName, peeringName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByPeeringNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByPeeringNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByPeeringNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredPrefixesImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredPrefixesImpl.java deleted file mode 100644 index 2e2d83d4cd74..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/RegisteredPrefixesImpl.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.RegisteredPrefixesClient; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner; -import com.azure.resourcemanager.peering.models.PeeringRegisteredPrefix; -import com.azure.resourcemanager.peering.models.RegisteredPrefixes; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class RegisteredPrefixesImpl implements RegisteredPrefixes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredPrefixesImpl.class); - - private final RegisteredPrefixesClient innerClient; - - private final com.azure.resourcemanager.peering.PeeringManager serviceManager; - - public RegisteredPrefixesImpl( - RegisteredPrefixesClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PeeringRegisteredPrefix get(String resourceGroupName, String peeringName, String registeredPrefixName) { - PeeringRegisteredPrefixInner inner = - this.serviceClient().get(resourceGroupName, peeringName, registeredPrefixName); - if (inner != null) { - return new PeeringRegisteredPrefixImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, peeringName, registeredPrefixName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PeeringRegisteredPrefixImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String peeringName, String registeredPrefixName) { - this.serviceClient().delete(resourceGroupName, peeringName, registeredPrefixName); - } - - public Response deleteWithResponse( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, peeringName, registeredPrefixName, context); - } - - public PagedIterable listByPeering(String resourceGroupName, String peeringName) { - PagedIterable inner = - this.serviceClient().listByPeering(resourceGroupName, peeringName); - return Utils.mapPage(inner, inner1 -> new PeeringRegisteredPrefixImpl(inner1, this.manager())); - } - - public PagedIterable listByPeering( - String resourceGroupName, String peeringName, Context context) { - PagedIterable inner = - this.serviceClient().listByPeering(resourceGroupName, peeringName, context); - return Utils.mapPage(inner, inner1 -> new PeeringRegisteredPrefixImpl(inner1, this.manager())); - } - - public PeeringRegisteredPrefix getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String peeringName = Utils.getValueFromIdByName(id, "peerings"); - if (peeringName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); - } - String registeredPrefixName = Utils.getValueFromIdByName(id, "registeredPrefixes"); - if (registeredPrefixName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'registeredPrefixes'.", id))); - } - return this.getWithResponse(resourceGroupName, peeringName, registeredPrefixName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String peeringName = Utils.getValueFromIdByName(id, "peerings"); - if (peeringName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); - } - String registeredPrefixName = Utils.getValueFromIdByName(id, "registeredPrefixes"); - if (registeredPrefixName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'registeredPrefixes'.", id))); - } - return this.getWithResponse(resourceGroupName, peeringName, registeredPrefixName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String peeringName = Utils.getValueFromIdByName(id, "peerings"); - if (peeringName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); - } - String registeredPrefixName = Utils.getValueFromIdByName(id, "registeredPrefixes"); - if (registeredPrefixName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'registeredPrefixes'.", id))); - } - this.deleteWithResponse(resourceGroupName, peeringName, registeredPrefixName, Context.NONE).getValue(); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String peeringName = Utils.getValueFromIdByName(id, "peerings"); - if (peeringName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); - } - String registeredPrefixName = Utils.getValueFromIdByName(id, "registeredPrefixes"); - if (registeredPrefixName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'registeredPrefixes'.", id))); - } - return this.deleteWithResponse(resourceGroupName, peeringName, registeredPrefixName, context); - } - - private RegisteredPrefixesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.peering.PeeringManager manager() { - return this.serviceManager; - } - - public PeeringRegisteredPrefixImpl define(String name) { - return new PeeringRegisteredPrefixImpl(name, this.manager()); - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/BgpSession.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/BgpSession.java index e285cc76f142..ef87a7e4ba72 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/BgpSession.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/BgpSession.java @@ -29,13 +29,13 @@ public final class BgpSession { /* * The IPv4 session address on Microsoft's end. */ - @JsonProperty(value = "microsoftSessionIPv4Address") + @JsonProperty(value = "microsoftSessionIPv4Address", access = JsonProperty.Access.WRITE_ONLY) private String microsoftSessionIPv4Address; /* * The IPv6 session address on Microsoft's end. */ - @JsonProperty(value = "microsoftSessionIPv6Address") + @JsonProperty(value = "microsoftSessionIPv6Address", access = JsonProperty.Access.WRITE_ONLY) private String microsoftSessionIPv6Address; /* @@ -129,17 +129,6 @@ public String microsoftSessionIPv4Address() { return this.microsoftSessionIPv4Address; } - /** - * Set the microsoftSessionIPv4Address property: The IPv4 session address on Microsoft's end. - * - * @param microsoftSessionIPv4Address the microsoftSessionIPv4Address value to set. - * @return the BgpSession object itself. - */ - public BgpSession withMicrosoftSessionIPv4Address(String microsoftSessionIPv4Address) { - this.microsoftSessionIPv4Address = microsoftSessionIPv4Address; - return this; - } - /** * Get the microsoftSessionIPv6Address property: The IPv6 session address on Microsoft's end. * @@ -149,17 +138,6 @@ public String microsoftSessionIPv6Address() { return this.microsoftSessionIPv6Address; } - /** - * Set the microsoftSessionIPv6Address property: The IPv6 session address on Microsoft's end. - * - * @param microsoftSessionIPv6Address the microsoftSessionIPv6Address value to set. - * @return the BgpSession object itself. - */ - public BgpSession withMicrosoftSessionIPv6Address(String microsoftSessionIPv6Address) { - this.microsoftSessionIPv6Address = microsoftSessionIPv6Address; - return this; - } - /** * Get the peerSessionIPv4Address property: The IPv4 session address on peer's end. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefix.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefix.java deleted file mode 100644 index f4484b34911b..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefix.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.resourcemanager.peering.fluent.models.CdnPeeringPrefixInner; - -/** An immutable client-side representation of CdnPeeringPrefix. */ -public interface CdnPeeringPrefix { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the prefix property: The prefix. - * - * @return the prefix value. - */ - String prefix(); - - /** - * Gets the azureRegion property: The Azure region. - * - * @return the azureRegion value. - */ - String azureRegion(); - - /** - * Gets the azureService property: The Azure service. - * - * @return the azureService value. - */ - String azureService(); - - /** - * Gets the isPrimaryRegion property: The flag that indicates whether or not this is the primary region. - * - * @return the isPrimaryRegion value. - */ - Boolean isPrimaryRegion(); - - /** - * Gets the bgpCommunity property: The BGP Community. - * - * @return the bgpCommunity value. - */ - String bgpCommunity(); - - /** - * Gets the inner com.azure.resourcemanager.peering.fluent.models.CdnPeeringPrefixInner object. - * - * @return the inner object. - */ - CdnPeeringPrefixInner innerModel(); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefixListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefixListResult.java deleted file mode 100644 index 59289b141a5f..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefixListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.models.CdnPeeringPrefixInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The paginated list of CDN peering prefixes. */ -@Fluent -public final class CdnPeeringPrefixListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CdnPeeringPrefixListResult.class); - - /* - * The list of CDN peering prefixes. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link to fetch the next page of CDN peering prefixes. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of CDN peering prefixes. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of CDN peering prefixes. - * - * @param value the value value to set. - * @return the CdnPeeringPrefixListResult object itself. - */ - public CdnPeeringPrefixListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to fetch the next page of CDN peering prefixes. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to fetch the next page of CDN peering prefixes. - * - * @param nextLink the nextLink value to set. - * @return the CdnPeeringPrefixListResult object itself. - */ - public CdnPeeringPrefixListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefixes.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefixes.java deleted file mode 100644 index b2162b04bbbb..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CdnPeeringPrefixes.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of CdnPeeringPrefixes. */ -public interface CdnPeeringPrefixes { - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - PagedIterable list(String peeringLocation); - - /** - * Lists all of the advertised prefixes for the specified peering location. - * - * @param peeringLocation The peering location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of CDN peering prefixes. - */ - PagedIterable list(String peeringLocation, Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CheckServiceProviderAvailabilityInput.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CheckServiceProviderAvailabilityInput.java index 8d3a2daae988..628d7f627cee 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CheckServiceProviderAvailabilityInput.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CheckServiceProviderAvailabilityInput.java @@ -15,19 +15,19 @@ public final class CheckServiceProviderAvailabilityInput { @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckServiceProviderAvailabilityInput.class); /* - * Gets or sets the peering service location. + * Gets or sets the PeeringServiceLocation */ @JsonProperty(value = "peeringServiceLocation") private String peeringServiceLocation; /* - * Gets or sets the peering service provider. + * Gets or sets the PeeringServiceProvider */ @JsonProperty(value = "peeringServiceProvider") private String peeringServiceProvider; /** - * Get the peeringServiceLocation property: Gets or sets the peering service location. + * Get the peeringServiceLocation property: Gets or sets the PeeringServiceLocation. * * @return the peeringServiceLocation value. */ @@ -36,7 +36,7 @@ public String peeringServiceLocation() { } /** - * Set the peeringServiceLocation property: Gets or sets the peering service location. + * Set the peeringServiceLocation property: Gets or sets the PeeringServiceLocation. * * @param peeringServiceLocation the peeringServiceLocation value to set. * @return the CheckServiceProviderAvailabilityInput object itself. @@ -47,7 +47,7 @@ public CheckServiceProviderAvailabilityInput withPeeringServiceLocation(String p } /** - * Get the peeringServiceProvider property: Gets or sets the peering service provider. + * Get the peeringServiceProvider property: Gets or sets the PeeringServiceProvider. * * @return the peeringServiceProvider value. */ @@ -56,7 +56,7 @@ public String peeringServiceProvider() { } /** - * Set the peeringServiceProvider property: Gets or sets the peering service provider. + * Set the peeringServiceProvider property: Gets or sets the PeeringServiceProvider. * * @param peeringServiceProvider the peeringServiceProvider value to set. * @return the CheckServiceProviderAvailabilityInput object itself. diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ContactDetail.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ContactDetail.java deleted file mode 100644 index 73276b13ba43..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ContactDetail.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The contact detail class. */ -@Fluent -public final class ContactDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactDetail.class); - - /* - * The role of the contact. - */ - @JsonProperty(value = "role") - private Role role; - - /* - * The e-mail address of the contact. - */ - @JsonProperty(value = "email") - private String email; - - /* - * The phone number of the contact. - */ - @JsonProperty(value = "phone") - private String phone; - - /** - * Get the role property: The role of the contact. - * - * @return the role value. - */ - public Role role() { - return this.role; - } - - /** - * Set the role property: The role of the contact. - * - * @param role the role value to set. - * @return the ContactDetail object itself. - */ - public ContactDetail withRole(Role role) { - this.role = role; - return this; - } - - /** - * Get the email property: The e-mail address of the contact. - * - * @return the email value. - */ - public String email() { - return this.email; - } - - /** - * Set the email property: The e-mail address of the contact. - * - * @param email the email value to set. - * @return the ContactDetail object itself. - */ - public ContactDetail withEmail(String email) { - this.email = email; - return this; - } - - /** - * Get the phone property: The phone number of the contact. - * - * @return the phone value. - */ - public String phone() { - return this.phone; - } - - /** - * Set the phone property: The phone number of the contact. - * - * @param phone the phone value to set. - * @return the ContactDetail object itself. - */ - public ContactDetail withPhone(String phone) { - this.phone = phone; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ContactInfo.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ContactInfo.java new file mode 100644 index 000000000000..e502636fa5d4 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ContactInfo.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.peering.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The contact information of the peer. */ +@Fluent +public final class ContactInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactInfo.class); + + /* + * The list of email addresses. + */ + @JsonProperty(value = "emails") + private List emails; + + /* + * The list of contact numbers. + */ + @JsonProperty(value = "phone") + private List phone; + + /** + * Get the emails property: The list of email addresses. + * + * @return the emails value. + */ + public List emails() { + return this.emails; + } + + /** + * Set the emails property: The list of email addresses. + * + * @param emails the emails value to set. + * @return the ContactInfo object itself. + */ + public ContactInfo withEmails(List emails) { + this.emails = emails; + return this; + } + + /** + * Get the phone property: The list of contact numbers. + * + * @return the phone value. + */ + public List phone() { + return this.phone; + } + + /** + * Set the phone property: The list of contact numbers. + * + * @param phone the phone value to set. + * @return the ContactInfo object itself. + */ + public ContactInfo withPhone(List phone) { + this.phone = phone; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectConnection.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectConnection.java index f1525cab182d..e59d31c3cd95 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectConnection.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectConnection.java @@ -23,7 +23,7 @@ public final class DirectConnection { /* * The bandwidth that is actually provisioned. */ - @JsonProperty(value = "provisionedBandwidthInMbps", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "provisionedBandwidthInMbps") private Integer provisionedBandwidthInMbps; /* @@ -39,13 +39,6 @@ public final class DirectConnection { @JsonProperty(value = "useForPeeringService") private Boolean useForPeeringService; - /* - * The ID used within Microsoft's peering provisioning system to track the - * connection - */ - @JsonProperty(value = "microsoftTrackingId", access = JsonProperty.Access.WRITE_ONLY) - private String microsoftTrackingId; - /* * The PeeringDB.com ID of the facility at which the connection has to be * set up. @@ -71,12 +64,6 @@ public final class DirectConnection { @JsonProperty(value = "connectionIdentifier") private String connectionIdentifier; - /* - * The error message related to the connection state, if any. - */ - @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String errorMessage; - /** * Get the bandwidthInMbps property: The bandwidth of the connection. * @@ -106,6 +93,17 @@ public Integer provisionedBandwidthInMbps() { return this.provisionedBandwidthInMbps; } + /** + * Set the provisionedBandwidthInMbps property: The bandwidth that is actually provisioned. + * + * @param provisionedBandwidthInMbps the provisionedBandwidthInMbps value to set. + * @return the DirectConnection object itself. + */ + public DirectConnection withProvisionedBandwidthInMbps(Integer provisionedBandwidthInMbps) { + this.provisionedBandwidthInMbps = provisionedBandwidthInMbps; + return this; + } + /** * Get the sessionAddressProvider property: The field indicating if Microsoft provides session ip addresses. * @@ -148,16 +146,6 @@ public DirectConnection withUseForPeeringService(Boolean useForPeeringService) { return this; } - /** - * Get the microsoftTrackingId property: The ID used within Microsoft's peering provisioning system to track the - * connection. - * - * @return the microsoftTrackingId value. - */ - public String microsoftTrackingId() { - return this.microsoftTrackingId; - } - /** * Get the peeringDBFacilityId property: The PeeringDB.com ID of the facility at which the connection has to be set * up. @@ -229,15 +217,6 @@ public DirectConnection withConnectionIdentifier(String connectionIdentifier) { return this; } - /** - * Get the errorMessage property: The error message related to the connection state, if any. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - /** * Validates the instance. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringType.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringType.java index f919a586d09e..1dd6de3011f4 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringType.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringType.java @@ -22,12 +22,6 @@ public final class DirectPeeringType extends ExpandableStringEnum { /** Static value Available for Enum0. */ public static final Enum0 AVAILABLE = fromString("Available"); - /** Static value Unavailable for Enum0. */ - public static final Enum0 UNAVAILABLE = fromString("Unavailable"); + /** Static value UnAvailable for Enum0. */ + public static final Enum0 UN_AVAILABLE = fromString("UnAvailable"); /** * Creates or finds a Enum0 from its string representation. diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangeConnection.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangeConnection.java index a0fd9eca4f84..d6a7e767fcfd 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangeConnection.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangeConnection.java @@ -39,12 +39,6 @@ public final class ExchangeConnection { @JsonProperty(value = "connectionIdentifier") private String connectionIdentifier; - /* - * The error message related to the connection state, if any. - */ - @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String errorMessage; - /** * Get the peeringDBFacilityId property: The PeeringDB.com ID of the facility at which the connection has to be set * up. @@ -116,15 +110,6 @@ public ExchangeConnection withConnectionIdentifier(String connectionIdentifier) return this; } - /** - * Get the errorMessage property: The error message related to the connection state, if any. - * - * @return the errorMessage value. - */ - public String errorMessage() { - return this.errorMessage; - } - /** * Validates the instance. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LearnedType.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LearnedType.java index a80433c8327d..a0286db76b3d 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LearnedType.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LearnedType.java @@ -13,8 +13,8 @@ public final class LearnedType extends ExpandableStringEnum { /** Static value None for LearnedType. */ public static final LearnedType NONE = fromString("None"); - /** Static value ViaServiceProvider for LearnedType. */ - public static final LearnedType VIA_SERVICE_PROVIDER = fromString("ViaServiceProvider"); + /** Static value ViaPartner for LearnedType. */ + public static final LearnedType VIA_PARTNER = fromString("ViaPartner"); /** Static value ViaSession for LearnedType. */ public static final LearnedType VIA_SESSION = fromString("ViaSession"); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeerings.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeerings.java index f41687314042..0c0fc2ab7437 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeerings.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeerings.java @@ -26,12 +26,11 @@ public interface LegacyPeerings { * * @param peeringLocation The location of the peering. * @param kind The kind of the peering. - * @param asn The ASN number associated with a legacy peering. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of peerings. */ - PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context); + PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Name.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Name.java new file mode 100644 index 000000000000..460f07334167 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Name.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.peering.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Name. */ +public final class Name extends ExpandableStringEnum { + /** Static value Basic_Exchange_Free for Name. */ + public static final Name BASIC_EXCHANGE_FREE = fromString("Basic_Exchange_Free"); + + /** Static value Basic_Direct_Free for Name. */ + public static final Name BASIC_DIRECT_FREE = fromString("Basic_Direct_Free"); + + /** Static value Premium_Direct_Free for Name. */ + public static final Name PREMIUM_DIRECT_FREE = fromString("Premium_Direct_Free"); + + /** Static value Premium_Exchange_Metered for Name. */ + public static final Name PREMIUM_EXCHANGE_METERED = fromString("Premium_Exchange_Metered"); + + /** Static value Premium_Direct_Metered for Name. */ + public static final Name PREMIUM_DIRECT_METERED = fromString("Premium_Direct_Metered"); + + /** Static value Premium_Direct_Unlimited for Name. */ + public static final Name PREMIUM_DIRECT_UNLIMITED = fromString("Premium_Direct_Unlimited"); + + /** + * Creates or finds a Name from its string representation. + * + * @param name a name to look for. + * @return the corresponding Name. + */ + @JsonCreator + public static Name fromString(String name) { + return fromString(name, Name.class); + } + + /** @return known Name values. */ + public static Collection values() { + return values(Name.class); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsn.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsn.java index 7f376692e5d8..23fd7df74263 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsn.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsn.java @@ -6,7 +6,6 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeerAsnInner; -import java.util.List; /** An immutable client-side representation of PeerAsn. */ public interface PeerAsn { @@ -39,11 +38,11 @@ public interface PeerAsn { Integer peerAsn(); /** - * Gets the peerContactDetail property: The contact details of the peer. + * Gets the peerContactInfo property: The contact information of the peer. * - * @return the peerContactDetail value. + * @return the peerContactInfo value. */ - List peerContactDetail(); + ContactInfo peerContactInfo(); /** * Gets the peerName property: The name of the peer. @@ -59,13 +58,6 @@ public interface PeerAsn { */ ValidationState validationState(); - /** - * Gets the errorMessage property: The error message for the validation state. - * - * @return the errorMessage value. - */ - String errorMessage(); - /** * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeerAsnInner object. * @@ -87,7 +79,7 @@ interface Blank extends WithCreate { */ interface WithCreate extends DefinitionStages.WithPeerAsn, - DefinitionStages.WithPeerContactDetail, + DefinitionStages.WithPeerContactInfo, DefinitionStages.WithPeerName, DefinitionStages.WithValidationState { /** @@ -115,15 +107,15 @@ interface WithPeerAsn { */ WithCreate withPeerAsn(Integer peerAsn); } - /** The stage of the PeerAsn definition allowing to specify peerContactDetail. */ - interface WithPeerContactDetail { + /** The stage of the PeerAsn definition allowing to specify peerContactInfo. */ + interface WithPeerContactInfo { /** - * Specifies the peerContactDetail property: The contact details of the peer.. + * Specifies the peerContactInfo property: The contact information of the peer.. * - * @param peerContactDetail The contact details of the peer. + * @param peerContactInfo The contact information of the peer. * @return the next definition stage. */ - WithCreate withPeerContactDetail(List peerContactDetail); + WithCreate withPeerContactInfo(ContactInfo peerContactInfo); } /** The stage of the PeerAsn definition allowing to specify peerName. */ interface WithPeerName { @@ -156,7 +148,7 @@ interface WithValidationState { /** The template for PeerAsn update. */ interface Update extends UpdateStages.WithPeerAsn, - UpdateStages.WithPeerContactDetail, + UpdateStages.WithPeerContactInfo, UpdateStages.WithPeerName, UpdateStages.WithValidationState { /** @@ -186,15 +178,15 @@ interface WithPeerAsn { */ Update withPeerAsn(Integer peerAsn); } - /** The stage of the PeerAsn update allowing to specify peerContactDetail. */ - interface WithPeerContactDetail { + /** The stage of the PeerAsn update allowing to specify peerContactInfo. */ + interface WithPeerContactInfo { /** - * Specifies the peerContactDetail property: The contact details of the peer.. + * Specifies the peerContactInfo property: The contact information of the peer.. * - * @param peerContactDetail The contact details of the peer. + * @param peerContactInfo The contact information of the peer. * @return the next definition stage. */ - Update withPeerContactDetail(List peerContactDetail); + Update withPeerContactInfo(ContactInfo peerContactInfo); } /** The stage of the PeerAsn update allowing to specify peerName. */ interface WithPeerName { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsDirectPeeringType.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsDirectPeeringType.java index 69a0bb7b0010..bd1a356b9b56 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsDirectPeeringType.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsDirectPeeringType.java @@ -22,12 +22,6 @@ public final class PeeringLocationsDirectPeeringType extends ExpandableStringEnu /** Static value Internal for PeeringLocationsDirectPeeringType. */ public static final PeeringLocationsDirectPeeringType INTERNAL = fromString("Internal"); - /** Static value Ix for PeeringLocationsDirectPeeringType. */ - public static final PeeringLocationsDirectPeeringType IX = fromString("Ix"); - - /** Static value IxRs for PeeringLocationsDirectPeeringType. */ - public static final PeeringLocationsDirectPeeringType IX_RS = fromString("IxRs"); - /** * Creates or finds a PeeringLocationsDirectPeeringType from its string representation. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesDirect.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesDirect.java index eb302c8bdbfc..299caaf9fb76 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesDirect.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesDirect.java @@ -26,7 +26,7 @@ public final class PeeringPropertiesDirect { * The flag that indicates whether or not the peering is used for peering * service. */ - @JsonProperty(value = "useForPeeringService", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "useForPeeringService") private Boolean useForPeeringService; /* @@ -71,6 +71,18 @@ public Boolean useForPeeringService() { return this.useForPeeringService; } + /** + * Set the useForPeeringService property: The flag that indicates whether or not the peering is used for peering + * service. + * + * @param useForPeeringService the useForPeeringService value to set. + * @return the PeeringPropertiesDirect object itself. + */ + public PeeringPropertiesDirect withUseForPeeringService(Boolean useForPeeringService) { + this.useForPeeringService = useForPeeringService; + return this; + } + /** * Get the peerAsn property: The reference of the peer ASN. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringReceivedRoute.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringReceivedRoute.java deleted file mode 100644 index 614fc0452819..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringReceivedRoute.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.resourcemanager.peering.fluent.models.PeeringReceivedRouteInner; - -/** An immutable client-side representation of PeeringReceivedRoute. */ -public interface PeeringReceivedRoute { - /** - * Gets the prefix property: The prefix. - * - * @return the prefix value. - */ - String prefix(); - - /** - * Gets the nextHop property: The next hop for the prefix. - * - * @return the nextHop value. - */ - String nextHop(); - - /** - * Gets the asPath property: The AS path for the prefix. - * - * @return the asPath value. - */ - String asPath(); - - /** - * Gets the originAsValidationState property: The origin AS change information for the prefix. - * - * @return the originAsValidationState value. - */ - String originAsValidationState(); - - /** - * Gets the rpkiValidationState property: The RPKI validation state for the prefix and origin AS that's listed in - * the AS path. - * - * @return the rpkiValidationState value. - */ - String rpkiValidationState(); - - /** - * Gets the trustAnchor property: The authority which holds the Route Origin Authorization record for the prefix, if - * any. - * - * @return the trustAnchor value. - */ - String trustAnchor(); - - /** - * Gets the receivedTimestamp property: The received timestamp associated with the prefix. - * - * @return the receivedTimestamp value. - */ - String receivedTimestamp(); - - /** - * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringReceivedRouteInner object. - * - * @return the inner object. - */ - PeeringReceivedRouteInner innerModel(); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringReceivedRouteListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringReceivedRouteListResult.java deleted file mode 100644 index 1b1b4fbecce8..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringReceivedRouteListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.models.PeeringReceivedRouteInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The paginated list of received routes for the peering. */ -@Fluent -public final class PeeringReceivedRouteListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringReceivedRouteListResult.class); - - /* - * The list of received routes for the peering. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link to fetch the next page of received routes for the peering. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of received routes for the peering. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of received routes for the peering. - * - * @param value the value value to set. - * @return the PeeringReceivedRouteListResult object itself. - */ - public PeeringReceivedRouteListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to fetch the next page of received routes for the peering. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to fetch the next page of received routes for the peering. - * - * @param nextLink the nextLink value to set. - * @return the PeeringReceivedRouteListResult object itself. - */ - public PeeringReceivedRouteListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredAsn.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredAsn.java deleted file mode 100644 index fe1a0fab361a..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredAsn.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner; - -/** An immutable client-side representation of PeeringRegisteredAsn. */ -public interface PeeringRegisteredAsn { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the asn property: The customer's ASN from which traffic originates. - * - * @return the asn value. - */ - Integer asn(); - - /** - * Gets the peeringServicePrefixKey property: The peering service prefix key that is to be shared with the customer. - * - * @return the peeringServicePrefixKey value. - */ - String peeringServicePrefixKey(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner object. - * - * @return the inner object. - */ - PeeringRegisteredAsnInner innerModel(); - - /** The entirety of the PeeringRegisteredAsn definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The PeeringRegisteredAsn definition stages. */ - interface DefinitionStages { - /** The first stage of the PeeringRegisteredAsn definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the PeeringRegisteredAsn definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, peeringName. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @return the next definition stage. - */ - WithCreate withExistingPeering(String resourceGroupName, String peeringName); - } - /** - * The stage of the PeeringRegisteredAsn definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithAsn { - /** - * Executes the create request. - * - * @return the created resource. - */ - PeeringRegisteredAsn create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - PeeringRegisteredAsn create(Context context); - } - /** The stage of the PeeringRegisteredAsn definition allowing to specify asn. */ - interface WithAsn { - /** - * Specifies the asn property: The customer's ASN from which traffic originates.. - * - * @param asn The customer's ASN from which traffic originates. - * @return the next definition stage. - */ - WithCreate withAsn(Integer asn); - } - } - /** - * Begins update for the PeeringRegisteredAsn resource. - * - * @return the stage of resource update. - */ - PeeringRegisteredAsn.Update update(); - - /** The template for PeeringRegisteredAsn update. */ - interface Update extends UpdateStages.WithAsn { - /** - * Executes the update request. - * - * @return the updated resource. - */ - PeeringRegisteredAsn apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - PeeringRegisteredAsn apply(Context context); - } - /** The PeeringRegisteredAsn update stages. */ - interface UpdateStages { - /** The stage of the PeeringRegisteredAsn update allowing to specify asn. */ - interface WithAsn { - /** - * Specifies the asn property: The customer's ASN from which traffic originates.. - * - * @param asn The customer's ASN from which traffic originates. - * @return the next definition stage. - */ - Update withAsn(Integer asn); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - PeeringRegisteredAsn refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - PeeringRegisteredAsn refresh(Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredAsnListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredAsnListResult.java deleted file mode 100644 index eb41f52b5d86..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredAsnListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The paginated list of peering registered ASNs. */ -@Fluent -public final class PeeringRegisteredAsnListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringRegisteredAsnListResult.class); - - /* - * The list of peering registered ASNs. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link to fetch the next page of peering registered ASNs. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of peering registered ASNs. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of peering registered ASNs. - * - * @param value the value value to set. - * @return the PeeringRegisteredAsnListResult object itself. - */ - public PeeringRegisteredAsnListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to fetch the next page of peering registered ASNs. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to fetch the next page of peering registered ASNs. - * - * @param nextLink the nextLink value to set. - * @return the PeeringRegisteredAsnListResult object itself. - */ - public PeeringRegisteredAsnListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredPrefix.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredPrefix.java deleted file mode 100644 index bd2aaebc8bf1..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredPrefix.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner; - -/** An immutable client-side representation of PeeringRegisteredPrefix. */ -public interface PeeringRegisteredPrefix { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the prefix property: The customer's prefix from which traffic originates. - * - * @return the prefix value. - */ - String prefix(); - - /** - * Gets the prefixValidationState property: The prefix validation state. - * - * @return the prefixValidationState value. - */ - PrefixValidationState prefixValidationState(); - - /** - * Gets the peeringServicePrefixKey property: The peering service prefix key that is to be shared with the customer. - * - * @return the peeringServicePrefixKey value. - */ - String peeringServicePrefixKey(); - - /** - * Gets the errorMessage property: The error message associated with the validation state, if any. - * - * @return the errorMessage value. - */ - String errorMessage(); - - /** - * Gets the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner object. - * - * @return the inner object. - */ - PeeringRegisteredPrefixInner innerModel(); - - /** The entirety of the PeeringRegisteredPrefix definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The PeeringRegisteredPrefix definition stages. */ - interface DefinitionStages { - /** The first stage of the PeeringRegisteredPrefix definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the PeeringRegisteredPrefix definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, peeringName. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @return the next definition stage. - */ - WithCreate withExistingPeering(String resourceGroupName, String peeringName); - } - /** - * The stage of the PeeringRegisteredPrefix definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithPrefix { - /** - * Executes the create request. - * - * @return the created resource. - */ - PeeringRegisteredPrefix create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - PeeringRegisteredPrefix create(Context context); - } - /** The stage of the PeeringRegisteredPrefix definition allowing to specify prefix. */ - interface WithPrefix { - /** - * Specifies the prefix property: The customer's prefix from which traffic originates.. - * - * @param prefix The customer's prefix from which traffic originates. - * @return the next definition stage. - */ - WithCreate withPrefix(String prefix); - } - } - /** - * Begins update for the PeeringRegisteredPrefix resource. - * - * @return the stage of resource update. - */ - PeeringRegisteredPrefix.Update update(); - - /** The template for PeeringRegisteredPrefix update. */ - interface Update extends UpdateStages.WithPrefix { - /** - * Executes the update request. - * - * @return the updated resource. - */ - PeeringRegisteredPrefix apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - PeeringRegisteredPrefix apply(Context context); - } - /** The PeeringRegisteredPrefix update stages. */ - interface UpdateStages { - /** The stage of the PeeringRegisteredPrefix update allowing to specify prefix. */ - interface WithPrefix { - /** - * Specifies the prefix property: The customer's prefix from which traffic originates.. - * - * @param prefix The customer's prefix from which traffic originates. - * @return the next definition stage. - */ - Update withPrefix(String prefix); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - PeeringRegisteredPrefix refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - PeeringRegisteredPrefix refresh(Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredPrefixListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredPrefixListResult.java deleted file mode 100644 index 01e646f232ed..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringRegisteredPrefixListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The paginated list of peering registered prefixes. */ -@Fluent -public final class PeeringRegisteredPrefixListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringRegisteredPrefixListResult.class); - - /* - * The list of peering registered prefixes. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link to fetch the next page of peering registered prefixes. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of peering registered prefixes. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of peering registered prefixes. - * - * @param value the value value to set. - * @return the PeeringRegisteredPrefixListResult object itself. - */ - public PeeringRegisteredPrefixListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to fetch the next page of peering registered prefixes. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to fetch the next page of peering registered prefixes. - * - * @param nextLink the nextLink value to set. - * @return the PeeringRegisteredPrefixListResult object itself. - */ - public PeeringRegisteredPrefixListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringService.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringService.java index 672b02e966d0..a82405819a90 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringService.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringService.java @@ -32,13 +32,6 @@ public interface PeeringService { */ String type(); - /** - * Gets the sku property: The SKU that defines the type of the peering service. - * - * @return the sku value. - */ - PeeringServiceSku sku(); - /** * Gets the location property: The location of the resource. * @@ -54,14 +47,14 @@ public interface PeeringService { Map tags(); /** - * Gets the peeringServiceLocation property: The location (state/province) of the customer. + * Gets the peeringServiceLocation property: The PeeringServiceLocation of the Customer. * * @return the peeringServiceLocation value. */ String peeringServiceLocation(); /** - * Gets the peeringServiceProvider property: The name of the service provider. + * Gets the peeringServiceProvider property: The MAPS Provider Name. * * @return the peeringServiceProvider value. */ @@ -74,22 +67,6 @@ public interface PeeringService { */ ProvisioningState provisioningState(); - /** - * Gets the providerPrimaryPeeringLocation property: The primary peering (Microsoft/service provider) location to be - * used for customer traffic. - * - * @return the providerPrimaryPeeringLocation value. - */ - String providerPrimaryPeeringLocation(); - - /** - * Gets the providerBackupPeeringLocation property: The backup peering (Microsoft/service provider) location to be - * used for customer traffic. - * - * @return the providerBackupPeeringLocation value. - */ - String providerBackupPeeringLocation(); - /** * Gets the region of the resource. * @@ -157,11 +134,8 @@ interface WithResourceGroup { */ interface WithCreate extends DefinitionStages.WithTags, - DefinitionStages.WithSku, DefinitionStages.WithPeeringServiceLocation, - DefinitionStages.WithPeeringServiceProvider, - DefinitionStages.WithProviderPrimaryPeeringLocation, - DefinitionStages.WithProviderBackupPeeringLocation { + DefinitionStages.WithPeeringServiceProvider { /** * Executes the create request. * @@ -187,22 +161,12 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the PeeringService definition allowing to specify sku. */ - interface WithSku { - /** - * Specifies the sku property: The SKU that defines the type of the peering service.. - * - * @param sku The SKU that defines the type of the peering service. - * @return the next definition stage. - */ - WithCreate withSku(PeeringServiceSku sku); - } /** The stage of the PeeringService definition allowing to specify peeringServiceLocation. */ interface WithPeeringServiceLocation { /** - * Specifies the peeringServiceLocation property: The location (state/province) of the customer.. + * Specifies the peeringServiceLocation property: The PeeringServiceLocation of the Customer.. * - * @param peeringServiceLocation The location (state/province) of the customer. + * @param peeringServiceLocation The PeeringServiceLocation of the Customer. * @return the next definition stage. */ WithCreate withPeeringServiceLocation(String peeringServiceLocation); @@ -210,37 +174,13 @@ interface WithPeeringServiceLocation { /** The stage of the PeeringService definition allowing to specify peeringServiceProvider. */ interface WithPeeringServiceProvider { /** - * Specifies the peeringServiceProvider property: The name of the service provider.. + * Specifies the peeringServiceProvider property: The MAPS Provider Name.. * - * @param peeringServiceProvider The name of the service provider. + * @param peeringServiceProvider The MAPS Provider Name. * @return the next definition stage. */ WithCreate withPeeringServiceProvider(String peeringServiceProvider); } - /** The stage of the PeeringService definition allowing to specify providerPrimaryPeeringLocation. */ - interface WithProviderPrimaryPeeringLocation { - /** - * Specifies the providerPrimaryPeeringLocation property: The primary peering (Microsoft/service provider) - * location to be used for customer traffic.. - * - * @param providerPrimaryPeeringLocation The primary peering (Microsoft/service provider) location to be - * used for customer traffic. - * @return the next definition stage. - */ - WithCreate withProviderPrimaryPeeringLocation(String providerPrimaryPeeringLocation); - } - /** The stage of the PeeringService definition allowing to specify providerBackupPeeringLocation. */ - interface WithProviderBackupPeeringLocation { - /** - * Specifies the providerBackupPeeringLocation property: The backup peering (Microsoft/service provider) - * location to be used for customer traffic.. - * - * @param providerBackupPeeringLocation The backup peering (Microsoft/service provider) location to be used - * for customer traffic. - * @return the next definition stage. - */ - WithCreate withProviderBackupPeeringLocation(String providerBackupPeeringLocation); - } } /** * Begins update for the PeeringService resource. diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountries.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountries.java deleted file mode 100644 index a35743bf6cad..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountries.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of PeeringServiceCountries. */ -public interface PeeringServiceCountries { - /** - * Lists all of the available countries for peering service. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - PagedIterable list(); - - /** - * Lists all of the available countries for peering service. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service countries. - */ - PagedIterable list(Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountry.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountry.java deleted file mode 100644 index f844ada48b56..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountry.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.resourcemanager.peering.fluent.models.PeeringServiceCountryInner; - -/** An immutable client-side representation of PeeringServiceCountry. */ -public interface PeeringServiceCountry { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringServiceCountryInner object. - * - * @return the inner object. - */ - PeeringServiceCountryInner innerModel(); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountryListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountryListResult.java deleted file mode 100644 index bc4ad9e60cf4..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceCountryListResult.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.peering.fluent.models.PeeringServiceCountryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The paginated list of peering service countries. */ -@Fluent -public final class PeeringServiceCountryListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceCountryListResult.class); - - /* - * The list of peering service countries. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The link to fetch the next page of peering service countries. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** - * Get the value property: The list of peering service countries. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of peering service countries. - * - * @param value the value value to set. - * @return the PeeringServiceCountryListResult object itself. - */ - public PeeringServiceCountryListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The link to fetch the next page of peering service countries. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link to fetch the next page of peering service countries. - * - * @param nextLink the nextLink value to set. - * @return the PeeringServiceCountryListResult object itself. - */ - public PeeringServiceCountryListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocations.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocations.java index d56158e7fa02..9608f27e3455 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocations.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocations.java @@ -10,7 +10,7 @@ /** Resource collection API of PeeringServiceLocations. */ public interface PeeringServiceLocations { /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -19,14 +19,13 @@ public interface PeeringServiceLocations { PagedIterable list(); /** - * Lists all of the available locations for peering service. + * Lists all of the available peering service locations for the specified kind of peering. * - * @param country The country of interest, in which the locations are to be present. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the paginated list of peering service locations. */ - PagedIterable list(String country, Context context); + PagedIterable list(Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefix.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefix.java index e61d63a8dfad..d0b30e7f88fb 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefix.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefix.java @@ -6,7 +6,6 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner; -import java.util.List; /** An immutable client-side representation of PeeringServicePrefix. */ public interface PeeringServicePrefix { @@ -32,7 +31,7 @@ public interface PeeringServicePrefix { String type(); /** - * Gets the prefix property: The prefix from which your traffic originates. + * Gets the prefix property: Valid route prefix. * * @return the prefix value. */ @@ -52,27 +51,6 @@ public interface PeeringServicePrefix { */ LearnedType learnedType(); - /** - * Gets the errorMessage property: The error message for validation state. - * - * @return the errorMessage value. - */ - String errorMessage(); - - /** - * Gets the events property: The list of events for peering service prefix. - * - * @return the events value. - */ - List events(); - - /** - * Gets the peeringServicePrefixKey property: The peering service prefix key. - * - * @return the peeringServicePrefixKey value. - */ - String peeringServicePrefixKey(); - /** * Gets the provisioningState property: The provisioning state of the resource. * @@ -101,8 +79,8 @@ interface WithParentResource { /** * Specifies resourceGroupName, peeringServiceName. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @return the next definition stage. */ WithCreate withExistingPeeringService(String resourceGroupName, String peeringServiceName); @@ -111,7 +89,10 @@ interface WithParentResource { * The stage of the PeeringServicePrefix definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithPrefix, DefinitionStages.WithPeeringServicePrefixKey { + interface WithCreate + extends DefinitionStages.WithPrefix, + DefinitionStages.WithPrefixValidationState, + DefinitionStages.WithLearnedType { /** * Executes the create request. * @@ -130,22 +111,32 @@ interface WithCreate extends DefinitionStages.WithPrefix, DefinitionStages.WithP /** The stage of the PeeringServicePrefix definition allowing to specify prefix. */ interface WithPrefix { /** - * Specifies the prefix property: The prefix from which your traffic originates.. + * Specifies the prefix property: Valid route prefix. * - * @param prefix The prefix from which your traffic originates. + * @param prefix Valid route prefix. * @return the next definition stage. */ WithCreate withPrefix(String prefix); } - /** The stage of the PeeringServicePrefix definition allowing to specify peeringServicePrefixKey. */ - interface WithPeeringServicePrefixKey { + /** The stage of the PeeringServicePrefix definition allowing to specify prefixValidationState. */ + interface WithPrefixValidationState { + /** + * Specifies the prefixValidationState property: The prefix validation state. + * + * @param prefixValidationState The prefix validation state. + * @return the next definition stage. + */ + WithCreate withPrefixValidationState(PrefixValidationState prefixValidationState); + } + /** The stage of the PeeringServicePrefix definition allowing to specify learnedType. */ + interface WithLearnedType { /** - * Specifies the peeringServicePrefixKey property: The peering service prefix key. + * Specifies the learnedType property: The prefix learned type. * - * @param peeringServicePrefixKey The peering service prefix key. + * @param learnedType The prefix learned type. * @return the next definition stage. */ - WithCreate withPeeringServicePrefixKey(String peeringServicePrefixKey); + WithCreate withLearnedType(LearnedType learnedType); } } /** @@ -156,7 +147,8 @@ interface WithPeeringServicePrefixKey { PeeringServicePrefix.Update update(); /** The template for PeeringServicePrefix update. */ - interface Update extends UpdateStages.WithPrefix, UpdateStages.WithPeeringServicePrefixKey { + interface Update + extends UpdateStages.WithPrefix, UpdateStages.WithPrefixValidationState, UpdateStages.WithLearnedType { /** * Executes the update request. * @@ -177,22 +169,32 @@ interface UpdateStages { /** The stage of the PeeringServicePrefix update allowing to specify prefix. */ interface WithPrefix { /** - * Specifies the prefix property: The prefix from which your traffic originates.. + * Specifies the prefix property: Valid route prefix. * - * @param prefix The prefix from which your traffic originates. + * @param prefix Valid route prefix. * @return the next definition stage. */ Update withPrefix(String prefix); } - /** The stage of the PeeringServicePrefix update allowing to specify peeringServicePrefixKey. */ - interface WithPeeringServicePrefixKey { + /** The stage of the PeeringServicePrefix update allowing to specify prefixValidationState. */ + interface WithPrefixValidationState { + /** + * Specifies the prefixValidationState property: The prefix validation state. + * + * @param prefixValidationState The prefix validation state. + * @return the next definition stage. + */ + Update withPrefixValidationState(PrefixValidationState prefixValidationState); + } + /** The stage of the PeeringServicePrefix update allowing to specify learnedType. */ + interface WithLearnedType { /** - * Specifies the peeringServicePrefixKey property: The peering service prefix key. + * Specifies the learnedType property: The prefix learned type. * - * @param peeringServicePrefixKey The peering service prefix key. + * @param learnedType The prefix learned type. * @return the next definition stage. */ - Update withPeeringServicePrefixKey(String peeringServicePrefixKey); + Update withLearnedType(LearnedType learnedType); } } /** diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixEvent.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixEvent.java deleted file mode 100644 index 6c5ea697a8c8..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixEvent.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The details of the event associated with a prefix. */ -@Immutable -public final class PeeringServicePrefixEvent { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicePrefixEvent.class); - - /* - * The timestamp of the event associated with a prefix. - */ - @JsonProperty(value = "eventTimestamp", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime eventTimestamp; - - /* - * The type of the event associated with a prefix. - */ - @JsonProperty(value = "eventType", access = JsonProperty.Access.WRITE_ONLY) - private String eventType; - - /* - * The summary of the event associated with a prefix. - */ - @JsonProperty(value = "eventSummary", access = JsonProperty.Access.WRITE_ONLY) - private String eventSummary; - - /* - * The level of the event associated with a prefix. - */ - @JsonProperty(value = "eventLevel", access = JsonProperty.Access.WRITE_ONLY) - private String eventLevel; - - /* - * The description of the event associated with a prefix. - */ - @JsonProperty(value = "eventDescription", access = JsonProperty.Access.WRITE_ONLY) - private String eventDescription; - - /** - * Get the eventTimestamp property: The timestamp of the event associated with a prefix. - * - * @return the eventTimestamp value. - */ - public OffsetDateTime eventTimestamp() { - return this.eventTimestamp; - } - - /** - * Get the eventType property: The type of the event associated with a prefix. - * - * @return the eventType value. - */ - public String eventType() { - return this.eventType; - } - - /** - * Get the eventSummary property: The summary of the event associated with a prefix. - * - * @return the eventSummary value. - */ - public String eventSummary() { - return this.eventSummary; - } - - /** - * Get the eventLevel property: The level of the event associated with a prefix. - * - * @return the eventLevel value. - */ - public String eventLevel() { - return this.eventLevel; - } - - /** - * Get the eventDescription property: The description of the event associated with a prefix. - * - * @return the eventDescription value. - */ - public String eventDescription() { - return this.eventDescription; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixListResult.java index c425a81c843a..83fef28f2763 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixListResult.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixListResult.java @@ -11,25 +11,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The paginated list of peering service prefixes. */ +/** The paginated list of [T]. */ @Fluent public final class PeeringServicePrefixListResult { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicePrefixListResult.class); /* - * The list of peering service prefixes. + * The list of [T]. */ @JsonProperty(value = "value") private List value; /* - * The link to fetch the next page of peering service prefixes. + * The link to fetch the next page of [T]. */ @JsonProperty(value = "nextLink") private String nextLink; /** - * Get the value property: The list of peering service prefixes. + * Get the value property: The list of [T]. * * @return the value value. */ @@ -38,7 +38,7 @@ public List value() { } /** - * Set the value property: The list of peering service prefixes. + * Set the value property: The list of [T]. * * @param value the value value to set. * @return the PeeringServicePrefixListResult object itself. @@ -49,7 +49,7 @@ public PeeringServicePrefixListResult withValue(List } /** - * Get the nextLink property: The link to fetch the next page of peering service prefixes. + * Get the nextLink property: The link to fetch the next page of [T]. * * @return the nextLink value. */ @@ -58,7 +58,7 @@ public String nextLink() { } /** - * Set the nextLink property: The link to fetch the next page of peering service prefixes. + * Set the nextLink property: The link to fetch the next page of [T]. * * @param nextLink the nextLink value to set. * @return the PeeringServicePrefixListResult object itself. diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixes.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixes.java new file mode 100644 index 000000000000..43845aa3d0b1 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixes.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.peering.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PeeringServicePrefixes. */ +public interface PeeringServicePrefixes { + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + PeeringServicePrefix get(String resourceGroupName, String peeringServiceName, String prefixName); + + /** + * Gets the peering service prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + Response getWithResponse( + String resourceGroupName, String peeringServiceName, String prefixName, Context context); + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String peeringServiceName, String prefixName); + + /** + * removes the peering prefix. + * + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. + * @param prefixName The prefix name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteWithResponse( + String resourceGroupName, String peeringServiceName, String prefixName, Context context); + + /** + * Gets the peering service prefix. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + PeeringServicePrefix getById(String id); + + /** + * Gets the peering service prefix. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the peering service prefix. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * removes the peering prefix. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * removes the peering prefix. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PeeringServicePrefix resource. + * + * @param name resource name. + * @return the first stage of the new PeeringServicePrefix definition. + */ + PeeringServicePrefix.DefinitionStages.Blank define(String name); +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProvider.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProvider.java index abc85321595c..18f5f250cd83 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProvider.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProvider.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.peering.models; import com.azure.resourcemanager.peering.fluent.models.PeeringServiceProviderInner; -import java.util.List; /** An immutable client-side representation of PeeringServiceProvider. */ public interface PeeringServiceProvider { @@ -37,13 +36,6 @@ public interface PeeringServiceProvider { */ String serviceProviderName(); - /** - * Gets the peeringLocations property: The list of locations at which the service provider peers with Microsoft. - * - * @return the peeringLocations value. - */ - List peeringLocations(); - /** * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringServiceProviderInner object. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceSku.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceSku.java deleted file mode 100644 index 5330d6be5d90..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceSku.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SKU that defines the type of the peering service. */ -@Fluent -public final class PeeringServiceSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceSku.class); - - /* - * The name of the peering service SKU. - */ - @JsonProperty(value = "name") - private String name; - - /** - * Get the name property: The name of the peering service SKU. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the peering service SKU. - * - * @param name the name value to set. - * @return the PeeringServiceSku object itself. - */ - public PeeringServiceSku withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringSku.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringSku.java index 1abe50536382..3265b3234dfe 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringSku.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringSku.java @@ -18,7 +18,7 @@ public final class PeeringSku { * The name of the peering SKU. */ @JsonProperty(value = "name") - private String name; + private Name name; /* * The tier of the peering SKU. @@ -43,7 +43,7 @@ public final class PeeringSku { * * @return the name value. */ - public String name() { + public Name name() { return this.name; } @@ -53,7 +53,7 @@ public String name() { * @param name the name value to set. * @return the PeeringSku object itself. */ - public PeeringSku withName(String name) { + public PeeringSku withName(Name name) { this.name = name; return this; } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PrefixValidationState.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PrefixValidationState.java index 0d546fb46990..abf7b7f8cfc4 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PrefixValidationState.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PrefixValidationState.java @@ -25,9 +25,6 @@ public final class PrefixValidationState extends ExpandableStringEnum getWithResponse( - String resourceGroupName, String peeringServiceName, String prefixName, String expand, Context context); - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String peeringServiceName, String prefixName); - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param prefixName The name of the prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteWithResponse( - String resourceGroupName, String peeringServiceName, String prefixName, Context context); - - /** - * Lists all prefixes under the given subscription, resource group and peering service. - * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ PagedIterable listByPeeringService(String resourceGroupName, String peeringServiceName); /** - * Lists all prefixes under the given subscription, resource group and peering service. + * Lists the peerings prefix in the resource group. * - * @param resourceGroupName The name of the resource group. - * @param peeringServiceName The name of the peering service. - * @param expand The properties to be expanded. + * @param resourceGroupName The resource group name. + * @param peeringServiceName The peering service name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering service prefixes. + * @return the paginated list of [T]. */ PagedIterable listByPeeringService( - String resourceGroupName, String peeringServiceName, String expand, Context context); - - /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - PeeringServicePrefix getById(String id); - - /** - * Gets an existing prefix with the specified name under the given subscription, resource group and peering service. - * - * @param id the resource ID. - * @param expand The properties to be expanded. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing prefix with the specified name under the given subscription, resource group and peering - * service. - */ - Response getByIdWithResponse(String id, String expand, Context context); - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes an existing prefix with the specified name under the given subscription, resource group and peering - * service. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new PeeringServicePrefix resource. - * - * @param name resource name. - * @return the first stage of the new PeeringServicePrefix definition. - */ - PeeringServicePrefix.DefinitionStages.Blank define(String name); + String resourceGroupName, String peeringServiceName, Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ReceivedRoutes.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ReceivedRoutes.java deleted file mode 100644 index 9389aed4d6c0..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ReceivedRoutes.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of ReceivedRoutes. */ -public interface ReceivedRoutes { - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - PagedIterable listByPeering(String resourceGroupName, String peeringName); - - /** - * Lists the prefixes received over the specified peering under the given subscription and resource group. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param prefix The optional prefix that can be used to filter the routes. - * @param asPath The optional AS path that can be used to filter the routes. - * @param originAsValidationState The optional origin AS validation state that can be used to filter the routes. - * @param rpkiValidationState The optional RPKI validation state that can be used to filter the routes. - * @param skipToken The optional page continuation token that is used in the event of paginated result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of received routes for the peering. - */ - PagedIterable listByPeering( - String resourceGroupName, - String peeringName, - String prefix, - String asPath, - String originAsValidationState, - String rpkiValidationState, - String skipToken, - Context context); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/RegisteredAsns.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/RegisteredAsns.java deleted file mode 100644 index 10266f355e17..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/RegisteredAsns.java +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of RegisteredAsns. */ -public interface RegisteredAsns { - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - PeeringRegisteredAsn get(String resourceGroupName, String peeringName, String registeredAsnName); - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - Response getWithResponse( - String resourceGroupName, String peeringName, String registeredAsnName, Context context); - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String peeringName, String registeredAsnName); - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredAsnName The name of the registered ASN. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteWithResponse( - String resourceGroupName, String peeringName, String registeredAsnName, Context context); - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - PagedIterable listByPeering(String resourceGroupName, String peeringName); - - /** - * Lists all registered ASNs under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered ASNs. - */ - PagedIterable listByPeering(String resourceGroupName, String peeringName, Context context); - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - PeeringRegisteredAsn getById(String id); - - /** - * Gets an existing registered ASN with the specified name under the given subscription, resource group and peering. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes an existing registered ASN with the specified name under the given subscription, resource group and - * peering. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new PeeringRegisteredAsn resource. - * - * @param name resource name. - * @return the first stage of the new PeeringRegisteredAsn definition. - */ - PeeringRegisteredAsn.DefinitionStages.Blank define(String name); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/RegisteredPrefixes.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/RegisteredPrefixes.java deleted file mode 100644 index 3a315626c335..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/RegisteredPrefixes.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of RegisteredPrefixes. */ -public interface RegisteredPrefixes { - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - PeeringRegisteredPrefix get(String resourceGroupName, String peeringName, String registeredPrefixName); - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - Response getWithResponse( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context); - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String peeringName, String registeredPrefixName); - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param registeredPrefixName The name of the registered prefix. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteWithResponse( - String resourceGroupName, String peeringName, String registeredPrefixName, Context context); - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - PagedIterable listByPeering(String resourceGroupName, String peeringName); - - /** - * Lists all registered prefixes under the given subscription, resource group and peering. - * - * @param resourceGroupName The name of the resource group. - * @param peeringName The name of the peering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of peering registered prefixes. - */ - PagedIterable listByPeering(String resourceGroupName, String peeringName, Context context); - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - PeeringRegisteredPrefix getById(String id); - - /** - * Gets an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes an existing registered prefix with the specified name under the given subscription, resource group and - * peering. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new PeeringRegisteredPrefix resource. - * - * @param name resource name. - * @return the first stage of the new PeeringRegisteredPrefix definition. - */ - PeeringRegisteredPrefix.DefinitionStages.Blank define(String name); -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Role.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Role.java deleted file mode 100644 index 7bb91ac9ca26..000000000000 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Role.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.peering.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Role. */ -public final class Role extends ExpandableStringEnum { - /** Static value Noc for Role. */ - public static final Role NOC = fromString("Noc"); - - /** Static value Policy for Role. */ - public static final Role POLICY = fromString("Policy"); - - /** Static value Technical for Role. */ - public static final Role TECHNICAL = fromString("Technical"); - - /** Static value Service for Role. */ - public static final Role SERVICE = fromString("Service"); - - /** Static value Escalation for Role. */ - public static final Role ESCALATION = fromString("Escalation"); - - /** Static value Other for Role. */ - public static final Role OTHER = fromString("Other"); - - /** - * Creates or finds a Role from its string representation. - * - * @param name a name to look for. - * @return the corresponding Role. - */ - @JsonCreator - public static Role fromString(String name) { - return fromString(name, Role.class); - } - - /** @return known Role values. */ - public static Collection values() { - return values(Role.class); - } -}