diff --git a/sdk/peering/azure-resourcemanager-peering/CHANGELOG.md b/sdk/peering/azure-resourcemanager-peering/CHANGELOG.md index f85a9a1a18738..c2962e461e376 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 (2022-01-05) +- 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 56a50976a7917..ab901ae112b32 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,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/peering/azure-resourcemanager-peering/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/peering/azure-resourcemanager-peering/SAMPLE.md b/sdk/peering/azure-resourcemanager-peering/SAMPLE.md new file mode 100644 index 0000000000000..a2ac3be6d5265 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/SAMPLE.md @@ -0,0 +1,791 @@ +# Code snippets and samples + + +## LegacyPeerings + +- [List](#legacypeerings_list) + +## Operations + +- [List](#operations_list) + +## PeerAsns + +- [CreateOrUpdate](#peerasns_createorupdate) +- [Delete](#peerasns_delete) +- [Get](#peerasns_get) +- [List](#peerasns_list) + +## PeeringLocations + +- [List](#peeringlocations_list) + +## PeeringServiceLocations + +- [List](#peeringservicelocations_list) + +## PeeringServicePrefixes + +- [CreateOrUpdate](#peeringserviceprefixes_createorupdate) +- [Delete](#peeringserviceprefixes_delete) +- [Get](#peeringserviceprefixes_get) + +## PeeringServiceProviders + +- [List](#peeringserviceproviders_list) + +## PeeringServices + +- [CreateOrUpdate](#peeringservices_createorupdate) +- [Delete](#peeringservices_delete) +- [GetByResourceGroup](#peeringservices_getbyresourcegroup) +- [List](#peeringservices_list) +- [ListByResourceGroup](#peeringservices_listbyresourcegroup) +- [Update](#peeringservices_update) + +## Peerings + +- [CreateOrUpdate](#peerings_createorupdate) +- [Delete](#peerings_delete) +- [GetByResourceGroup](#peerings_getbyresourcegroup) +- [List](#peerings_list) +- [ListByResourceGroup](#peerings_listbyresourcegroup) +- [Update](#peerings_update) + +## Prefixes + +- [ListByPeeringService](#prefixes_listbypeeringservice) + +## ResourceProvider + +- [CheckServiceProviderAvailability](#resourceprovider_checkserviceprovideravailability) +### LegacyPeerings_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.LegacyPeeringsKind; + +/** Samples for LegacyPeerings List. */ +public final class LegacyPeeringsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListLegacyPeerings.json + */ + /** + * Sample code: List legacy peerings. + * + * @param manager Entry point to PeeringManager. + */ + public static void listLegacyPeerings(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.legacyPeerings().list("peeringLocation0", LegacyPeeringsKind.EXCHANGE, Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringOperations.json + */ + /** + * Sample code: List peering operations. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringOperations(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PeerAsns_CreateOrUpdate + +```java +import com.azure.resourcemanager.peering.models.ContactInfo; +import java.util.Arrays; + +/** Samples for PeerAsns CreateOrUpdate. */ +public final class PeerAsnsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreatePeerAsn.json + */ + /** + * Sample code: Create a peer ASN. + * + * @param manager Entry point to PeeringManager. + */ + public static void createAPeerASN(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peerAsns() + .define("MyPeerAsn") + .withPeerAsn(65000) + .withPeerContactInfo( + new ContactInfo() + .withEmails(Arrays.asList("abc@contoso.com", "xyz@contoso.com")) + .withPhone(Arrays.asList("+1 (234) 567-8900"))) + .withPeerName("Contoso") + .create(); + } +} +``` + +### PeerAsns_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PeerAsns Delete. */ +public final class PeerAsnsDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/DeletePeerAsn.json + */ + /** + * Sample code: Delete a peer ASN. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteAPeerASN(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerAsns().deleteWithResponse("MyPeerAsn", Context.NONE); + } +} +``` + +### PeerAsns_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PeerAsns Get. */ +public final class PeerAsnsGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/GetPeerAsn.json + */ + /** + * Sample code: Get a peer ASN. + * + * @param manager Entry point to PeeringManager. + */ + public static void getAPeerASN(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerAsns().getWithResponse("MyPeerAsn", Context.NONE); + } +} +``` + +### PeerAsns_List + +```java +import com.azure.core.util.Context; + +/** Samples for PeerAsns List. */ +public final class PeerAsnsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeerAsnsBySubscription.json + */ + /** + * Sample code: List peer ASNs in a subscription. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeerASNsInASubscription(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerAsns().list(Context.NONE); + } +} +``` + +### PeeringLocations_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.PeeringLocationsKind; + +/** Samples for PeeringLocations List. */ +public final class PeeringLocationsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListExchangePeeringLocations.json + */ + /** + * Sample code: List exchange peering locations. + * + * @param manager Entry point to PeeringManager. + */ + public static void listExchangePeeringLocations(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringLocations().list(PeeringLocationsKind.EXCHANGE, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListDirectPeeringLocations.json + */ + /** + * Sample code: List direct peering locations. + * + * @param manager Entry point to PeeringManager. + */ + public static void listDirectPeeringLocations(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringLocations().list(PeeringLocationsKind.DIRECT, null, Context.NONE); + } +} +``` + +### PeeringServiceLocations_List + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServiceLocations List. */ +public final class PeeringServiceLocationsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServiceLocations.json + */ + /** + * Sample code: List peering service locations. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServiceLocations(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServiceLocations().list(Context.NONE); + } +} +``` + +### PeeringServicePrefixes_CreateOrUpdate + +```java +/** Samples for PeeringServicePrefixes CreateOrUpdate. */ +public final class PeeringServicePrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreatePeeringServicePrefix.json + */ + /** + * Sample code: Create or update a prefix for the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void createOrUpdateAPrefixForThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peeringServicePrefixes() + .define("MyPeeringServicePrefix") + .withExistingPeeringService("MyResourceGroup", "MyPeeringService") + .withPrefix("192.168.1.0/24") + .create(); + } +} +``` + +### PeeringServicePrefixes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServicePrefixes Delete. */ +public final class PeeringServicePrefixesDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/DeletePeeringServicePrefix.json + */ + /** + * Sample code: Delete a prefix associated with the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteAPrefixAssociatedWithThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peeringServicePrefixes() + .deleteWithResponse("MyResourceGroup", "MyPeeringService", "MyPeeringServicePrefix", Context.NONE); + } +} +``` + +### PeeringServicePrefixes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServicePrefixes Get. */ +public final class PeeringServicePrefixesGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/GetPeeringServicePrefix.json + */ + /** + * Sample code: Get a prefix associated with the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void getAPrefixAssociatedWithThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peeringServicePrefixes() + .getWithResponse("MyResourceGroup", "MyPeeringService", "MyPeeringServicePrefix", Context.NONE); + } +} +``` + +### PeeringServiceProviders_List + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServiceProviders List. */ +public final class PeeringServiceProvidersListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServiceProviders.json + */ + /** + * Sample code: List peering service providers. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServiceProviders(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServiceProviders().list(Context.NONE); + } +} +``` + +### PeeringServices_CreateOrUpdate + +```java +/** Samples for PeeringServices CreateOrUpdate. */ +public final class PeeringServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreatePeeringService.json + */ + /** + * Sample code: Create a peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void createAPeeringService(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peeringServices() + .define("MyPeeringService") + .withRegion("eastus") + .withExistingResourceGroup("MyResourceGroup") + .withPeeringServiceLocation("state1") + .withPeeringServiceProvider("serviceProvider1") + .create(); + } +} +``` + +### PeeringServices_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServices Delete. */ +public final class PeeringServicesDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/DeletePeeringService.json + */ + /** + * Sample code: Delete a peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteAPeeringService(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().deleteWithResponse("MyResourceGroup", "MyPeeringService", Context.NONE); + } +} +``` + +### PeeringServices_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServices GetByResourceGroup. */ +public final class PeeringServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/GetPeeringService.json + */ + /** + * Sample code: Get a peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void getAPeeringService(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().getByResourceGroupWithResponse("MyResourceGroup", "MyPeeringService", Context.NONE); + } +} +``` + +### PeeringServices_List + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServices List. */ +public final class PeeringServicesListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServicesBySubscription.json + */ + /** + * Sample code: List peering services in a subscription. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServicesInASubscription(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().list(Context.NONE); + } +} +``` + +### PeeringServices_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServices ListByResourceGroup. */ +public final class PeeringServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServicesByResourceGroup.json + */ + /** + * Sample code: List peering services in a resource group. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServicesInAResourceGroup(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().listByResourceGroup("MyResourceGroup", Context.NONE); + } +} +``` + +### PeeringServices_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.PeeringService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PeeringServices Update. */ +public final class PeeringServicesUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/UpdatePeeringServiceTags.json + */ + /** + * Sample code: Update peering service tags. + * + * @param manager Entry point to PeeringManager. + */ + public static void updatePeeringServiceTags(com.azure.resourcemanager.peering.PeeringManager manager) { + PeeringService resource = + manager + .peeringServices() + .getByResourceGroupWithResponse("MyResourceGroup", "MyPeeringService", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag0", "value0", "tag1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Peerings_CreateOrUpdate + +```java +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.peering.models.BgpSession; +import com.azure.resourcemanager.peering.models.DirectConnection; +import com.azure.resourcemanager.peering.models.DirectPeeringType; +import com.azure.resourcemanager.peering.models.ExchangeConnection; +import com.azure.resourcemanager.peering.models.Kind; +import com.azure.resourcemanager.peering.models.Name; +import com.azure.resourcemanager.peering.models.PeeringPropertiesDirect; +import com.azure.resourcemanager.peering.models.PeeringPropertiesExchange; +import com.azure.resourcemanager.peering.models.PeeringSku; +import com.azure.resourcemanager.peering.models.SessionAddressProvider; +import java.util.Arrays; + +/** Samples for Peerings CreateOrUpdate. */ +public final class PeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreateExchangePeering.json + */ + /** + * Sample code: Create an exchange peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void createAnExchangePeering(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peerings() + .define("MyPeering") + .withRegion("eastus") + .withExistingResourceGroup("MyResourceGroup") + .withSku(new PeeringSku().withName(Name.BASIC_EXCHANGE_FREE)) + .withKind(Kind.EXCHANGE) + .withExchange( + new PeeringPropertiesExchange() + .withConnections( + Arrays + .asList( + new ExchangeConnection() + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withPeerSessionIPv4Address("192.168.2.1") + .withPeerSessionIPv6Address("fd00::1") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100) + .withMd5AuthenticationKey("test-md5-auth-key")) + .withConnectionIdentifier("CE495334-0E94-4E51-8164-8116D6CD284D"), + new ExchangeConnection() + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withPeerSessionIPv4Address("192.168.2.2") + .withPeerSessionIPv6Address("fd00::2") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100) + .withMd5AuthenticationKey("test-md5-auth-key")) + .withConnectionIdentifier("CDD8E673-CB07-47E6-84DE-3739F778762B"))) + .withPeerAsn( + new SubResource().withId("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"))) + .withPeeringLocation("peeringLocation0") + .create(); + } + + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreateDirectPeering.json + */ + /** + * Sample code: Create a direct peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void createADirectPeering(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peerings() + .define("MyPeering") + .withRegion("eastus") + .withExistingResourceGroup("MyResourceGroup") + .withSku(new PeeringSku().withName(Name.BASIC_DIRECT_FREE)) + .withKind(Kind.DIRECT) + .withDirect( + new PeeringPropertiesDirect() + .withConnections( + Arrays + .asList( + new DirectConnection() + .withBandwidthInMbps(10000) + .withSessionAddressProvider(SessionAddressProvider.PEER) + .withUseForPeeringService(false) + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withSessionPrefixV4("192.168.0.0/31") + .withSessionPrefixV6("fd00::0/127") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100) + .withMd5AuthenticationKey("test-md5-auth-key")) + .withConnectionIdentifier("5F4CB5C7-6B43-4444-9338-9ABC72606C16"), + new DirectConnection() + .withBandwidthInMbps(10000) + .withSessionAddressProvider(SessionAddressProvider.MICROSOFT) + .withUseForPeeringService(true) + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withSessionPrefixV4("192.168.1.0/31") + .withSessionPrefixV6("fd00::2/127") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100) + .withMd5AuthenticationKey("test-md5-auth-key")) + .withConnectionIdentifier("8AB00818-D533-4504-A25A-03A17F61201C"))) + .withUseForPeeringService(false) + .withPeerAsn( + new SubResource().withId("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1")) + .withDirectPeeringType(DirectPeeringType.EDGE)) + .withPeeringLocation("peeringLocation0") + .create(); + } +} +``` + +### Peerings_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Peerings Delete. */ +public final class PeeringsDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/DeletePeering.json + */ + /** + * Sample code: Delete a peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteAPeering(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerings().deleteWithResponse("MyResourceGroup", "MyPeering", Context.NONE); + } +} +``` + +### Peerings_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Peerings GetByResourceGroup. */ +public final class PeeringsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/GetPeering.json + */ + /** + * Sample code: Get a peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void getAPeering(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerings().getByResourceGroupWithResponse("MyResourceGroup", "MyPeering", Context.NONE); + } +} +``` + +### Peerings_List + +```java +import com.azure.core.util.Context; + +/** Samples for Peerings List. */ +public final class PeeringsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringsBySubscription.json + */ + /** + * Sample code: List peerings in a subscription. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringsInASubscription(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerings().list(Context.NONE); + } +} +``` + +### Peerings_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Peerings ListByResourceGroup. */ +public final class PeeringsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringsByResourceGroup.json + */ + /** + * Sample code: List peerings in a resource group. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringsInAResourceGroup(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerings().listByResourceGroup("MyResourceGroup", Context.NONE); + } +} +``` + +### Peerings_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.Peering; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Peerings Update. */ +public final class PeeringsUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/UpdatePeeringTags.json + */ + /** + * Sample code: Update peering tags. + * + * @param manager Entry point to PeeringManager. + */ + public static void updatePeeringTags(com.azure.resourcemanager.peering.PeeringManager manager) { + Peering resource = + manager.peerings().getByResourceGroupWithResponse("MyResourceGroup", "MyPeering", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag0", "value0", "tag1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Prefixes_ListByPeeringService + +```java +import com.azure.core.util.Context; + +/** Samples for Prefixes ListByPeeringService. */ +public final class PrefixesListByPeeringServiceSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPrefixesByPeeringService.json + */ + /** + * Sample code: List all the prefixes associated with the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllThePrefixesAssociatedWithThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.prefixes().listByPeeringService("MyResourceGroup", "MyPeeringService", Context.NONE); + } +} +``` + +### ResourceProvider_CheckServiceProviderAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.CheckServiceProviderAvailabilityInput; + +/** Samples for ResourceProvider CheckServiceProviderAvailability. */ +public final class ResourceProviderCheckServiceProviderAvailabilitySamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CheckServiceProviderAvailability.json + */ + /** + * Sample code: Check if peering service provider is available in customer location. + * + * @param manager Entry point to PeeringManager. + */ + public static void checkIfPeeringServiceProviderIsAvailableInCustomerLocation( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .resourceProviders() + .checkServiceProviderAvailabilityWithResponse( + new CheckServiceProviderAvailabilityInput() + .withPeeringServiceLocation("peeringServiceLocation1") + .withPeeringServiceProvider("peeringServiceProvider1"), + Context.NONE); + } +} +``` + diff --git a/sdk/peering/azure-resourcemanager-peering/pom.xml b/sdk/peering/azure-resourcemanager-peering/pom.xml index b87b2f6c863d8..1c1f3eadbda4c 100644 --- a/sdk/peering/azure-resourcemanager-peering/pom.xml +++ b/sdk/peering/azure-resourcemanager-peering/pom.xml @@ -1,58 +1,81 @@ - 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 - 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 + true false - - - - com.azure - azure-core - 1.23.1 - - - com.azure - azure-core-management - 1.4.4 - - + + + + com.azure + azure-core + 1.23.1 + + + com.azure + azure-core-management + 1.4.4 + + + + + + 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 f06d8a6805ce1..ba1b5fe9d0576 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 @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; 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,51 +17,43 @@ 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; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to PeeringManager. Peering Client. */ public final class PeeringManager { - private CdnPeeringPrefixes cdnPeeringPrefixes; - private ResourceProviders resourceProviders; private LegacyPeerings legacyPeerings; @@ -72,18 +64,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 +119,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 +159,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,20 +226,33 @@ 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); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -253,14 +264,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 +304,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 +312,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 +321,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 50ed5b9c39aa3..0000000000000 --- 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 c8cba0bec65e3..44bc1b9315e31 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 70c527cbb0ea2..91da6d848e047 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 83b9d54e207f0..0000000000000 --- 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 69f837fdd14c2..4eb5a2609ab91 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 0000000000000..ea07d29052aba --- /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 ab6755d215762..0722cb0ff5b4e 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 028c632042c31..0000000000000 --- 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 36c7448d7392e..0000000000000 --- 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 fb587e31173e1..0000000000000 --- 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 aae2b0bb7dc99..0000000000000 --- 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 562bcd708fd0e..ebbfa94dbcb19 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 @@ -5,50 +5,32 @@ 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.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 @Fluent -public class PeerAsnInner extends ProxyResource { +public final class PeerAsnInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerAsnInner.class); /* - * The Autonomous System Number (ASN) of the peer. + * The properties that define a peer's ASN. */ - @JsonProperty(value = "properties.peerAsn") - private Integer peerAsn; + @JsonProperty(value = "properties") + private PeerAsnProperties innerProperties; - /* - * The contact details of the peer. - */ - @JsonProperty(value = "properties.peerContactDetail") - private List peerContactDetail; - - /* - * The name of the peer. - */ - @JsonProperty(value = "properties.peerName") - private String peerName; - - /* - * The validation state of the ASN associated with the peer. - */ - @JsonProperty(value = "properties.validationState") - private ValidationState validationState; - - /* - * The error message for the validation state + /** + * Get the innerProperties property: The properties that define a peer's ASN. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.errorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String errorMessage; + private PeerAsnProperties innerProperties() { + return this.innerProperties; + } /** * Get the peerAsn property: The Autonomous System Number (ASN) of the peer. @@ -56,7 +38,7 @@ public class PeerAsnInner extends ProxyResource { * @return the peerAsn value. */ public Integer peerAsn() { - return this.peerAsn; + return this.innerProperties() == null ? null : this.innerProperties().peerAsn(); } /** @@ -66,27 +48,33 @@ public Integer peerAsn() { * @return the PeerAsnInner object itself. */ public PeerAsnInner withPeerAsn(Integer peerAsn) { - this.peerAsn = peerAsn; + if (this.innerProperties() == null) { + this.innerProperties = new PeerAsnProperties(); + } + this.innerProperties().withPeerAsn(peerAsn); return this; } /** - * 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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PeerAsnProperties(); + } + this.innerProperties().withPeerContactInfo(peerContactInfo); return this; } @@ -96,7 +84,7 @@ public PeerAsnInner withPeerContactDetail(List peerContactDetail) * @return the peerName value. */ public String peerName() { - return this.peerName; + return this.innerProperties() == null ? null : this.innerProperties().peerName(); } /** @@ -106,7 +94,10 @@ public String peerName() { * @return the PeerAsnInner object itself. */ public PeerAsnInner withPeerName(String peerName) { - this.peerName = peerName; + if (this.innerProperties() == null) { + this.innerProperties = new PeerAsnProperties(); + } + this.innerProperties().withPeerName(peerName); return this; } @@ -116,7 +107,7 @@ public PeerAsnInner withPeerName(String peerName) { * @return the validationState value. */ public ValidationState validationState() { - return this.validationState; + return this.innerProperties() == null ? null : this.innerProperties().validationState(); } /** @@ -126,27 +117,21 @@ public ValidationState validationState() { * @return the PeerAsnInner object itself. */ public PeerAsnInner withValidationState(ValidationState validationState) { - this.validationState = validationState; + if (this.innerProperties() == null) { + this.innerProperties = new PeerAsnProperties(); + } + this.innerProperties().withValidationState(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 (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnProperties.java new file mode 100644 index 0000000000000..0576da195df1d --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnProperties.java @@ -0,0 +1,133 @@ +// 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.util.logging.ClientLogger; +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; + +/** The properties that define a peer's ASN. */ +@Fluent +public final class PeerAsnProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerAsnProperties.class); + + /* + * The Autonomous System Number (ASN) of the peer. + */ + @JsonProperty(value = "peerAsn") + private Integer peerAsn; + + /* + * The contact information of the peer. + */ + @JsonProperty(value = "peerContactInfo") + private ContactInfo peerContactInfo; + + /* + * The name of the peer. + */ + @JsonProperty(value = "peerName") + private String peerName; + + /* + * The validation state of the ASN associated with the peer. + */ + @JsonProperty(value = "validationState") + private ValidationState validationState; + + /** + * Get the peerAsn property: The Autonomous System Number (ASN) of the peer. + * + * @return the peerAsn value. + */ + public Integer peerAsn() { + return this.peerAsn; + } + + /** + * Set the peerAsn property: The Autonomous System Number (ASN) of the peer. + * + * @param peerAsn the peerAsn value to set. + * @return the PeerAsnProperties object itself. + */ + public PeerAsnProperties withPeerAsn(Integer peerAsn) { + this.peerAsn = peerAsn; + return this; + } + + /** + * Get the peerContactInfo property: The contact information of the peer. + * + * @return the peerContactInfo value. + */ + public ContactInfo peerContactInfo() { + return this.peerContactInfo; + } + + /** + * Set the peerContactInfo property: The contact information of the peer. + * + * @param peerContactInfo the peerContactInfo value to set. + * @return the PeerAsnProperties object itself. + */ + public PeerAsnProperties withPeerContactInfo(ContactInfo peerContactInfo) { + this.peerContactInfo = peerContactInfo; + return this; + } + + /** + * Get the peerName property: The name of the peer. + * + * @return the peerName value. + */ + public String peerName() { + return this.peerName; + } + + /** + * Set the peerName property: The name of the peer. + * + * @param peerName the peerName value to set. + * @return the PeerAsnProperties object itself. + */ + public PeerAsnProperties withPeerName(String peerName) { + this.peerName = peerName; + return this; + } + + /** + * Get the validationState property: The validation state of the ASN associated with the peer. + * + * @return the validationState value. + */ + public ValidationState validationState() { + return this.validationState; + } + + /** + * Set the validationState property: The validation state of the ASN associated with the peer. + * + * @param validationState the validationState value to set. + * @return the PeerAsnProperties object itself. + */ + public PeerAsnProperties withValidationState(ValidationState validationState) { + this.validationState = validationState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (peerContactInfo() != null) { + peerContactInfo().validate(); + } + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringInner.java index 0298b3c574ec6..400479b2254a7 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringInner.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringInner.java @@ -5,7 +5,6 @@ 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.Kind; @@ -14,13 +13,13 @@ import com.azure.resourcemanager.peering.models.PeeringSku; import com.azure.resourcemanager.peering.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. */ -@JsonFlatten @Fluent -public class PeeringInner extends ProxyResource { +public final class PeeringInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringInner.class); /* @@ -35,6 +34,12 @@ public class PeeringInner extends ProxyResource { @JsonProperty(value = "kind", required = true) private Kind kind; + /* + * The properties that define a peering. + */ + @JsonProperty(value = "properties") + private PeeringProperties innerProperties; + /* * The location of the resource. */ @@ -45,32 +50,9 @@ public class PeeringInner extends ProxyResource { * The resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /* - * The properties that define a direct peering. - */ - @JsonProperty(value = "properties.direct") - private PeeringPropertiesDirect direct; - - /* - * The properties that define an exchange peering. - */ - @JsonProperty(value = "properties.exchange") - private PeeringPropertiesExchange exchange; - - /* - * The location of the peering. - */ - @JsonProperty(value = "properties.peeringLocation") - private String peeringLocation; - - /* - * The provisioning state of the resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; - /** * Get the sku property: The SKU that defines the tier and kind of the peering. * @@ -111,6 +93,15 @@ public PeeringInner withKind(Kind kind) { return this; } + /** + * Get the innerProperties property: The properties that define a peering. + * + * @return the innerProperties value. + */ + private PeeringProperties innerProperties() { + return this.innerProperties; + } + /** * Get the location property: The location of the resource. * @@ -157,7 +148,7 @@ public PeeringInner withTags(Map tags) { * @return the direct value. */ public PeeringPropertiesDirect direct() { - return this.direct; + return this.innerProperties() == null ? null : this.innerProperties().direct(); } /** @@ -167,7 +158,10 @@ public PeeringPropertiesDirect direct() { * @return the PeeringInner object itself. */ public PeeringInner withDirect(PeeringPropertiesDirect direct) { - this.direct = direct; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringProperties(); + } + this.innerProperties().withDirect(direct); return this; } @@ -177,7 +171,7 @@ public PeeringInner withDirect(PeeringPropertiesDirect direct) { * @return the exchange value. */ public PeeringPropertiesExchange exchange() { - return this.exchange; + return this.innerProperties() == null ? null : this.innerProperties().exchange(); } /** @@ -187,7 +181,10 @@ public PeeringPropertiesExchange exchange() { * @return the PeeringInner object itself. */ public PeeringInner withExchange(PeeringPropertiesExchange exchange) { - this.exchange = exchange; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringProperties(); + } + this.innerProperties().withExchange(exchange); return this; } @@ -197,7 +194,7 @@ public PeeringInner withExchange(PeeringPropertiesExchange exchange) { * @return the peeringLocation value. */ public String peeringLocation() { - return this.peeringLocation; + return this.innerProperties() == null ? null : this.innerProperties().peeringLocation(); } /** @@ -207,7 +204,10 @@ public String peeringLocation() { * @return the PeeringInner object itself. */ public PeeringInner withPeeringLocation(String peeringLocation) { - this.peeringLocation = peeringLocation; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringProperties(); + } + this.innerProperties().withPeeringLocation(peeringLocation); return this; } @@ -217,7 +217,7 @@ public PeeringInner withPeeringLocation(String peeringLocation) { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -238,16 +238,13 @@ public void validate() { .logExceptionAsError( new IllegalArgumentException("Missing required property kind in model PeeringInner")); } + if (innerProperties() != null) { + innerProperties().validate(); + } if (location() == null) { throw logger .logExceptionAsError( new IllegalArgumentException("Missing required property location in model PeeringInner")); } - if (direct() != null) { - direct().validate(); - } - if (exchange() != null) { - exchange().validate(); - } } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringLocationInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringLocationInner.java index 66d1113e700a2..d8f308e494235 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringLocationInner.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringLocationInner.java @@ -5,7 +5,6 @@ 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.Kind; @@ -15,9 +14,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** Peering location is where connectivity could be established to the Microsoft Cloud Edge. */ -@JsonFlatten @Fluent -public class PeeringLocationInner extends ProxyResource { +public final class PeeringLocationInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringLocationInner.class); /* @@ -27,34 +25,10 @@ public class PeeringLocationInner extends ProxyResource { private Kind kind; /* - * The properties that define a direct peering location. + * The properties that define a peering location. */ - @JsonProperty(value = "properties.direct") - private PeeringLocationPropertiesDirect direct; - - /* - * The properties that define an exchange peering location. - */ - @JsonProperty(value = "properties.exchange") - private PeeringLocationPropertiesExchange exchange; - - /* - * The name of the peering location. - */ - @JsonProperty(value = "properties.peeringLocation") - private String peeringLocation; - - /* - * The country in which the peering location exists. - */ - @JsonProperty(value = "properties.country") - private String country; - - /* - * The Azure region associated with the peering location. - */ - @JsonProperty(value = "properties.azureRegion") - private String azureRegion; + @JsonProperty(value = "properties") + private PeeringLocationProperties innerProperties; /** * Get the kind property: The kind of peering that the peering location supports. @@ -76,13 +50,22 @@ public PeeringLocationInner withKind(Kind kind) { return this; } + /** + * Get the innerProperties property: The properties that define a peering location. + * + * @return the innerProperties value. + */ + private PeeringLocationProperties innerProperties() { + return this.innerProperties; + } + /** * Get the direct property: The properties that define a direct peering location. * * @return the direct value. */ public PeeringLocationPropertiesDirect direct() { - return this.direct; + return this.innerProperties() == null ? null : this.innerProperties().direct(); } /** @@ -92,7 +75,10 @@ public PeeringLocationPropertiesDirect direct() { * @return the PeeringLocationInner object itself. */ public PeeringLocationInner withDirect(PeeringLocationPropertiesDirect direct) { - this.direct = direct; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringLocationProperties(); + } + this.innerProperties().withDirect(direct); return this; } @@ -102,7 +88,7 @@ public PeeringLocationInner withDirect(PeeringLocationPropertiesDirect direct) { * @return the exchange value. */ public PeeringLocationPropertiesExchange exchange() { - return this.exchange; + return this.innerProperties() == null ? null : this.innerProperties().exchange(); } /** @@ -112,7 +98,10 @@ public PeeringLocationPropertiesExchange exchange() { * @return the PeeringLocationInner object itself. */ public PeeringLocationInner withExchange(PeeringLocationPropertiesExchange exchange) { - this.exchange = exchange; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringLocationProperties(); + } + this.innerProperties().withExchange(exchange); return this; } @@ -122,7 +111,7 @@ public PeeringLocationInner withExchange(PeeringLocationPropertiesExchange excha * @return the peeringLocation value. */ public String peeringLocation() { - return this.peeringLocation; + return this.innerProperties() == null ? null : this.innerProperties().peeringLocation(); } /** @@ -132,7 +121,10 @@ public String peeringLocation() { * @return the PeeringLocationInner object itself. */ public PeeringLocationInner withPeeringLocation(String peeringLocation) { - this.peeringLocation = peeringLocation; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringLocationProperties(); + } + this.innerProperties().withPeeringLocation(peeringLocation); return this; } @@ -142,7 +134,7 @@ public PeeringLocationInner withPeeringLocation(String peeringLocation) { * @return the country value. */ public String country() { - return this.country; + return this.innerProperties() == null ? null : this.innerProperties().country(); } /** @@ -152,7 +144,10 @@ public String country() { * @return the PeeringLocationInner object itself. */ public PeeringLocationInner withCountry(String country) { - this.country = country; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringLocationProperties(); + } + this.innerProperties().withCountry(country); return this; } @@ -162,7 +157,7 @@ public PeeringLocationInner withCountry(String country) { * @return the azureRegion value. */ public String azureRegion() { - return this.azureRegion; + return this.innerProperties() == null ? null : this.innerProperties().azureRegion(); } /** @@ -172,7 +167,10 @@ public String azureRegion() { * @return the PeeringLocationInner object itself. */ public PeeringLocationInner withAzureRegion(String azureRegion) { - this.azureRegion = azureRegion; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringLocationProperties(); + } + this.innerProperties().withAzureRegion(azureRegion); return this; } @@ -182,11 +180,8 @@ public PeeringLocationInner withAzureRegion(String azureRegion) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (direct() != null) { - direct().validate(); - } - if (exchange() != null) { - exchange().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringLocationProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringLocationProperties.java new file mode 100644 index 0000000000000..caea5138813cd --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringLocationProperties.java @@ -0,0 +1,162 @@ +// 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.util.logging.ClientLogger; +import com.azure.resourcemanager.peering.models.PeeringLocationPropertiesDirect; +import com.azure.resourcemanager.peering.models.PeeringLocationPropertiesExchange; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define a peering location. */ +@Fluent +public final class PeeringLocationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringLocationProperties.class); + + /* + * The properties that define a direct peering location. + */ + @JsonProperty(value = "direct") + private PeeringLocationPropertiesDirect direct; + + /* + * The properties that define an exchange peering location. + */ + @JsonProperty(value = "exchange") + private PeeringLocationPropertiesExchange exchange; + + /* + * The name of the peering location. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /* + * The country in which the peering location exists. + */ + @JsonProperty(value = "country") + private String country; + + /* + * The Azure region associated with the peering location. + */ + @JsonProperty(value = "azureRegion") + private String azureRegion; + + /** + * Get the direct property: The properties that define a direct peering location. + * + * @return the direct value. + */ + public PeeringLocationPropertiesDirect direct() { + return this.direct; + } + + /** + * Set the direct property: The properties that define a direct peering location. + * + * @param direct the direct value to set. + * @return the PeeringLocationProperties object itself. + */ + public PeeringLocationProperties withDirect(PeeringLocationPropertiesDirect direct) { + this.direct = direct; + return this; + } + + /** + * Get the exchange property: The properties that define an exchange peering location. + * + * @return the exchange value. + */ + public PeeringLocationPropertiesExchange exchange() { + return this.exchange; + } + + /** + * Set the exchange property: The properties that define an exchange peering location. + * + * @param exchange the exchange value to set. + * @return the PeeringLocationProperties object itself. + */ + public PeeringLocationProperties withExchange(PeeringLocationPropertiesExchange exchange) { + this.exchange = exchange; + return this; + } + + /** + * Get the peeringLocation property: The name of the peering location. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peeringLocation property: The name of the peering location. + * + * @param peeringLocation the peeringLocation value to set. + * @return the PeeringLocationProperties object itself. + */ + public PeeringLocationProperties withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * Get the country property: The country in which the peering location exists. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: The country in which the peering location exists. + * + * @param country the country value to set. + * @return the PeeringLocationProperties object itself. + */ + public PeeringLocationProperties withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the azureRegion property: The Azure region associated with the peering location. + * + * @return the azureRegion value. + */ + public String azureRegion() { + return this.azureRegion; + } + + /** + * Set the azureRegion property: The Azure region associated with the peering location. + * + * @param azureRegion the azureRegion value to set. + * @return the PeeringLocationProperties object itself. + */ + public PeeringLocationProperties withAzureRegion(String azureRegion) { + this.azureRegion = azureRegion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (direct() != null) { + direct().validate(); + } + if (exchange() != null) { + exchange().validate(); + } + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringProperties.java new file mode 100644 index 0000000000000..aeef675f7d266 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringProperties.java @@ -0,0 +1,126 @@ +// 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.util.logging.ClientLogger; +import com.azure.resourcemanager.peering.models.PeeringPropertiesDirect; +import com.azure.resourcemanager.peering.models.PeeringPropertiesExchange; +import com.azure.resourcemanager.peering.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define connectivity to the Microsoft Cloud Edge. */ +@Fluent +public final class PeeringProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringProperties.class); + + /* + * The properties that define a direct peering. + */ + @JsonProperty(value = "direct") + private PeeringPropertiesDirect direct; + + /* + * The properties that define an exchange peering. + */ + @JsonProperty(value = "exchange") + private PeeringPropertiesExchange exchange; + + /* + * The location of the peering. + */ + @JsonProperty(value = "peeringLocation") + private String peeringLocation; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the direct property: The properties that define a direct peering. + * + * @return the direct value. + */ + public PeeringPropertiesDirect direct() { + return this.direct; + } + + /** + * Set the direct property: The properties that define a direct peering. + * + * @param direct the direct value to set. + * @return the PeeringProperties object itself. + */ + public PeeringProperties withDirect(PeeringPropertiesDirect direct) { + this.direct = direct; + return this; + } + + /** + * Get the exchange property: The properties that define an exchange peering. + * + * @return the exchange value. + */ + public PeeringPropertiesExchange exchange() { + return this.exchange; + } + + /** + * Set the exchange property: The properties that define an exchange peering. + * + * @param exchange the exchange value to set. + * @return the PeeringProperties object itself. + */ + public PeeringProperties withExchange(PeeringPropertiesExchange exchange) { + this.exchange = exchange; + return this; + } + + /** + * Get the peeringLocation property: The location of the peering. + * + * @return the peeringLocation value. + */ + public String peeringLocation() { + return this.peeringLocation; + } + + /** + * Set the peeringLocation property: The location of the peering. + * + * @param peeringLocation the peeringLocation value to set. + * @return the PeeringProperties object itself. + */ + public PeeringProperties withPeeringLocation(String peeringLocation) { + this.peeringLocation = peeringLocation; + return this; + } + + /** + * 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() { + if (direct() != null) { + direct().validate(); + } + if (exchange() != null) { + exchange().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 ce5d8d729f529..0000000000000 --- 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 5c842bd1c1483..0000000000000 --- 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/PeeringServiceCountryInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceCountryInner.java deleted file mode 100644 index 8770e2db5098d..0000000000000 --- 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 749f22d16f86b..6a59715435c70 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 @@ -5,26 +5,24 @@ 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.PeeringServiceSku; import com.azure.resourcemanager.peering.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Peering Service. */ -@JsonFlatten @Fluent -public class PeeringServiceInner extends ProxyResource { +public final class PeeringServiceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceInner.class); /* - * The SKU that defines the type of the peering service. + * The properties that define a peering service. */ - @JsonProperty(value = "sku") - private PeeringServiceSku sku; + @JsonProperty(value = "properties") + private PeeringServiceProperties innerProperties; /* * The location of the resource. @@ -36,58 +34,16 @@ public class PeeringServiceInner extends ProxyResource { * The resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /* - * The location (state/province) of the customer. - */ - @JsonProperty(value = "properties.peeringServiceLocation") - private String peeringServiceLocation; - - /* - * The name of the service provider. - */ - @JsonProperty(value = "properties.peeringServiceProvider") - private String peeringServiceProvider; - - /* - * The provisioning state of the resource. - */ - @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. + * Get the innerProperties property: The properties that define a peering service. * - * @param sku the sku value to set. - * @return the PeeringServiceInner object itself. + * @return the innerProperties value. */ - public PeeringServiceInner withSku(PeeringServiceSku sku) { - this.sku = sku; - return this; + private PeeringServiceProperties innerProperties() { + return this.innerProperties; } /** @@ -131,42 +87,48 @@ 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. */ public String peeringServiceLocation() { - return this.peeringServiceLocation; + return this.innerProperties() == null ? null : this.innerProperties().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. */ public PeeringServiceInner withPeeringServiceLocation(String peeringServiceLocation) { - this.peeringServiceLocation = peeringServiceLocation; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceProperties(); + } + this.innerProperties().withPeeringServiceLocation(peeringServiceLocation); return this; } /** - * Get the peeringServiceProvider property: The name of the service provider. + * Get the peeringServiceProvider property: The MAPS Provider Name. * * @return the peeringServiceProvider value. */ public String peeringServiceProvider() { - return this.peeringServiceProvider; + return this.innerProperties() == null ? null : this.innerProperties().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. */ public PeeringServiceInner withPeeringServiceProvider(String peeringServiceProvider) { - this.peeringServiceProvider = peeringServiceProvider; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceProperties(); + } + this.innerProperties().withPeeringServiceProvider(peeringServiceProvider); return this; } @@ -176,51 +138,7 @@ public PeeringServiceInner withPeeringServiceProvider(String peeringServiceProvi * @return the provisioningState value. */ 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; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -229,8 +147,8 @@ public PeeringServiceInner withProviderBackupPeeringLocation(String providerBack * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (sku() != null) { - sku().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } if (location() == null) { throw logger 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 f8a70650d7e30..bcf1aa39985d2 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 @@ -5,35 +5,30 @@ 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.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The peering service location. */ -@JsonFlatten +/** PeeringService location. */ @Fluent -public class PeeringServiceLocationInner extends ProxyResource { +public final class PeeringServiceLocationInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceLocationInner.class); /* - * Country of the customer + * The properties that define a peering service location. */ - @JsonProperty(value = "properties.country") - private String country; + @JsonProperty(value = "properties") + private PeeringServiceLocationProperties innerProperties; - /* - * State of the customer - */ - @JsonProperty(value = "properties.state") - private String state; - - /* - * Azure region for the location + /** + * Get the innerProperties property: The properties that define a peering service location. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.azureRegion") - private String azureRegion; + private PeeringServiceLocationProperties innerProperties() { + return this.innerProperties; + } /** * Get the country property: Country of the customer. @@ -41,7 +36,7 @@ public class PeeringServiceLocationInner extends ProxyResource { * @return the country value. */ public String country() { - return this.country; + return this.innerProperties() == null ? null : this.innerProperties().country(); } /** @@ -51,7 +46,10 @@ public String country() { * @return the PeeringServiceLocationInner object itself. */ public PeeringServiceLocationInner withCountry(String country) { - this.country = country; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceLocationProperties(); + } + this.innerProperties().withCountry(country); return this; } @@ -61,7 +59,7 @@ public PeeringServiceLocationInner withCountry(String country) { * @return the state value. */ public String state() { - return this.state; + return this.innerProperties() == null ? null : this.innerProperties().state(); } /** @@ -71,7 +69,10 @@ public String state() { * @return the PeeringServiceLocationInner object itself. */ public PeeringServiceLocationInner withState(String state) { - this.state = state; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceLocationProperties(); + } + this.innerProperties().withState(state); return this; } @@ -81,7 +82,7 @@ public PeeringServiceLocationInner withState(String state) { * @return the azureRegion value. */ public String azureRegion() { - return this.azureRegion; + return this.innerProperties() == null ? null : this.innerProperties().azureRegion(); } /** @@ -91,7 +92,10 @@ public String azureRegion() { * @return the PeeringServiceLocationInner object itself. */ public PeeringServiceLocationInner withAzureRegion(String azureRegion) { - this.azureRegion = azureRegion; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceLocationProperties(); + } + this.innerProperties().withAzureRegion(azureRegion); return this; } @@ -101,5 +105,8 @@ public PeeringServiceLocationInner withAzureRegion(String azureRegion) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationProperties.java new file mode 100644 index 0000000000000..41119ac21ed32 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationProperties.java @@ -0,0 +1,102 @@ +// 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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define connectivity to the Peering Service Location. */ +@Fluent +public final class PeeringServiceLocationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceLocationProperties.class); + + /* + * Country of the customer + */ + @JsonProperty(value = "country") + private String country; + + /* + * State of the customer + */ + @JsonProperty(value = "state") + private String state; + + /* + * Azure region for the location + */ + @JsonProperty(value = "azureRegion") + private String azureRegion; + + /** + * Get the country property: Country of the customer. + * + * @return the country value. + */ + public String country() { + return this.country; + } + + /** + * Set the country property: Country of the customer. + * + * @param country the country value to set. + * @return the PeeringServiceLocationProperties object itself. + */ + public PeeringServiceLocationProperties withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the state property: State of the customer. + * + * @return the state value. + */ + public String state() { + return this.state; + } + + /** + * Set the state property: State of the customer. + * + * @param state the state value to set. + * @return the PeeringServiceLocationProperties object itself. + */ + public PeeringServiceLocationProperties withState(String state) { + this.state = state; + return this; + } + + /** + * Get the azureRegion property: Azure region for the location. + * + * @return the azureRegion value. + */ + public String azureRegion() { + return this.azureRegion; + } + + /** + * Set the azureRegion property: Azure region for the location. + * + * @param azureRegion the azureRegion value to set. + * @return the PeeringServiceLocationProperties object itself. + */ + public PeeringServiceLocationProperties withAzureRegion(String azureRegion) { + this.azureRegion = azureRegion; + 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/fluent/models/PeeringServicePrefixInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServicePrefixInner.java index 841e9636f4db7..677648a818f91 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 @@ -5,82 +5,54 @@ 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.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 @Fluent -public class PeeringServicePrefixInner extends ProxyResource { +public final class PeeringServicePrefixInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicePrefixInner.class); /* - * The prefix from which your traffic originates. + * Gets or sets the peering prefix properties. */ - @JsonProperty(value = "properties.prefix") - private String prefix; + @JsonProperty(value = "properties") + private PeeringServicePrefixProperties innerProperties; - /* - * The prefix validation state - */ - @JsonProperty(value = "properties.prefixValidationState", access = JsonProperty.Access.WRITE_ONLY) - private PrefixValidationState prefixValidationState; - - /* - * The prefix learned type - */ - @JsonProperty(value = "properties.learnedType", access = JsonProperty.Access.WRITE_ONLY) - 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. + /** + * Get the innerProperties property: Gets or sets the peering prefix properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; + private PeeringServicePrefixProperties innerProperties() { + return this.innerProperties; + } /** - * Get the prefix property: The prefix from which your traffic originates. + * Get the prefix property: Valid route prefix. * * @return the prefix value. */ public String prefix() { - return this.prefix; + return this.innerProperties() == null ? null : this.innerProperties().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. */ public PeeringServicePrefixInner withPrefix(String prefix) { - this.prefix = prefix; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServicePrefixProperties(); + } + this.innerProperties().withPrefix(prefix); return this; } @@ -90,53 +62,43 @@ public PeeringServicePrefixInner withPrefix(String prefix) { * @return the prefixValidationState value. */ public PrefixValidationState prefixValidationState() { - return this.prefixValidationState; + return this.innerProperties() == null ? null : this.innerProperties().prefixValidationState(); } /** - * Get the learnedType property: The prefix learned type. - * - * @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. + * Set the prefixValidationState property: The prefix validation state. * - * @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) { + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServicePrefixProperties(); + } + this.innerProperties().withPrefixValidationState(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.innerProperties() == null ? null : this.innerProperties().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) { + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServicePrefixProperties(); + } + this.innerProperties().withLearnedType(learnedType); return this; } @@ -146,7 +108,7 @@ public PeeringServicePrefixInner withPeeringServicePrefixKey(String peeringServi * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -155,8 +117,8 @@ public ProvisioningState provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (events() != null) { - events().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().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/PeeringServicePrefixProperties.java similarity index 50% rename from sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixInner.java rename to sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServicePrefixProperties.java index 0be2d0ffa58c5..970d767074892 100644 --- 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/PeeringServicePrefixProperties.java @@ -5,52 +5,44 @@ 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.LearnedType; 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 +/** The peering service prefix properties class. */ @Fluent -public class PeeringRegisteredPrefixInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringRegisteredPrefixInner.class); +public final class PeeringServicePrefixProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicePrefixProperties.class); /* - * The customer's prefix from which traffic originates. + * Valid route prefix */ - @JsonProperty(value = "properties.prefix") + @JsonProperty(value = "prefix") private String prefix; /* - * The prefix validation state. + * The prefix validation state */ - @JsonProperty(value = "properties.prefixValidationState", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "prefixValidationState") private PrefixValidationState prefixValidationState; /* - * The peering service prefix key that is to be shared with the customer. + * The prefix learned type */ - @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; + @JsonProperty(value = "learnedType") + private LearnedType learnedType; /* * The provisioning state of the resource. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** - * Get the prefix property: The customer's prefix from which traffic originates. + * Get the prefix property: Valid route prefix. * * @return the prefix value. */ @@ -59,12 +51,12 @@ public String prefix() { } /** - * Set the prefix property: The customer's prefix from which traffic originates. + * Set the prefix property: Valid route prefix. * * @param prefix the prefix value to set. - * @return the PeeringRegisteredPrefixInner object itself. + * @return the PeeringServicePrefixProperties object itself. */ - public PeeringRegisteredPrefixInner withPrefix(String prefix) { + public PeeringServicePrefixProperties withPrefix(String prefix) { this.prefix = prefix; return this; } @@ -79,21 +71,34 @@ public PrefixValidationState prefixValidationState() { } /** - * Get the peeringServicePrefixKey property: The peering service prefix key that is to be shared with the customer. + * Set the prefixValidationState property: The prefix validation state. + * + * @param prefixValidationState the prefixValidationState value to set. + * @return the PeeringServicePrefixProperties object itself. + */ + public PeeringServicePrefixProperties withPrefixValidationState(PrefixValidationState prefixValidationState) { + this.prefixValidationState = prefixValidationState; + return this; + } + + /** + * 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; } /** - * Get the errorMessage property: The error message associated with the validation state, if any. + * Set the learnedType property: The prefix learned type. * - * @return the errorMessage value. + * @param learnedType the learnedType value to set. + * @return the PeeringServicePrefixProperties object itself. */ - public String errorMessage() { - return this.errorMessage; + public PeeringServicePrefixProperties withLearnedType(LearnedType learnedType) { + this.learnedType = learnedType; + return this; } /** diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProperties.java new file mode 100644 index 0000000000000..9828352cff1c1 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProperties.java @@ -0,0 +1,92 @@ +// 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.util.logging.ClientLogger; +import com.azure.resourcemanager.peering.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define connectivity to the Peering Service. */ +@Fluent +public final class PeeringServiceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceProperties.class); + + /* + * The PeeringServiceLocation of the Customer. + */ + @JsonProperty(value = "peeringServiceLocation") + private String peeringServiceLocation; + + /* + * The MAPS Provider Name. + */ + @JsonProperty(value = "peeringServiceProvider") + private String peeringServiceProvider; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the peeringServiceLocation property: The PeeringServiceLocation of the Customer. + * + * @return the peeringServiceLocation value. + */ + public String peeringServiceLocation() { + return this.peeringServiceLocation; + } + + /** + * Set the peeringServiceLocation property: The PeeringServiceLocation of the Customer. + * + * @param peeringServiceLocation the peeringServiceLocation value to set. + * @return the PeeringServiceProperties object itself. + */ + public PeeringServiceProperties withPeeringServiceLocation(String peeringServiceLocation) { + this.peeringServiceLocation = peeringServiceLocation; + return this; + } + + /** + * Get the peeringServiceProvider property: The MAPS Provider Name. + * + * @return the peeringServiceProvider value. + */ + public String peeringServiceProvider() { + return this.peeringServiceProvider; + } + + /** + * Set the peeringServiceProvider property: The MAPS Provider Name. + * + * @param peeringServiceProvider the peeringServiceProvider value to set. + * @return the PeeringServiceProperties object itself. + */ + public PeeringServiceProperties withPeeringServiceProvider(String peeringServiceProvider) { + this.peeringServiceProvider = peeringServiceProvider; + return this; + } + + /** + * 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/PeeringServiceProviderInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderInner.java index da060a5aa1dab..6e029496159cc 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 @@ -5,31 +5,30 @@ 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.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; /** PeeringService provider. */ -@JsonFlatten @Fluent -public class PeeringServiceProviderInner extends ProxyResource { +public final class PeeringServiceProviderInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceProviderInner.class); /* - * The name of the service provider. + * The properties that define a peering service provider. */ - @JsonProperty(value = "properties.serviceProviderName") - private String serviceProviderName; + @JsonProperty(value = "properties") + private PeeringServiceProviderProperties innerProperties; - /* - * The list of locations at which the service provider peers with - * Microsoft. + /** + * Get the innerProperties property: The properties that define a peering service provider. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.peeringLocations") - private List peeringLocations; + private PeeringServiceProviderProperties innerProperties() { + return this.innerProperties; + } /** * Get the serviceProviderName property: The name of the service provider. @@ -37,7 +36,7 @@ public class PeeringServiceProviderInner extends ProxyResource { * @return the serviceProviderName value. */ public String serviceProviderName() { - return this.serviceProviderName; + return this.innerProperties() == null ? null : this.innerProperties().serviceProviderName(); } /** @@ -47,27 +46,10 @@ public String serviceProviderName() { * @return the PeeringServiceProviderInner object itself. */ public PeeringServiceProviderInner withServiceProviderName(String serviceProviderName) { - this.serviceProviderName = serviceProviderName; - 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; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceProviderProperties(); + } + this.innerProperties().withServiceProviderName(serviceProviderName); return this; } @@ -77,5 +59,8 @@ public PeeringServiceProviderInner withPeeringLocations(List peeringLoca * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderProperties.java new file mode 100644 index 0000000000000..2cf1fa22c53d7 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderProperties.java @@ -0,0 +1,50 @@ +// 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.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define connectivity to the Peering Service Provider. */ +@Fluent +public final class PeeringServiceProviderProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceProviderProperties.class); + + /* + * The name of the service provider. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /** + * Get the serviceProviderName property: The name of the service provider. + * + * @return the serviceProviderName value. + */ + public String serviceProviderName() { + return this.serviceProviderName; + } + + /** + * Set the serviceProviderName property: The name of the service provider. + * + * @param serviceProviderName the serviceProviderName value to set. + * @return the PeeringServiceProviderProperties object itself. + */ + public PeeringServiceProviderProperties withServiceProviderName(String serviceProviderName) { + this.serviceProviderName = serviceProviderName; + 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/implementation/CdnPeeringPrefixImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixImpl.java deleted file mode 100644 index eef26890de86c..0000000000000 --- 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 d8e93e1c95e6d..0000000000000 --- 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 4594b349f43bb..0000000000000 --- 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 544847e55a065..39c706e451f2c 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 9633dbf063a9f..7911f44195426 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 8c01d25248179..dadf641455a7b 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/PeerAsnsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnsImpl.java index bbe273940b487..9e434ae6d5ed0 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnsImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnsImpl.java @@ -97,7 +97,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerAsns'.", id))); } - this.deleteWithResponse(peerAsnName, Context.NONE).getValue(); + this.deleteWithResponse(peerAsnName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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 1f10890a52f10..e7b8b9e33be0d 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 2efef6b118d51..0000000000000 --- 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 dd30bedb8aeb8..0000000000000 --- 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 2c35c1ac2b348..0000000000000 --- 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 f608089da9e39..0000000000000 --- 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 1ee72e2e2bae7..0000000000000 --- 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 c7e0fda49b471..0000000000000 --- 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 1aa0c5de92de5..b5eb5d342e560 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 1d7d178816c1e..61e1d3aa00e84 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 810cb5a2713e8..4156a11b36e05 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 a5ad8dc4665e0..3cd6540144c67 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 0000000000000..f20e802151a98 --- /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 bc21390907451..383af335b3224 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); } 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 bdcdc77d74581..3aee4cc5491c5 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/PeeringServicesImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicesImpl.java index 7c8483ece284f..6dc6ea7b707a5 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicesImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicesImpl.java @@ -137,7 +137,7 @@ public void deleteById(String id) { String .format("The resource ID '%s' is not valid. Missing path segment 'peeringServices'.", id))); } - this.deleteWithResponse(resourceGroupName, peeringServiceName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, peeringServiceName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringsImpl.java index 0c21b4c6216cf..3c18be06f8899 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringsImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringsImpl.java @@ -133,7 +133,7 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); } - this.deleteWithResponse(resourceGroupName, peeringName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, peeringName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { 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 df6c887e50a11..0b463b820f91a 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 7b6c5a890d2c4..e357579b45338 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 c966fd5a4fa6a..0000000000000 --- 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 0c2ad7795e256..0000000000000 --- 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 cf90b31f394b7..0000000000000 --- 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 d7713578ad084..0000000000000 --- 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 2e2d83d4cd748..0000000000000 --- 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 e285cc76f142b..ef87a7e4ba725 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 f4484b34911b1..0000000000000 --- 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 59289b141a5fc..0000000000000 --- 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 b2162b04bbbb1..0000000000000 --- 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 8d3a2daae9883..628d7f627ceec 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 73276b13ba434..0000000000000 --- 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 0000000000000..e502636fa5d43 --- /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 f1525cab182d1..e59d31c3cd956 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 f919a586d09e2..1dd6de3011f4b 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 a0fd9eca4f84b..d6a7e767fcfdd 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 a80433c8327d3..a0286db76b3df 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 f416873140423..0c0fc2ab7437e 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 0000000000000..460f073341672 --- /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 7f376692e5d88..23fd7df742639 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 69a0bb7b0010d..bd1a356b9b56d 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 eb302c8bdbfce..299caaf9fb764 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 614fc04528191..0000000000000 --- 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 1b1b4fbecce8c..0000000000000 --- 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 fe1a0fab361a8..0000000000000 --- 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 eb41f52b5d869..0000000000000 --- 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 bd2aaebc8bf15..0000000000000 --- 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 01e646f232edc..0000000000000 --- 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 672b02e966d00..a82405819a904 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 a35743bf6cad5..0000000000000 --- 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 f844ada48b565..0000000000000 --- 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 bc4ad9e60cf48..0000000000000 --- 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 d56158e7fa023..9608f27e3455d 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 e61d63a8dfad9..d0b30e7f88fb3 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 6c5ea697a8c82..0000000000000 --- 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 c425a81c843a5..83fef28f2763a 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 0000000000000..43845aa3d0b11 --- /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 abc85321595c1..18f5f250cd83f 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 5330d6be5d901..0000000000000 --- 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 1abe50536382a..3265b3234dfe1 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 0d546fb46990a..abf7b7f8cfc46 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 9389aed4d6c0c..0000000000000 --- 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 10266f355e172..0000000000000 --- 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 3a315626c3357..0000000000000 --- 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/ResourceTags.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ResourceTags.java index 58861fff4f6ac..63c63a7e3b946 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ResourceTags.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ResourceTags.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class ResourceTags { * Gets or sets the tags, a dictionary of descriptors arm object */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** 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 7bb91ac9ca26d..0000000000000 --- 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); - } -} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/LegacyPeeringsListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/LegacyPeeringsListSamples.java new file mode 100644 index 0000000000000..83c183cd79bd3 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/LegacyPeeringsListSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.LegacyPeeringsKind; + +/** Samples for LegacyPeerings List. */ +public final class LegacyPeeringsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListLegacyPeerings.json + */ + /** + * Sample code: List legacy peerings. + * + * @param manager Entry point to PeeringManager. + */ + public static void listLegacyPeerings(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.legacyPeerings().list("peeringLocation0", LegacyPeeringsKind.EXCHANGE, Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/OperationsListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..4dbaafc3c32d8 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringOperations.json + */ + /** + * Sample code: List peering operations. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringOperations(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsCreateOrUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..d49bebbb8c5bb --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// 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.generated; + +import com.azure.resourcemanager.peering.models.ContactInfo; +import java.util.Arrays; + +/** Samples for PeerAsns CreateOrUpdate. */ +public final class PeerAsnsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreatePeerAsn.json + */ + /** + * Sample code: Create a peer ASN. + * + * @param manager Entry point to PeeringManager. + */ + public static void createAPeerASN(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peerAsns() + .define("MyPeerAsn") + .withPeerAsn(65000) + .withPeerContactInfo( + new ContactInfo() + .withEmails(Arrays.asList("abc@contoso.com", "xyz@contoso.com")) + .withPhone(Arrays.asList("+1 (234) 567-8900"))) + .withPeerName("Contoso") + .create(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsDeleteSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsDeleteSamples.java new file mode 100644 index 0000000000000..6b59461c25ebd --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeerAsns Delete. */ +public final class PeerAsnsDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/DeletePeerAsn.json + */ + /** + * Sample code: Delete a peer ASN. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteAPeerASN(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerAsns().deleteWithResponse("MyPeerAsn", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsGetSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsGetSamples.java new file mode 100644 index 0000000000000..96fa811d6b58d --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsGetSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeerAsns Get. */ +public final class PeerAsnsGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/GetPeerAsn.json + */ + /** + * Sample code: Get a peer ASN. + * + * @param manager Entry point to PeeringManager. + */ + public static void getAPeerASN(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerAsns().getWithResponse("MyPeerAsn", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsListSamples.java new file mode 100644 index 0000000000000..03cac735dbd18 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeerAsns List. */ +public final class PeerAsnsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeerAsnsBySubscription.json + */ + /** + * Sample code: List peer ASNs in a subscription. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeerASNsInASubscription(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerAsns().list(Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringLocationsListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringLocationsListSamples.java new file mode 100644 index 0000000000000..1cc60b01ae30b --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringLocationsListSamples.java @@ -0,0 +1,35 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.PeeringLocationsKind; + +/** Samples for PeeringLocations List. */ +public final class PeeringLocationsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListExchangePeeringLocations.json + */ + /** + * Sample code: List exchange peering locations. + * + * @param manager Entry point to PeeringManager. + */ + public static void listExchangePeeringLocations(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringLocations().list(PeeringLocationsKind.EXCHANGE, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListDirectPeeringLocations.json + */ + /** + * Sample code: List direct peering locations. + * + * @param manager Entry point to PeeringManager. + */ + public static void listDirectPeeringLocations(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringLocations().list(PeeringLocationsKind.DIRECT, null, Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServiceLocationsListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServiceLocationsListSamples.java new file mode 100644 index 0000000000000..a8fa3cc84885a --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServiceLocationsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeeringServiceLocations List. */ +public final class PeeringServiceLocationsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServiceLocations.json + */ + /** + * Sample code: List peering service locations. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServiceLocations(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServiceLocations().list(Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesCreateOrUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..93643a8f09b1d --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesCreateOrUpdateSamples.java @@ -0,0 +1,26 @@ +// 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.generated; + +/** Samples for PeeringServicePrefixes CreateOrUpdate. */ +public final class PeeringServicePrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreatePeeringServicePrefix.json + */ + /** + * Sample code: Create or update a prefix for the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void createOrUpdateAPrefixForThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peeringServicePrefixes() + .define("MyPeeringServicePrefix") + .withExistingPeeringService("MyResourceGroup", "MyPeeringService") + .withPrefix("192.168.1.0/24") + .create(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesDeleteSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesDeleteSamples.java new file mode 100644 index 0000000000000..260838e404a3d --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesDeleteSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeeringServicePrefixes Delete. */ +public final class PeeringServicePrefixesDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/DeletePeeringServicePrefix.json + */ + /** + * Sample code: Delete a prefix associated with the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteAPrefixAssociatedWithThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peeringServicePrefixes() + .deleteWithResponse("MyResourceGroup", "MyPeeringService", "MyPeeringServicePrefix", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesGetSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesGetSamples.java new file mode 100644 index 0000000000000..0dc9512111036 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicePrefixesGetSamples.java @@ -0,0 +1,25 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeeringServicePrefixes Get. */ +public final class PeeringServicePrefixesGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/GetPeeringServicePrefix.json + */ + /** + * Sample code: Get a prefix associated with the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void getAPrefixAssociatedWithThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peeringServicePrefixes() + .getWithResponse("MyResourceGroup", "MyPeeringService", "MyPeeringServicePrefix", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServiceProvidersListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServiceProvidersListSamples.java new file mode 100644 index 0000000000000..9ba4c7cb51456 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServiceProvidersListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeeringServiceProviders List. */ +public final class PeeringServiceProvidersListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServiceProviders.json + */ + /** + * Sample code: List peering service providers. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServiceProviders(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServiceProviders().list(Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesCreateOrUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..f7b545d5ed229 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// 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.generated; + +/** Samples for PeeringServices CreateOrUpdate. */ +public final class PeeringServicesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreatePeeringService.json + */ + /** + * Sample code: Create a peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void createAPeeringService(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peeringServices() + .define("MyPeeringService") + .withRegion("eastus") + .withExistingResourceGroup("MyResourceGroup") + .withPeeringServiceLocation("state1") + .withPeeringServiceProvider("serviceProvider1") + .create(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesDeleteSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesDeleteSamples.java new file mode 100644 index 0000000000000..d2d06fac36d34 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeeringServices Delete. */ +public final class PeeringServicesDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/DeletePeeringService.json + */ + /** + * Sample code: Delete a peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteAPeeringService(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().deleteWithResponse("MyResourceGroup", "MyPeeringService", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesGetByResourceGroupSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..43b10d042aa36 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeeringServices GetByResourceGroup. */ +public final class PeeringServicesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/GetPeeringService.json + */ + /** + * Sample code: Get a peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void getAPeeringService(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().getByResourceGroupWithResponse("MyResourceGroup", "MyPeeringService", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesListByResourceGroupSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesListByResourceGroupSamples.java new file mode 100644 index 0000000000000..7645063fd9f68 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeeringServices ListByResourceGroup. */ +public final class PeeringServicesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServicesByResourceGroup.json + */ + /** + * Sample code: List peering services in a resource group. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServicesInAResourceGroup(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().listByResourceGroup("MyResourceGroup", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesListSamples.java new file mode 100644 index 0000000000000..1e3c2bf3d0d5c --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for PeeringServices List. */ +public final class PeeringServicesListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringServicesBySubscription.json + */ + /** + * Sample code: List peering services in a subscription. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServicesInASubscription(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().list(Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesUpdateSamples.java new file mode 100644 index 0000000000000..8ecd349cd2dc2 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesUpdateSamples.java @@ -0,0 +1,41 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.PeeringService; +import java.util.HashMap; +import java.util.Map; + +/** Samples for PeeringServices Update. */ +public final class PeeringServicesUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/UpdatePeeringServiceTags.json + */ + /** + * Sample code: Update peering service tags. + * + * @param manager Entry point to PeeringManager. + */ + public static void updatePeeringServiceTags(com.azure.resourcemanager.peering.PeeringManager manager) { + PeeringService resource = + manager + .peeringServices() + .getByResourceGroupWithResponse("MyResourceGroup", "MyPeeringService", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("tag0", "value0", "tag1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsCreateOrUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..13cfce8b2ee17 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsCreateOrUpdateSamples.java @@ -0,0 +1,123 @@ +// 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.generated; + +import com.azure.core.management.SubResource; +import com.azure.resourcemanager.peering.models.BgpSession; +import com.azure.resourcemanager.peering.models.DirectConnection; +import com.azure.resourcemanager.peering.models.DirectPeeringType; +import com.azure.resourcemanager.peering.models.ExchangeConnection; +import com.azure.resourcemanager.peering.models.Kind; +import com.azure.resourcemanager.peering.models.Name; +import com.azure.resourcemanager.peering.models.PeeringPropertiesDirect; +import com.azure.resourcemanager.peering.models.PeeringPropertiesExchange; +import com.azure.resourcemanager.peering.models.PeeringSku; +import com.azure.resourcemanager.peering.models.SessionAddressProvider; +import java.util.Arrays; + +/** Samples for Peerings CreateOrUpdate. */ +public final class PeeringsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreateExchangePeering.json + */ + /** + * Sample code: Create an exchange peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void createAnExchangePeering(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peerings() + .define("MyPeering") + .withRegion("eastus") + .withExistingResourceGroup("MyResourceGroup") + .withSku(new PeeringSku().withName(Name.BASIC_EXCHANGE_FREE)) + .withKind(Kind.EXCHANGE) + .withExchange( + new PeeringPropertiesExchange() + .withConnections( + Arrays + .asList( + new ExchangeConnection() + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withPeerSessionIPv4Address("192.168.2.1") + .withPeerSessionIPv6Address("fd00::1") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100) + .withMd5AuthenticationKey("test-md5-auth-key")) + .withConnectionIdentifier("CE495334-0E94-4E51-8164-8116D6CD284D"), + new ExchangeConnection() + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withPeerSessionIPv4Address("192.168.2.2") + .withPeerSessionIPv6Address("fd00::2") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100) + .withMd5AuthenticationKey("test-md5-auth-key")) + .withConnectionIdentifier("CDD8E673-CB07-47E6-84DE-3739F778762B"))) + .withPeerAsn( + new SubResource().withId("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1"))) + .withPeeringLocation("peeringLocation0") + .create(); + } + + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CreateDirectPeering.json + */ + /** + * Sample code: Create a direct peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void createADirectPeering(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peerings() + .define("MyPeering") + .withRegion("eastus") + .withExistingResourceGroup("MyResourceGroup") + .withSku(new PeeringSku().withName(Name.BASIC_DIRECT_FREE)) + .withKind(Kind.DIRECT) + .withDirect( + new PeeringPropertiesDirect() + .withConnections( + Arrays + .asList( + new DirectConnection() + .withBandwidthInMbps(10000) + .withSessionAddressProvider(SessionAddressProvider.PEER) + .withUseForPeeringService(false) + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withSessionPrefixV4("192.168.0.0/31") + .withSessionPrefixV6("fd00::0/127") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100) + .withMd5AuthenticationKey("test-md5-auth-key")) + .withConnectionIdentifier("5F4CB5C7-6B43-4444-9338-9ABC72606C16"), + new DirectConnection() + .withBandwidthInMbps(10000) + .withSessionAddressProvider(SessionAddressProvider.MICROSOFT) + .withUseForPeeringService(true) + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withSessionPrefixV4("192.168.1.0/31") + .withSessionPrefixV6("fd00::2/127") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100) + .withMd5AuthenticationKey("test-md5-auth-key")) + .withConnectionIdentifier("8AB00818-D533-4504-A25A-03A17F61201C"))) + .withUseForPeeringService(false) + .withPeerAsn( + new SubResource().withId("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1")) + .withDirectPeeringType(DirectPeeringType.EDGE)) + .withPeeringLocation("peeringLocation0") + .create(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsDeleteSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsDeleteSamples.java new file mode 100644 index 0000000000000..5083b5237ab02 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsDeleteSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Peerings Delete. */ +public final class PeeringsDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/DeletePeering.json + */ + /** + * Sample code: Delete a peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteAPeering(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerings().deleteWithResponse("MyResourceGroup", "MyPeering", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsGetByResourceGroupSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..5879e5d5f38c5 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Peerings GetByResourceGroup. */ +public final class PeeringsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/GetPeering.json + */ + /** + * Sample code: Get a peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void getAPeering(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerings().getByResourceGroupWithResponse("MyResourceGroup", "MyPeering", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsListByResourceGroupSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..6d249109c62a0 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Peerings ListByResourceGroup. */ +public final class PeeringsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringsByResourceGroup.json + */ + /** + * Sample code: List peerings in a resource group. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringsInAResourceGroup(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerings().listByResourceGroup("MyResourceGroup", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsListSamples.java new file mode 100644 index 0000000000000..421012c8068c1 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsListSamples.java @@ -0,0 +1,22 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Peerings List. */ +public final class PeeringsListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPeeringsBySubscription.json + */ + /** + * Sample code: List peerings in a subscription. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringsInASubscription(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peerings().list(Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsUpdateSamples.java new file mode 100644 index 0000000000000..0808d90aa94a0 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsUpdateSamples.java @@ -0,0 +1,38 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.Peering; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Peerings Update. */ +public final class PeeringsUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/UpdatePeeringTags.json + */ + /** + * Sample code: Update peering tags. + * + * @param manager Entry point to PeeringManager. + */ + public static void updatePeeringTags(com.azure.resourcemanager.peering.PeeringManager manager) { + Peering resource = + manager.peerings().getByResourceGroupWithResponse("MyResourceGroup", "MyPeering", Context.NONE).getValue(); + resource.update().withTags(mapOf("tag0", "value0", "tag1", "value1")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesListByPeeringServiceSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesListByPeeringServiceSamples.java new file mode 100644 index 0000000000000..961c577938495 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesListByPeeringServiceSamples.java @@ -0,0 +1,23 @@ +// 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.generated; + +import com.azure.core.util.Context; + +/** Samples for Prefixes ListByPeeringService. */ +public final class PrefixesListByPeeringServiceSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/ListPrefixesByPeeringService.json + */ + /** + * Sample code: List all the prefixes associated with the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllThePrefixesAssociatedWithThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.prefixes().listByPeeringService("MyResourceGroup", "MyPeeringService", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ResourceProviderCheckServiceProviderAvailabilitySamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ResourceProviderCheckServiceProviderAvailabilitySamples.java new file mode 100644 index 0000000000000..61ae4a8a6b1cf --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ResourceProviderCheckServiceProviderAvailabilitySamples.java @@ -0,0 +1,30 @@ +// 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.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.CheckServiceProviderAvailabilityInput; + +/** Samples for ResourceProvider CheckServiceProviderAvailability. */ +public final class ResourceProviderCheckServiceProviderAvailabilitySamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/preview/2019-08-01-preview/examples/CheckServiceProviderAvailability.json + */ + /** + * Sample code: Check if peering service provider is available in customer location. + * + * @param manager Entry point to PeeringManager. + */ + public static void checkIfPeeringServiceProviderIsAvailableInCustomerLocation( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .resourceProviders() + .checkServiceProviderAvailabilityWithResponse( + new CheckServiceProviderAvailabilityInput() + .withPeeringServiceLocation("peeringServiceLocation1") + .withPeeringServiceProvider("peeringServiceProvider1"), + Context.NONE); + } +}