diff --git a/sdk/peering/azure-resourcemanager-peering/CHANGELOG.md b/sdk/peering/azure-resourcemanager-peering/CHANGELOG.md index f85a9a1a1873..9ec11e12ad70 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-08-09) +- Azure Resource Manager Peering client library for Java. This package contains Microsoft Azure SDK for Peering Management SDK. Peering Client. Package tag package-2022-06-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-19) diff --git a/sdk/peering/azure-resourcemanager-peering/README.md b/sdk/peering/azure-resourcemanager-peering/README.md index 56a50976a791..d325da10a0fd 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-2022-06-01. 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 000000000000..8a31dad3d6c7 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/SAMPLE.md @@ -0,0 +1,1296 @@ +# Code snippets and samples + + +## CdnPeeringPrefixes + +- [List](#cdnpeeringprefixes_list) + +## ConnectionMonitorTests + +- [CreateOrUpdate](#connectionmonitortests_createorupdate) +- [Delete](#connectionmonitortests_delete) +- [Get](#connectionmonitortests_get) +- [ListByPeeringService](#connectionmonitortests_listbypeeringservice) + +## LegacyPeerings + +- [List](#legacypeerings_list) + +## LookingGlass + +- [Invoke](#lookingglass_invoke) + +## Operations + +- [List](#operations_list) + +## PeerAsns + +- [CreateOrUpdate](#peerasns_createorupdate) +- [Delete](#peerasns_delete) +- [Get](#peerasns_get) +- [List](#peerasns_list) + +## PeeringLocations + +- [List](#peeringlocations_list) + +## PeeringServiceCountries + +- [List](#peeringservicecountries_list) + +## PeeringServiceLocations + +- [List](#peeringservicelocations_list) + +## PeeringServiceProviders + +- [List](#peeringserviceproviders_list) + +## PeeringServices + +- [CreateOrUpdate](#peeringservices_createorupdate) +- [Delete](#peeringservices_delete) +- [GetByResourceGroup](#peeringservices_getbyresourcegroup) +- [InitializeConnectionMonitor](#peeringservices_initializeconnectionmonitor) +- [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 + +- [CreateOrUpdate](#prefixes_createorupdate) +- [Delete](#prefixes_delete) +- [Get](#prefixes_get) +- [ListByPeeringService](#prefixes_listbypeeringservice) + +## ReceivedRoutes + +- [ListByPeering](#receivedroutes_listbypeering) + +## RegisteredAsns + +- [CreateOrUpdate](#registeredasns_createorupdate) +- [Delete](#registeredasns_delete) +- [Get](#registeredasns_get) +- [ListByPeering](#registeredasns_listbypeering) + +## RegisteredPrefixes + +- [CreateOrUpdate](#registeredprefixes_createorupdate) +- [Delete](#registeredprefixes_delete) +- [Get](#registeredprefixes_get) +- [ListByPeering](#registeredprefixes_listbypeering) +- [Validate](#registeredprefixes_validate) + +## ResourceProvider + +- [CheckServiceProviderAvailability](#resourceprovider_checkserviceprovideravailability) +### CdnPeeringPrefixes_List + +```java +import com.azure.core.util.Context; + +/** Samples for CdnPeeringPrefixes List. */ +public final class CdnPeeringPrefixesListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListCdnPeeringPrefixes.json + */ + /** + * Sample code: List all the cdn peering prefixes advertised at a particular peering location. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllTheCdnPeeringPrefixesAdvertisedAtAParticularPeeringLocation( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.cdnPeeringPrefixes().list("peeringLocation0", Context.NONE); + } +} +``` + +### ConnectionMonitorTests_CreateOrUpdate + +```java +/** Samples for ConnectionMonitorTests CreateOrUpdate. */ +public final class ConnectionMonitorTestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/CreateOrUpdateConnectionMonitorTest.json + */ + /** + * Sample code: Create or Update Connection Monitor Test. + * + * @param manager Entry point to PeeringManager. + */ + public static void createOrUpdateConnectionMonitorTest(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .connectionMonitorTests() + .define("connectionMonitorTestName") + .withExistingPeeringService("rgName", "peeringServiceName") + .withSourceAgent("Example Source Agent") + .withDestination("Example Destination") + .withDestinationPort(443) + .withTestFrequencyInSec(30) + .create(); + } +} +``` + +### ConnectionMonitorTests_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitorTests Delete. */ +public final class ConnectionMonitorTestsDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/DeleteConnectionMonitorTest.json + */ + /** + * Sample code: Delete Connection Monitor Test. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteConnectionMonitorTest(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .connectionMonitorTests() + .deleteWithResponse("rgName", "peeringServiceName", "connectionMonitorTestName", Context.NONE); + } +} +``` + +### ConnectionMonitorTests_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitorTests Get. */ +public final class ConnectionMonitorTestsGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/GetConnectionMonitorTest.json + */ + /** + * Sample code: Get Connection Monitor Test. + * + * @param manager Entry point to PeeringManager. + */ + public static void getConnectionMonitorTest(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .connectionMonitorTests() + .getWithResponse("rgName", "peeringServiceName", "connectionMonitorTestName", Context.NONE); + } +} +``` + +### ConnectionMonitorTests_ListByPeeringService + +```java +import com.azure.core.util.Context; + +/** Samples for ConnectionMonitorTests ListByPeeringService. */ +public final class ConnectionMonitorTestsListByPeeringServiceSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListConnectionMonitorTestsByPeeringService.json + */ + /** + * Sample code: List all Connection Monitor Tests associated with the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllConnectionMonitorTestsAssociatedWithThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.connectionMonitorTests().listByPeeringService("rgName", "peeringServiceName", Context.NONE); + } +} +``` + +### LegacyPeerings_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.DirectPeeringType; +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/stable/2022-06-01/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, null, DirectPeeringType.EDGE, Context.NONE); + } +} +``` + +### LookingGlass_Invoke + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.LookingGlassCommand; +import com.azure.resourcemanager.peering.models.LookingGlassSourceType; + +/** Samples for LookingGlass Invoke. */ +public final class LookingGlassInvokeSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/LookingGlassInvokeCommand.json + */ + /** + * Sample code: Call looking glass to execute a command. + * + * @param manager Entry point to PeeringManager. + */ + public static void callLookingGlassToExecuteACommand(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .lookingGlass() + .invokeWithResponse( + LookingGlassCommand.TRACEROUTE, + LookingGlassSourceType.AZURE_REGION, + "West US", + "0.0.0.0", + 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/stable/2022-06-01/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.ContactDetail; +import com.azure.resourcemanager.peering.models.Role; +import java.util.Arrays; + +/** Samples for PeerAsns CreateOrUpdate. */ +public final class PeerAsnsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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("peerAsnName") + .withPeerAsn(65000) + .withPeerContactDetail( + Arrays + .asList( + new ContactDetail() + .withRole(Role.NOC) + .withEmail("noc@contoso.com") + .withPhone("+1 (234) 567-8999"), + new ContactDetail() + .withRole(Role.POLICY) + .withEmail("abc@contoso.com") + .withPhone("+1 (234) 567-8900"), + new ContactDetail() + .withRole(Role.TECHNICAL) + .withEmail("xyz@contoso.com") + .withPhone("+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/stable/2022-06-01/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("peerAsnName", 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/stable/2022-06-01/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("peerAsnName", 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/stable/2022-06-01/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/stable/2022-06-01/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/stable/2022-06-01/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); + } +} +``` + +### PeeringServiceCountries_List + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServiceCountries List. */ +public final class PeeringServiceCountriesListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListPeeringServiceCountriesBySubscription.json + */ + /** + * Sample code: List peering service countries. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServiceCountries(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServiceCountries().list(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/stable/2022-06-01/examples/ListPeeringServiceLocationsBySubscription.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(null, 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/stable/2022-06-01/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/stable/2022-06-01/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("peeringServiceName") + .withRegion("eastus") + .withExistingResourceGroup("rgName") + .withPeeringServiceLocation("state1") + .withPeeringServiceProvider("serviceProvider1") + .withProviderPrimaryPeeringLocation("peeringLocation1") + .withProviderBackupPeeringLocation("peeringLocation2") + .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/stable/2022-06-01/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("rgName", "peeringServiceName", 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/stable/2022-06-01/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("rgName", "peeringServiceName", Context.NONE); + } +} +``` + +### PeeringServices_InitializeConnectionMonitor + +```java +import com.azure.core.util.Context; + +/** Samples for PeeringServices InitializeConnectionMonitor. */ +public final class PeeringServicesInitializeConnectionMonitorSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/InitializeConnectionMonitor.json + */ + /** + * Sample code: Initialize Peering Service for Connection Monitor functionality. + * + * @param manager Entry point to PeeringManager. + */ + public static void initializePeeringServiceForConnectionMonitorFunctionality( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().initializeConnectionMonitorWithResponse(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/stable/2022-06-01/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/stable/2022-06-01/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("rgName", 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/stable/2022-06-01/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("rgName", "peeringServiceName", 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.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/stable/2022-06-01/examples/CreatePeeringWithExchangeRouteServer.json + */ + /** + * Sample code: Create a peering with exchange route server. + * + * @param manager Entry point to PeeringManager. + */ + public static void createAPeeringWithExchangeRouteServer(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peerings() + .define("peeringName") + .withRegion("eastus") + .withExistingResourceGroup("rgName") + .withSku(new PeeringSku().withName("Premium_Direct_Free")) + .withKind(Kind.DIRECT) + .withDirect( + new PeeringPropertiesDirect() + .withConnections( + Arrays + .asList( + new DirectConnection() + .withBandwidthInMbps(10000) + .withSessionAddressProvider(SessionAddressProvider.PEER) + .withUseForPeeringService(true) + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withSessionPrefixV4("192.168.0.0/24") + .withMicrosoftSessionIPv4Address("192.168.0.123") + .withPeerSessionIPv4Address("192.168.0.234") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100)) + .withConnectionIdentifier("5F4CB5C7-6B43-4444-9338-9ABC72606C16"))) + .withPeerAsn( + new SubResource().withId("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1")) + .withDirectPeeringType(DirectPeeringType.IX_RS)) + .withPeeringLocation("peeringLocation0") + .create(); + } + + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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("peeringName") + .withRegion("eastus") + .withExistingResourceGroup("rgName") + .withSku(new PeeringSku().withName("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/stable/2022-06-01/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("peeringName") + .withRegion("eastus") + .withExistingResourceGroup("rgName") + .withSku(new PeeringSku().withName("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) + .withConnectionIdentifier("8AB00818-D533-4504-A25A-03A17F61201C"))) + .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/stable/2022-06-01/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("rgName", "peeringName", 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/stable/2022-06-01/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("rgName", "peeringName", 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/stable/2022-06-01/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/stable/2022-06-01/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("rgName", 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/stable/2022-06-01/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("rgName", "peeringName", 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_CreateOrUpdate + +```java +/** Samples for Prefixes CreateOrUpdate. */ +public final class PrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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 + .prefixes() + .define("peeringServicePrefixName") + .withExistingPeeringService("rgName", "peeringServiceName") + .withPrefix("192.168.1.0/24") + .withPeeringServicePrefixKey("00000000-0000-0000-0000-000000000000") + .create(); + } +} +``` + +### Prefixes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Prefixes Delete. */ +public final class PrefixesDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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.prefixes().deleteWithResponse("rgName", "peeringServiceName", "peeringServicePrefixName", Context.NONE); + } +} +``` + +### Prefixes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Prefixes Get. */ +public final class PrefixesGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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 + .prefixes() + .getWithResponse("rgName", "peeringServiceName", "peeringServicePrefixName", null, Context.NONE); + } +} +``` + +### 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/stable/2022-06-01/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("rgName", "peeringServiceName", null, Context.NONE); + } +} +``` + +### ReceivedRoutes_ListByPeering + +```java +import com.azure.core.util.Context; + +/** Samples for ReceivedRoutes ListByPeering. */ +public final class ReceivedRoutesListByPeeringSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/GetPeeringReceivedRoutes.json + */ + /** + * Sample code: Lists the prefixes received over the specified peering under the given subscription and resource + * group. + * + * @param manager Entry point to PeeringManager. + */ + public static void listsThePrefixesReceivedOverTheSpecifiedPeeringUnderTheGivenSubscriptionAndResourceGroup( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .receivedRoutes() + .listByPeering("rgName", "peeringName", "1.1.1.0/24", "123 456", "Valid", "Valid", null, Context.NONE); + } +} +``` + +### RegisteredAsns_CreateOrUpdate + +```java +/** Samples for RegisteredAsns CreateOrUpdate. */ +public final class RegisteredAsnsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/CreateRegisteredAsn.json + */ + /** + * Sample code: Create or update a registered ASN for the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void createOrUpdateARegisteredASNForThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .registeredAsns() + .define("registeredAsnName") + .withExistingPeering("rgName", "peeringName") + .withAsn(65000) + .create(); + } +} +``` + +### RegisteredAsns_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredAsns Delete. */ +public final class RegisteredAsnsDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/DeleteRegisteredAsn.json + */ + /** + * Sample code: Deletes a registered ASN associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void deletesARegisteredASNAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredAsns().deleteWithResponse("rgName", "peeringName", "registeredAsnName", Context.NONE); + } +} +``` + +### RegisteredAsns_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredAsns Get. */ +public final class RegisteredAsnsGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/GetRegisteredAsn.json + */ + /** + * Sample code: Get a registered ASN associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void getARegisteredASNAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredAsns().getWithResponse("rgName", "peeringName", "registeredAsnName0", Context.NONE); + } +} +``` + +### RegisteredAsns_ListByPeering + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredAsns ListByPeering. */ +public final class RegisteredAsnsListByPeeringSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListRegisteredAsnsByPeering.json + */ + /** + * Sample code: List all the registered ASNs associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllTheRegisteredASNsAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredAsns().listByPeering("rgName", "peeringName", Context.NONE); + } +} +``` + +### RegisteredPrefixes_CreateOrUpdate + +```java +/** Samples for RegisteredPrefixes CreateOrUpdate. */ +public final class RegisteredPrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/CreateRegisteredPrefix.json + */ + /** + * Sample code: Create or update a registered prefix for the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void createOrUpdateARegisteredPrefixForThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .registeredPrefixes() + .define("registeredPrefixName") + .withExistingPeering("rgName", "peeringName") + .withPrefix("10.22.20.0/24") + .create(); + } +} +``` + +### RegisteredPrefixes_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredPrefixes Delete. */ +public final class RegisteredPrefixesDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/DeleteRegisteredPrefix.json + */ + /** + * Sample code: Deletes a registered prefix associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void deletesARegisteredPrefixAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredPrefixes().deleteWithResponse("rgName", "peeringName", "registeredPrefixName", Context.NONE); + } +} +``` + +### RegisteredPrefixes_Get + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredPrefixes Get. */ +public final class RegisteredPrefixesGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/GetRegisteredPrefix.json + */ + /** + * Sample code: Get a registered prefix associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void getARegisteredPrefixAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredPrefixes().getWithResponse("rgName", "peeringName", "registeredPrefixName", Context.NONE); + } +} +``` + +### RegisteredPrefixes_ListByPeering + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredPrefixes ListByPeering. */ +public final class RegisteredPrefixesListByPeeringSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListRegisteredPrefixesByPeering.json + */ + /** + * Sample code: List all the registered prefixes associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllTheRegisteredPrefixesAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredPrefixes().listByPeering("rgName", "peeringName", Context.NONE); + } +} +``` + +### RegisteredPrefixes_Validate + +```java +import com.azure.core.util.Context; + +/** Samples for RegisteredPrefixes Validate. */ +public final class RegisteredPrefixesValidateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ValidateRegisteredPrefix.json + */ + /** + * Sample code: Validate a registered prefix associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void validateARegisteredPrefixAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .registeredPrefixes() + .validateWithResponse("rgName", "peeringName", "registeredPrefixName", 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/stable/2022-06-01/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 6ffcd1c2dffe..dc151f42722e 100644 --- a/sdk/peering/azure-resourcemanager-peering/pom.xml +++ b/sdk/peering/azure-resourcemanager-peering/pom.xml @@ -1,55 +1,55 @@ - 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-2022-06-01. + 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 - - - - com.azure - azure-core - 1.31.0 - - - com.azure - azure-core-management - 1.7.1 - - + + 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 + + + + com.azure + azure-core + 1.31.0 + + + com.azure + azure-core-management + 1.7.1 + + diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/PeeringManager.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/PeeringManager.java index f06d8a6805ce..0a5846863780 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,21 +8,26 @@ 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.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; 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.ConnectionMonitorTestsImpl; import com.azure.resourcemanager.peering.implementation.LegacyPeeringsImpl; +import com.azure.resourcemanager.peering.implementation.LookingGlassImpl; import com.azure.resourcemanager.peering.implementation.OperationsImpl; import com.azure.resourcemanager.peering.implementation.PeerAsnsImpl; import com.azure.resourcemanager.peering.implementation.PeeringLocationsImpl; @@ -38,7 +43,9 @@ 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.ConnectionMonitorTests; import com.azure.resourcemanager.peering.models.LegacyPeerings; +import com.azure.resourcemanager.peering.models.LookingGlass; import com.azure.resourcemanager.peering.models.Operations; import com.azure.resourcemanager.peering.models.PeerAsns; import com.azure.resourcemanager.peering.models.PeeringLocations; @@ -57,6 +64,7 @@ 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 { @@ -66,6 +74,8 @@ public final class PeeringManager { private LegacyPeerings legacyPeerings; + private LookingGlass lookingGlass; + private Operations operations; private PeerAsns peerAsns; @@ -80,6 +90,8 @@ public final class PeeringManager { private ReceivedRoutes receivedRoutes; + private ConnectionMonitorTests connectionMonitorTests; + private PeeringServiceCountries peeringServiceCountries; private PeeringServiceLocations peeringServiceLocations; @@ -117,6 +129,19 @@ public static PeeringManager authenticate(TokenCredential credential, AzureProfi return configure().authenticate(credential, profile); } + /** + * Creates an instance of Peering service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Peering service API instance. + */ + public static PeeringManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new PeeringManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create PeeringManager with optional configuration. * @@ -128,12 +153,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -172,6 +199,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. * @@ -183,6 +221,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -190,9 +241,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -228,20 +281,38 @@ 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); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); 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,7 +324,11 @@ public PeeringManager authenticate(TokenCredential credential, AzureProfile prof } } - /** @return Resource collection API of CdnPeeringPrefixes. */ + /** + * Gets the resource collection API of CdnPeeringPrefixes. + * + * @return Resource collection API of CdnPeeringPrefixes. + */ public CdnPeeringPrefixes cdnPeeringPrefixes() { if (this.cdnPeeringPrefixes == null) { this.cdnPeeringPrefixes = new CdnPeeringPrefixesImpl(clientObject.getCdnPeeringPrefixes(), this); @@ -261,7 +336,11 @@ public CdnPeeringPrefixes cdnPeeringPrefixes() { return cdnPeeringPrefixes; } - /** @return Resource collection API of ResourceProviders. */ + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ public ResourceProviders resourceProviders() { if (this.resourceProviders == null) { this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); @@ -269,7 +348,11 @@ public ResourceProviders resourceProviders() { return resourceProviders; } - /** @return Resource collection API of LegacyPeerings. */ + /** + * Gets the resource collection API of LegacyPeerings. + * + * @return Resource collection API of LegacyPeerings. + */ public LegacyPeerings legacyPeerings() { if (this.legacyPeerings == null) { this.legacyPeerings = new LegacyPeeringsImpl(clientObject.getLegacyPeerings(), this); @@ -277,7 +360,23 @@ public LegacyPeerings legacyPeerings() { return legacyPeerings; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of LookingGlass. + * + * @return Resource collection API of LookingGlass. + */ + public LookingGlass lookingGlass() { + if (this.lookingGlass == null) { + this.lookingGlass = new LookingGlassImpl(clientObject.getLookingGlass(), this); + } + return lookingGlass; + } + + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -285,7 +384,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of PeerAsns. */ + /** + * Gets the resource collection API of PeerAsns. It manages PeerAsn. + * + * @return Resource collection API of PeerAsns. + */ public PeerAsns peerAsns() { if (this.peerAsns == null) { this.peerAsns = new PeerAsnsImpl(clientObject.getPeerAsns(), this); @@ -293,7 +396,11 @@ public PeerAsns peerAsns() { return peerAsns; } - /** @return Resource collection API of PeeringLocations. */ + /** + * Gets the resource collection API of PeeringLocations. + * + * @return Resource collection API of PeeringLocations. + */ public PeeringLocations peeringLocations() { if (this.peeringLocations == null) { this.peeringLocations = new PeeringLocationsImpl(clientObject.getPeeringLocations(), this); @@ -301,7 +408,11 @@ public PeeringLocations peeringLocations() { return peeringLocations; } - /** @return Resource collection API of RegisteredAsns. */ + /** + * Gets the resource collection API of RegisteredAsns. It manages PeeringRegisteredAsn. + * + * @return Resource collection API of RegisteredAsns. + */ public RegisteredAsns registeredAsns() { if (this.registeredAsns == null) { this.registeredAsns = new RegisteredAsnsImpl(clientObject.getRegisteredAsns(), this); @@ -309,7 +420,11 @@ public RegisteredAsns registeredAsns() { return registeredAsns; } - /** @return Resource collection API of RegisteredPrefixes. */ + /** + * Gets the resource collection API of RegisteredPrefixes. It manages PeeringRegisteredPrefix. + * + * @return Resource collection API of RegisteredPrefixes. + */ public RegisteredPrefixes registeredPrefixes() { if (this.registeredPrefixes == null) { this.registeredPrefixes = new RegisteredPrefixesImpl(clientObject.getRegisteredPrefixes(), this); @@ -317,7 +432,11 @@ public RegisteredPrefixes registeredPrefixes() { return registeredPrefixes; } - /** @return Resource collection API of Peerings. */ + /** + * Gets the resource collection API of Peerings. It manages Peering. + * + * @return Resource collection API of Peerings. + */ public Peerings peerings() { if (this.peerings == null) { this.peerings = new PeeringsImpl(clientObject.getPeerings(), this); @@ -325,7 +444,11 @@ public Peerings peerings() { return peerings; } - /** @return Resource collection API of ReceivedRoutes. */ + /** + * Gets the resource collection API of ReceivedRoutes. + * + * @return Resource collection API of ReceivedRoutes. + */ public ReceivedRoutes receivedRoutes() { if (this.receivedRoutes == null) { this.receivedRoutes = new ReceivedRoutesImpl(clientObject.getReceivedRoutes(), this); @@ -333,7 +456,24 @@ public ReceivedRoutes receivedRoutes() { return receivedRoutes; } - /** @return Resource collection API of PeeringServiceCountries. */ + /** + * Gets the resource collection API of ConnectionMonitorTests. It manages ConnectionMonitorTest. + * + * @return Resource collection API of ConnectionMonitorTests. + */ + public ConnectionMonitorTests connectionMonitorTests() { + if (this.connectionMonitorTests == null) { + this.connectionMonitorTests = + new ConnectionMonitorTestsImpl(clientObject.getConnectionMonitorTests(), this); + } + return connectionMonitorTests; + } + + /** + * Gets the resource collection API of PeeringServiceCountries. + * + * @return Resource collection API of PeeringServiceCountries. + */ public PeeringServiceCountries peeringServiceCountries() { if (this.peeringServiceCountries == null) { this.peeringServiceCountries = @@ -342,7 +482,11 @@ public PeeringServiceCountries peeringServiceCountries() { return peeringServiceCountries; } - /** @return Resource collection API of PeeringServiceLocations. */ + /** + * Gets the resource collection API of PeeringServiceLocations. + * + * @return Resource collection API of PeeringServiceLocations. + */ public PeeringServiceLocations peeringServiceLocations() { if (this.peeringServiceLocations == null) { this.peeringServiceLocations = @@ -351,7 +495,11 @@ public PeeringServiceLocations peeringServiceLocations() { return peeringServiceLocations; } - /** @return Resource collection API of Prefixes. */ + /** + * Gets the resource collection API of Prefixes. It manages PeeringServicePrefix. + * + * @return Resource collection API of Prefixes. + */ public Prefixes prefixes() { if (this.prefixes == null) { this.prefixes = new PrefixesImpl(clientObject.getPrefixes(), this); @@ -359,7 +507,11 @@ public Prefixes prefixes() { return prefixes; } - /** @return Resource collection API of PeeringServiceProviders. */ + /** + * Gets the resource collection API of PeeringServiceProviders. + * + * @return Resource collection API of PeeringServiceProviders. + */ public PeeringServiceProviders peeringServiceProviders() { if (this.peeringServiceProviders == null) { this.peeringServiceProviders = @@ -368,7 +520,11 @@ public PeeringServiceProviders peeringServiceProviders() { return peeringServiceProviders; } - /** @return Resource collection API of PeeringServices. */ + /** + * Gets the resource collection API of PeeringServices. It manages PeeringService. + * + * @return Resource collection API of PeeringServices. + */ public PeeringServices peeringServices() { if (this.peeringServices == null) { this.peeringServices = new PeeringServicesImpl(clientObject.getPeeringServices(), this); 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 index 50ed5b9c39aa..045f0b147eac 100644 --- 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 @@ -19,7 +19,7 @@ public interface CdnPeeringPrefixesClient { * @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. + * @return the paginated list of CDN peering prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String peeringLocation); @@ -32,7 +32,7 @@ public interface CdnPeeringPrefixesClient { * @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. + * @return the paginated list of CDN peering prefixes as paginated response with {@link PagedIterable}. */ @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/ConnectionMonitorTestsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ConnectionMonitorTestsClient.java new file mode 100644 index 000000000000..81a2a6da4ed2 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ConnectionMonitorTestsClient.java @@ -0,0 +1,151 @@ +// 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.ConnectionMonitorTestInner; + +/** An instance of this class provides access to all the operations defined in ConnectionMonitorTestsClient. */ +public interface ConnectionMonitorTestsClient { + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorTestInner get( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName); + + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, Context context); + + /** + * Creates or updates a connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @param connectionMonitorTest The properties needed to create a connection monitor test. + * @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 Connection Monitor Test class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ConnectionMonitorTestInner createOrUpdate( + String resourceGroupName, + String peeringServiceName, + String connectionMonitorTestName, + ConnectionMonitorTestInner connectionMonitorTest); + + /** + * Creates or updates a connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @param connectionMonitorTest The properties needed to create a connection monitor test. + * @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 Connection Monitor Test class along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String peeringServiceName, + String connectionMonitorTestName, + ConnectionMonitorTestInner connectionMonitorTest, + Context context); + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connectionMonitorTestName); + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, Context context); + + /** + * Lists all connection monitor tests 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 [T] as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPeeringService(String resourceGroupName, String peeringServiceName); + + /** + * Lists all connection monitor tests 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 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 [T] as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByPeeringService( + String resourceGroupName, String peeringServiceName, Context context); +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LegacyPeeringsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LegacyPeeringsClient.java index c8cba0bec65e..ae695d637097 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 @@ -9,6 +9,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeeringInner; +import com.azure.resourcemanager.peering.models.DirectPeeringType; import com.azure.resourcemanager.peering.models.LegacyPeeringsKind; /** An instance of this class provides access to all the operations defined in LegacyPeeringsClient. */ @@ -21,7 +22,7 @@ public interface LegacyPeeringsClient { * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String peeringLocation, LegacyPeeringsKind kind); @@ -32,12 +33,18 @@ 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 directPeeringType The direct peering type. * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context); + PagedIterable list( + String peeringLocation, + LegacyPeeringsKind kind, + Integer asn, + DirectPeeringType directPeeringType, + Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LookingGlassClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LookingGlassClient.java new file mode 100644 index 000000000000..b7c5817b6f8d --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/LookingGlassClient.java @@ -0,0 +1,53 @@ +// 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.LookingGlassOutputInner; +import com.azure.resourcemanager.peering.models.LookingGlassCommand; +import com.azure.resourcemanager.peering.models.LookingGlassSourceType; + +/** An instance of this class provides access to all the operations defined in LookingGlassClient. */ +public interface LookingGlassClient { + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + LookingGlassOutputInner invoke( + LookingGlassCommand command, LookingGlassSourceType sourceType, String sourceLocation, String destinationIp); + + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response invokeWithResponse( + LookingGlassCommand command, + LookingGlassSourceType sourceType, + String sourceLocation, + String destinationIp, + Context context); +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/OperationsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/OperationsClient.java index acbe3f579e2a..e69cae9260cd 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/OperationsClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @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 API operations. + * @return the paginated list of peering API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @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 API operations. + * @return the paginated list of peering API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeerAsnsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeerAsnsClient.java index 6f3505ddf197..10f169febaa0 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeerAsnsClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeerAsnsClient.java @@ -33,7 +33,7 @@ public interface PeerAsnsClient { * @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 peer ASN with the specified name under the given subscription. + * @return the peer ASN with the specified name under the given subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String peerAsnName, Context context); @@ -60,7 +60,7 @@ public interface PeerAsnsClient { * @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 essential information related to the peer's ASN. + * @return the essential information related to the peer's ASN along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse(String peerAsnName, PeerAsnInner peerAsn, Context context); @@ -84,7 +84,7 @@ public interface PeerAsnsClient { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String peerAsnName, Context context); @@ -94,7 +94,7 @@ public interface PeerAsnsClient { * * @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 peer ASNs. + * @return the paginated list of peer ASNs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -106,7 +106,7 @@ public interface PeerAsnsClient { * @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 peer ASNs. + * @return the paginated list of peer ASNs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringLocationsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringLocationsClient.java index 0b3945229967..1074168096f9 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringLocationsClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringLocationsClient.java @@ -21,7 +21,7 @@ public interface PeeringLocationsClient { * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(PeeringLocationsKind kind); @@ -35,7 +35,7 @@ public interface PeeringLocationsClient { * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringManagementClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringManagementClient.java index 70c527cbb0ea..9ca7ac56eb58 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 @@ -65,6 +65,13 @@ public interface PeeringManagementClient { */ LegacyPeeringsClient getLegacyPeerings(); + /** + * Gets the LookingGlassClient object to access its operations. + * + * @return the LookingGlassClient object. + */ + LookingGlassClient getLookingGlass(); + /** * Gets the OperationsClient object to access its operations. * @@ -114,6 +121,13 @@ public interface PeeringManagementClient { */ ReceivedRoutesClient getReceivedRoutes(); + /** + * Gets the ConnectionMonitorTestsClient object to access its operations. + * + * @return the ConnectionMonitorTestsClient object. + */ + ConnectionMonitorTestsClient getConnectionMonitorTests(); + /** * Gets the PeeringServiceCountriesClient 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 index 83b9d54e207f..d9cecf1bf1a4 100644 --- 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 @@ -17,7 +17,7 @@ public interface PeeringServiceCountriesClient { * * @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. + * @return the paginated list of peering service countries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface PeeringServiceCountriesClient { * @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. + * @return the paginated list of peering service countries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceLocationsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceLocationsClient.java index 69f837fdd14c..6844fec70db8 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 @@ -17,7 +17,7 @@ public interface PeeringServiceLocationsClient { * * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -30,7 +30,7 @@ public interface PeeringServiceLocationsClient { * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String country, Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceProvidersClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceProvidersClient.java index f09e1f33e5c6..4da6a9dfa200 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceProvidersClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServiceProvidersClient.java @@ -17,7 +17,7 @@ public interface PeeringServiceProvidersClient { * * @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 providers. + * @return the paginated list of peering service providers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface PeeringServiceProvidersClient { * @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 providers. + * @return the paginated list of peering service providers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServicesClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServicesClient.java index cbbd7b3280ef..17517207adf6 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServicesClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringServicesClient.java @@ -36,7 +36,8 @@ public interface PeeringServicesClient { * @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 peering service with the specified name under the given subscription and resource group. + * @return an existing peering service with the specified name under the given subscription and resource group along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -69,7 +70,7 @@ PeeringServiceInner createOrUpdate( * @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 peering Service. + * @return peering Service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -96,7 +97,7 @@ Response createOrUpdateWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String peeringServiceName, Context context); @@ -125,7 +126,7 @@ Response createOrUpdateWithResponse( * @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 peering Service. + * @return peering Service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -138,7 +139,7 @@ Response updateWithResponse( * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -151,7 +152,7 @@ Response updateWithResponse( * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -161,7 +162,7 @@ Response updateWithResponse( * * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -173,8 +174,29 @@ Response updateWithResponse( * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); + + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 initializeConnectionMonitor(); + + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response initializeConnectionMonitorWithResponse(Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringsClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringsClient.java index 4813e219c504..a1ffa656c9c3 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringsClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PeeringsClient.java @@ -36,7 +36,8 @@ public interface PeeringsClient { * @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 peering with the specified name under the given subscription and resource group. + * @return an existing peering with the specified name under the given subscription and resource group along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -68,7 +69,8 @@ Response getByResourceGroupWithResponse( * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -95,7 +97,7 @@ Response createOrUpdateWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String peeringName, Context context); @@ -124,7 +126,8 @@ Response createOrUpdateWithResponse( * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -137,7 +140,7 @@ Response updateWithResponse( * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -150,7 +153,7 @@ Response updateWithResponse( * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -160,7 +163,7 @@ Response updateWithResponse( * * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -172,7 +175,7 @@ Response updateWithResponse( * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PrefixesClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/PrefixesClient.java index ab6755d21576..749ec302d1ed 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 @@ -40,7 +40,7 @@ public interface PrefixesClient { * @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. + * service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -76,7 +76,7 @@ PeeringServicePrefixInner createOrUpdate( * @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. + * @return the peering service prefix class along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -111,7 +111,7 @@ Response createOrUpdateWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -125,7 +125,7 @@ Response deleteWithResponse( * @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 peering service prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeeringService(String resourceGroupName, String peeringServiceName); @@ -140,7 +140,7 @@ Response deleteWithResponse( * @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 peering service prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeeringService( 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 index 028c632042c3..f507c47c70bd 100644 --- 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 @@ -20,7 +20,7 @@ public interface ReceivedRoutesClient { * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeering(String resourceGroupName, String peeringName); @@ -39,7 +39,7 @@ public interface ReceivedRoutesClient { * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeering( 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 index 36c7448d7392..2d56aeaa2bad 100644 --- 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 @@ -39,7 +39,7 @@ public interface RegisteredAsnsClient { * @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. + * peering along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -75,7 +75,7 @@ PeeringRegisteredAsnInner createOrUpdate( * @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. + * @return the customer's ASN that is registered by the peering service provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -110,7 +110,7 @@ Response createOrUpdateWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -124,7 +124,7 @@ Response deleteWithResponse( * @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. + * @return the paginated list of peering registered ASNs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeering(String resourceGroupName, String peeringName); @@ -138,7 +138,7 @@ Response deleteWithResponse( * @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. + * @return the paginated list of peering registered ASNs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeering( 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 index fb587e31173e..943576dfb376 100644 --- 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 @@ -41,7 +41,7 @@ public interface RegisteredPrefixesClient { * @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. + * peering along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -77,7 +77,7 @@ PeeringRegisteredPrefixInner createOrUpdate( * @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. + * @return the customer's prefix that is registered by the peering service provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -112,7 +112,7 @@ Response createOrUpdateWithResponse( * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -126,7 +126,7 @@ Response deleteWithResponse( * @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. + * @return the paginated list of peering registered prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeering(String resourceGroupName, String peeringName); @@ -140,9 +140,41 @@ Response deleteWithResponse( * @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. + * @return the paginated list of peering registered prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByPeering( String resourceGroupName, String peeringName, Context context); + + /** + * Validates 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 the customer's prefix that is registered by the peering service provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PeeringRegisteredPrefixInner validate(String resourceGroupName, String peeringName, String registeredPrefixName); + + /** + * Validates 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 customer's prefix that is registered by the peering service provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse( + String resourceGroupName, String peeringName, String registeredPrefixName, Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ResourceProvidersClient.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ResourceProvidersClient.java index 1cc121969cb8..fc02ab941667 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ResourceProvidersClient.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/ResourceProvidersClient.java @@ -35,7 +35,7 @@ public interface ResourceProvidersClient { * @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. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkServiceProviderAvailabilityWithResponse( 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 index aae2b0bb7dc9..ee0a6f2902d9 100644 --- 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 @@ -4,48 +4,27 @@ package com.azure.resourcemanager.peering.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; 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; - +@Fluent +public final class CdnPeeringPrefixInner extends ProxyResource { /* - * The Azure service. + * The properties that define a cdn peering prefix. */ - @JsonProperty(value = "properties.azureService", access = JsonProperty.Access.WRITE_ONLY) - private String azureService; + @JsonProperty(value = "properties") + private CdnPeeringPrefixProperties innerProperties; - /* - * 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 + /** + * Get the innerProperties property: The properties that define a cdn peering prefix. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.bgpCommunity", access = JsonProperty.Access.WRITE_ONLY) - private String bgpCommunity; + private CdnPeeringPrefixProperties innerProperties() { + return this.innerProperties; + } /** * Get the prefix property: The prefix. @@ -53,7 +32,7 @@ public class CdnPeeringPrefixInner extends ProxyResource { * @return the prefix value. */ public String prefix() { - return this.prefix; + return this.innerProperties() == null ? null : this.innerProperties().prefix(); } /** @@ -62,7 +41,7 @@ public String prefix() { * @return the azureRegion value. */ public String azureRegion() { - return this.azureRegion; + return this.innerProperties() == null ? null : this.innerProperties().azureRegion(); } /** @@ -71,7 +50,7 @@ public String azureRegion() { * @return the azureService value. */ public String azureService() { - return this.azureService; + return this.innerProperties() == null ? null : this.innerProperties().azureService(); } /** @@ -80,7 +59,7 @@ public String azureService() { * @return the isPrimaryRegion value. */ public Boolean isPrimaryRegion() { - return this.isPrimaryRegion; + return this.innerProperties() == null ? null : this.innerProperties().isPrimaryRegion(); } /** @@ -89,7 +68,7 @@ public Boolean isPrimaryRegion() { * @return the bgpCommunity value. */ public String bgpCommunity() { - return this.bgpCommunity; + return this.innerProperties() == null ? null : this.innerProperties().bgpCommunity(); } /** @@ -98,5 +77,8 @@ public String bgpCommunity() { * @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/CdnPeeringPrefixProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/CdnPeeringPrefixProperties.java new file mode 100644 index 000000000000..c01d05654bcd --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/CdnPeeringPrefixProperties.java @@ -0,0 +1,95 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define a CDN peering prefix. */ +@Immutable +public final class CdnPeeringPrefixProperties { + /* + * The prefix. + */ + @JsonProperty(value = "prefix", access = JsonProperty.Access.WRITE_ONLY) + private String prefix; + + /* + * The Azure region. + */ + @JsonProperty(value = "azureRegion", access = JsonProperty.Access.WRITE_ONLY) + private String azureRegion; + + /* + * The Azure service. + */ + @JsonProperty(value = "azureService", access = JsonProperty.Access.WRITE_ONLY) + private String azureService; + + /* + * The flag that indicates whether or not this is the primary region. + */ + @JsonProperty(value = "isPrimaryRegion", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isPrimaryRegion; + + /* + * The BGP Community + */ + @JsonProperty(value = "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/ConnectionMonitorTestInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/ConnectionMonitorTestInner.java new file mode 100644 index 000000000000..c4e2dd18158c --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/ConnectionMonitorTestInner.java @@ -0,0 +1,160 @@ +// 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.management.ProxyResource; +import com.azure.resourcemanager.peering.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The Connection Monitor Test class. */ +@Fluent +public final class ConnectionMonitorTestInner extends ProxyResource { + /* + * The properties that define a Connection Monitor Test. + */ + @JsonProperty(value = "properties") + private ConnectionMonitorTestProperties innerProperties; + + /** + * Get the innerProperties property: The properties that define a Connection Monitor Test. + * + * @return the innerProperties value. + */ + private ConnectionMonitorTestProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the sourceAgent property: The Connection Monitor test source agent. + * + * @return the sourceAgent value. + */ + public String sourceAgent() { + return this.innerProperties() == null ? null : this.innerProperties().sourceAgent(); + } + + /** + * Set the sourceAgent property: The Connection Monitor test source agent. + * + * @param sourceAgent the sourceAgent value to set. + * @return the ConnectionMonitorTestInner object itself. + */ + public ConnectionMonitorTestInner withSourceAgent(String sourceAgent) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorTestProperties(); + } + this.innerProperties().withSourceAgent(sourceAgent); + return this; + } + + /** + * Get the destination property: The Connection Monitor test destination. + * + * @return the destination value. + */ + public String destination() { + return this.innerProperties() == null ? null : this.innerProperties().destination(); + } + + /** + * Set the destination property: The Connection Monitor test destination. + * + * @param destination the destination value to set. + * @return the ConnectionMonitorTestInner object itself. + */ + public ConnectionMonitorTestInner withDestination(String destination) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorTestProperties(); + } + this.innerProperties().withDestination(destination); + return this; + } + + /** + * Get the destinationPort property: The Connection Monitor test destination port. + * + * @return the destinationPort value. + */ + public Integer destinationPort() { + return this.innerProperties() == null ? null : this.innerProperties().destinationPort(); + } + + /** + * Set the destinationPort property: The Connection Monitor test destination port. + * + * @param destinationPort the destinationPort value to set. + * @return the ConnectionMonitorTestInner object itself. + */ + public ConnectionMonitorTestInner withDestinationPort(Integer destinationPort) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorTestProperties(); + } + this.innerProperties().withDestinationPort(destinationPort); + return this; + } + + /** + * Get the testFrequencyInSec property: The Connection Monitor test frequency in seconds. + * + * @return the testFrequencyInSec value. + */ + public Integer testFrequencyInSec() { + return this.innerProperties() == null ? null : this.innerProperties().testFrequencyInSec(); + } + + /** + * Set the testFrequencyInSec property: The Connection Monitor test frequency in seconds. + * + * @param testFrequencyInSec the testFrequencyInSec value to set. + * @return the ConnectionMonitorTestInner object itself. + */ + public ConnectionMonitorTestInner withTestFrequencyInSec(Integer testFrequencyInSec) { + if (this.innerProperties() == null) { + this.innerProperties = new ConnectionMonitorTestProperties(); + } + this.innerProperties().withTestFrequencyInSec(testFrequencyInSec); + return this; + } + + /** + * Get the isTestSuccessful property: The flag that indicates if the Connection Monitor test is successful or not. + * + * @return the isTestSuccessful value. + */ + public Boolean isTestSuccessful() { + return this.innerProperties() == null ? null : this.innerProperties().isTestSuccessful(); + } + + /** + * Get the path property: The path representing the Connection Monitor test. + * + * @return the path value. + */ + public List path() { + return this.innerProperties() == null ? null : this.innerProperties().path(); + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @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/ConnectionMonitorTestProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/ConnectionMonitorTestProperties.java new file mode 100644 index 000000000000..dda082583ded --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/ConnectionMonitorTestProperties.java @@ -0,0 +1,171 @@ +// 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.resourcemanager.peering.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties that define a Connection Monitor Test. */ +@Fluent +public final class ConnectionMonitorTestProperties { + /* + * The Connection Monitor test source agent + */ + @JsonProperty(value = "sourceAgent") + private String sourceAgent; + + /* + * The Connection Monitor test destination + */ + @JsonProperty(value = "destination") + private String destination; + + /* + * The Connection Monitor test destination port + */ + @JsonProperty(value = "destinationPort") + private Integer destinationPort; + + /* + * The Connection Monitor test frequency in seconds + */ + @JsonProperty(value = "testFrequencyInSec") + private Integer testFrequencyInSec; + + /* + * The flag that indicates if the Connection Monitor test is successful or not. + */ + @JsonProperty(value = "isTestSuccessful", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isTestSuccessful; + + /* + * The path representing the Connection Monitor test. + */ + @JsonProperty(value = "path", access = JsonProperty.Access.WRITE_ONLY) + private List path; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the sourceAgent property: The Connection Monitor test source agent. + * + * @return the sourceAgent value. + */ + public String sourceAgent() { + return this.sourceAgent; + } + + /** + * Set the sourceAgent property: The Connection Monitor test source agent. + * + * @param sourceAgent the sourceAgent value to set. + * @return the ConnectionMonitorTestProperties object itself. + */ + public ConnectionMonitorTestProperties withSourceAgent(String sourceAgent) { + this.sourceAgent = sourceAgent; + return this; + } + + /** + * Get the destination property: The Connection Monitor test destination. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: The Connection Monitor test destination. + * + * @param destination the destination value to set. + * @return the ConnectionMonitorTestProperties object itself. + */ + public ConnectionMonitorTestProperties withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the destinationPort property: The Connection Monitor test destination port. + * + * @return the destinationPort value. + */ + public Integer destinationPort() { + return this.destinationPort; + } + + /** + * Set the destinationPort property: The Connection Monitor test destination port. + * + * @param destinationPort the destinationPort value to set. + * @return the ConnectionMonitorTestProperties object itself. + */ + public ConnectionMonitorTestProperties withDestinationPort(Integer destinationPort) { + this.destinationPort = destinationPort; + return this; + } + + /** + * Get the testFrequencyInSec property: The Connection Monitor test frequency in seconds. + * + * @return the testFrequencyInSec value. + */ + public Integer testFrequencyInSec() { + return this.testFrequencyInSec; + } + + /** + * Set the testFrequencyInSec property: The Connection Monitor test frequency in seconds. + * + * @param testFrequencyInSec the testFrequencyInSec value to set. + * @return the ConnectionMonitorTestProperties object itself. + */ + public ConnectionMonitorTestProperties withTestFrequencyInSec(Integer testFrequencyInSec) { + this.testFrequencyInSec = testFrequencyInSec; + return this; + } + + /** + * Get the isTestSuccessful property: The flag that indicates if the Connection Monitor test is successful or not. + * + * @return the isTestSuccessful value. + */ + public Boolean isTestSuccessful() { + return this.isTestSuccessful; + } + + /** + * Get the path property: The path representing the Connection Monitor test. + * + * @return the path value. + */ + public List path() { + return this.path; + } + + /** + * 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/LookingGlassOutputInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/LookingGlassOutputInner.java new file mode 100644 index 000000000000..0cac3e8680a6 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/LookingGlassOutputInner.java @@ -0,0 +1,73 @@ +// 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.resourcemanager.peering.models.Command; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Looking glass output model. */ +@Fluent +public final class LookingGlassOutputInner { + /* + * Invoked command + */ + @JsonProperty(value = "command") + private Command command; + + /* + * Output of the command + */ + @JsonProperty(value = "output") + private String output; + + /** + * Get the command property: Invoked command. + * + * @return the command value. + */ + public Command command() { + return this.command; + } + + /** + * Set the command property: Invoked command. + * + * @param command the command value to set. + * @return the LookingGlassOutputInner object itself. + */ + public LookingGlassOutputInner withCommand(Command command) { + this.command = command; + return this; + } + + /** + * Get the output property: Output of the command. + * + * @return the output value. + */ + public String output() { + return this.output; + } + + /** + * Set the output property: Output of the command. + * + * @param output the output value to set. + * @return the LookingGlassOutputInner object itself. + */ + public LookingGlassOutputInner withOutput(String output) { + this.output = output; + 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/OperationInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/OperationInner.java index 5fad8f5a39bb..89805509caff 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/OperationInner.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/OperationInner.java @@ -5,16 +5,13 @@ package com.azure.resourcemanager.peering.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.peering.models.OperationDisplayInfo; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.peering.models.ServiceSpecification; import com.fasterxml.jackson.annotation.JsonProperty; /** The peering API operation. */ @Immutable public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * The name of the operation. */ @@ -33,6 +30,12 @@ public final class OperationInner { @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; + /* + * The properties of the operation. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private OperationProperties innerProperties; + /** * Get the name property: The name of the operation. * @@ -60,6 +63,24 @@ public Boolean isDataAction() { return this.isDataAction; } + /** + * Get the innerProperties property: The properties of the operation. + * + * @return the innerProperties value. + */ + private OperationProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the serviceSpecification property: Service specification payload. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.innerProperties() == null ? null : this.innerProperties().serviceSpecification(); + } + /** * Validates the instance. * @@ -69,5 +90,8 @@ public void validate() { if (display() != null) { display().validate(); } + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/OperationProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/OperationProperties.java new file mode 100644 index 000000000000..2139b1d5cf84 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/OperationProperties.java @@ -0,0 +1,39 @@ +// 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.resourcemanager.peering.models.ServiceSpecification; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the operation. */ +@Immutable +public final class OperationProperties { + /* + * Service specification payload. + */ + @JsonProperty(value = "serviceSpecification", access = JsonProperty.Access.WRITE_ONLY) + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: Service specification payload. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnInner.java index 562bcd708fd0..c93d7ecd46f3 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,29 @@ 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.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 { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerAsnInner.class); - - /* - * The Autonomous System Number (ASN) of the peer. - */ - @JsonProperty(value = "properties.peerAsn") - private Integer peerAsn; - - /* - * 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; - +public final class PeerAsnInner extends ProxyResource { /* - * The validation state of the ASN associated with the peer. + * The properties that define a peer's ASN. */ - @JsonProperty(value = "properties.validationState") - private ValidationState validationState; + @JsonProperty(value = "properties") + private PeerAsnProperties innerProperties; - /* - * 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 +35,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,7 +45,10 @@ 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; } @@ -76,7 +58,7 @@ public PeerAsnInner withPeerAsn(Integer peerAsn) { * @return the peerContactDetail value. */ public List peerContactDetail() { - return this.peerContactDetail; + return this.innerProperties() == null ? null : this.innerProperties().peerContactDetail(); } /** @@ -86,7 +68,10 @@ public List peerContactDetail() { * @return the PeerAsnInner object itself. */ public PeerAsnInner withPeerContactDetail(List peerContactDetail) { - this.peerContactDetail = peerContactDetail; + if (this.innerProperties() == null) { + this.innerProperties = new PeerAsnProperties(); + } + this.innerProperties().withPeerContactDetail(peerContactDetail); return this; } @@ -96,7 +81,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 +91,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,18 +104,7 @@ public PeerAsnInner withPeerName(String peerName) { * @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 PeerAsnInner object itself. - */ - public PeerAsnInner withValidationState(ValidationState validationState) { - this.validationState = validationState; - return this; + return this.innerProperties() == null ? null : this.innerProperties().validationState(); } /** @@ -136,7 +113,7 @@ public PeerAsnInner withValidationState(ValidationState validationState) { * @return the errorMessage value. */ public String errorMessage() { - return this.errorMessage; + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); } /** @@ -145,8 +122,8 @@ public String errorMessage() { * @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 000000000000..be1788b57331 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeerAsnProperties.java @@ -0,0 +1,134 @@ +// 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.resourcemanager.peering.models.ContactDetail; +import com.azure.resourcemanager.peering.models.ValidationState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties that define a peer's ASN. */ +@Fluent +public final class PeerAsnProperties { + /* + * The Autonomous System Number (ASN) of the peer. + */ + @JsonProperty(value = "peerAsn") + private Integer peerAsn; + + /* + * The contact details of the peer. + */ + @JsonProperty(value = "peerContactDetail") + private List peerContactDetail; + + /* + * The name of the peer. + */ + @JsonProperty(value = "peerName") + private String peerName; + + /* + * The validation state of the ASN associated with the peer. + */ + @JsonProperty(value = "validationState", access = JsonProperty.Access.WRITE_ONLY) + private ValidationState validationState; + + /* + * The error message for the validation state + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /** + * 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 peerContactDetail property: The contact details of the peer. + * + * @return the peerContactDetail value. + */ + public List peerContactDetail() { + return this.peerContactDetail; + } + + /** + * Set the peerContactDetail property: The contact details of the peer. + * + * @param peerContactDetail the peerContactDetail value to set. + * @return the PeerAsnProperties object itself. + */ + public PeerAsnProperties withPeerContactDetail(List peerContactDetail) { + this.peerContactDetail = peerContactDetail; + 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; + } + + /** + * 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()); + } + } +} 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 0298b3c574ec..9a29e956c025 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; @@ -13,16 +12,13 @@ import com.azure.resourcemanager.peering.models.PeeringPropertiesExchange; 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 { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringInner.class); - +public final class PeeringInner extends ProxyResource { /* * The SKU that defines the tier and kind of the peering. */ @@ -35,6 +31,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 +47,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 +90,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 +145,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 +155,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 +168,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 +178,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 +191,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 +201,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 +214,7 @@ public PeeringInner withPeeringLocation(String peeringLocation) { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -227,27 +224,26 @@ public ProvisioningState provisioningState() { */ public void validate() { if (sku() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property sku in model PeeringInner")); } else { sku().validate(); } if (kind() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property kind in model PeeringInner")); } + if (innerProperties() != null) { + innerProperties().validate(); + } if (location() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property location in model PeeringInner")); } - if (direct() != null) { - direct().validate(); - } - if (exchange() != null) { - exchange().validate(); - } } + + private static final ClientLogger LOGGER = new ClientLogger(PeeringInner.class); } 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 66d1113e700a..bbffe96cb5e1 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,21 +5,15 @@ 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; 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; /** Peering location is where connectivity could be established to the Microsoft Cloud Edge. */ -@JsonFlatten @Fluent -public class PeeringLocationInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringLocationInner.class); - +public final class PeeringLocationInner extends ProxyResource { /* * The kind of peering that the peering location supports. */ @@ -27,34 +21,10 @@ public class PeeringLocationInner extends ProxyResource { private Kind kind; /* - * The properties that define a direct 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. + * The properties that define a 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 +46,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 +71,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 +84,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 +94,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 +107,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 +117,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 +130,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 +140,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 +153,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 +163,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 +176,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 000000000000..359b93af9148 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringLocationProperties.java @@ -0,0 +1,158 @@ +// 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.resourcemanager.peering.models.PeeringLocationPropertiesDirect; +import com.azure.resourcemanager.peering.models.PeeringLocationPropertiesExchange; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define a peering location. */ +@Fluent +public final class PeeringLocationProperties { + /* + * 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 000000000000..e361eaaf51f9 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringProperties.java @@ -0,0 +1,122 @@ +// 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.resourcemanager.peering.models.PeeringPropertiesDirect; +import com.azure.resourcemanager.peering.models.PeeringPropertiesExchange; +import com.azure.resourcemanager.peering.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define connectivity to the Microsoft Cloud Edge. */ +@Fluent +public final class PeeringProperties { + /* + * 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 index ce5d8d729f52..dcd0200288c7 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ @@ -39,15 +35,13 @@ public final class PeeringReceivedRouteInner { private String originAsValidationState; /* - * The RPKI validation state for the prefix and origin AS that's listed in - * the AS path. + * 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. + * 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; 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 index 5c842bd1c148..239c47b97e8e 100644 --- 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 @@ -5,36 +5,27 @@ 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; - +public final class PeeringRegisteredAsnInner extends ProxyResource { /* - * The peering service prefix key that is to be shared with the customer. + * The properties that define a registered ASN. */ - @JsonProperty(value = "properties.peeringServicePrefixKey", access = JsonProperty.Access.WRITE_ONLY) - private String peeringServicePrefixKey; + @JsonProperty(value = "properties") + private PeeringRegisteredAsnProperties innerProperties; - /* - * The provisioning state of the resource. + /** + * Get the innerProperties property: The properties that define a registered ASN. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; + private PeeringRegisteredAsnProperties innerProperties() { + return this.innerProperties; + } /** * Get the asn property: The customer's ASN from which traffic originates. @@ -42,7 +33,7 @@ public class PeeringRegisteredAsnInner extends ProxyResource { * @return the asn value. */ public Integer asn() { - return this.asn; + return this.innerProperties() == null ? null : this.innerProperties().asn(); } /** @@ -52,7 +43,10 @@ public Integer asn() { * @return the PeeringRegisteredAsnInner object itself. */ public PeeringRegisteredAsnInner withAsn(Integer asn) { - this.asn = asn; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringRegisteredAsnProperties(); + } + this.innerProperties().withAsn(asn); return this; } @@ -62,7 +56,7 @@ public PeeringRegisteredAsnInner withAsn(Integer asn) { * @return the peeringServicePrefixKey value. */ public String peeringServicePrefixKey() { - return this.peeringServicePrefixKey; + return this.innerProperties() == null ? null : this.innerProperties().peeringServicePrefixKey(); } /** @@ -71,7 +65,7 @@ public String peeringServicePrefixKey() { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -80,5 +74,8 @@ public ProvisioningState provisioningState() { * @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/PeeringRegisteredAsnProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredAsnProperties.java new file mode 100644 index 000000000000..5d1d9aff30c2 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredAsnProperties.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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.peering.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define a registered ASN. */ +@Fluent +public final class PeeringRegisteredAsnProperties { + /* + * The customer's ASN from which traffic originates. + */ + @JsonProperty(value = "asn") + private Integer asn; + + /* + * The peering service prefix key that is to be shared with the customer. + */ + @JsonProperty(value = "peeringServicePrefixKey", access = JsonProperty.Access.WRITE_ONLY) + private String peeringServicePrefixKey; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "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 PeeringRegisteredAsnProperties object itself. + */ + public PeeringRegisteredAsnProperties withAsn(Integer asn) { + this.asn = asn; + return this; + } + + /** + * Get the peeringServicePrefixKey property: The peering service prefix key that is to be shared with the customer. + * + * @return the peeringServicePrefixKey value. + */ + public String peeringServicePrefixKey() { + return this.peeringServicePrefixKey; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixInner.java index 0be2d0ffa58c..3813491b1316 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/PeeringRegisteredPrefixInner.java @@ -5,49 +5,28 @@ package com.azure.resourcemanager.peering.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.peering.models.PrefixValidationState; import com.azure.resourcemanager.peering.models.ProvisioningState; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The customer's prefix that is registered by the peering service provider. */ -@JsonFlatten @Fluent -public class PeeringRegisteredPrefixInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringRegisteredPrefixInner.class); - - /* - * The customer's prefix from which traffic originates. - */ - @JsonProperty(value = "properties.prefix") - private String prefix; - - /* - * The prefix validation state. - */ - @JsonProperty(value = "properties.prefixValidationState", access = JsonProperty.Access.WRITE_ONLY) - private PrefixValidationState prefixValidationState; - +public final class PeeringRegisteredPrefixInner extends ProxyResource { /* - * The peering service prefix key that is to be shared with the customer. + * The properties that define a registered prefix. */ - @JsonProperty(value = "properties.peeringServicePrefixKey", access = JsonProperty.Access.WRITE_ONLY) - private String peeringServicePrefixKey; + @JsonProperty(value = "properties") + private PeeringRegisteredPrefixProperties innerProperties; - /* - * The error message associated with the validation state, if any. - */ - @JsonProperty(value = "properties.errorMessage", access = JsonProperty.Access.WRITE_ONLY) - private String errorMessage; - - /* - * The provisioning state of the resource. + /** + * Get the innerProperties property: The properties that define a registered prefix. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; + private PeeringRegisteredPrefixProperties innerProperties() { + return this.innerProperties; + } /** * Get the prefix property: The customer's prefix from which traffic originates. @@ -55,7 +34,7 @@ public class PeeringRegisteredPrefixInner extends ProxyResource { * @return the prefix value. */ public String prefix() { - return this.prefix; + return this.innerProperties() == null ? null : this.innerProperties().prefix(); } /** @@ -65,7 +44,10 @@ public String prefix() { * @return the PeeringRegisteredPrefixInner object itself. */ public PeeringRegisteredPrefixInner withPrefix(String prefix) { - this.prefix = prefix; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringRegisteredPrefixProperties(); + } + this.innerProperties().withPrefix(prefix); return this; } @@ -75,7 +57,7 @@ public PeeringRegisteredPrefixInner withPrefix(String prefix) { * @return the prefixValidationState value. */ public PrefixValidationState prefixValidationState() { - return this.prefixValidationState; + return this.innerProperties() == null ? null : this.innerProperties().prefixValidationState(); } /** @@ -84,7 +66,7 @@ public PrefixValidationState prefixValidationState() { * @return the peeringServicePrefixKey value. */ public String peeringServicePrefixKey() { - return this.peeringServicePrefixKey; + return this.innerProperties() == null ? null : this.innerProperties().peeringServicePrefixKey(); } /** @@ -93,7 +75,7 @@ public String peeringServicePrefixKey() { * @return the errorMessage value. */ public String errorMessage() { - return this.errorMessage; + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); } /** @@ -102,7 +84,7 @@ public String errorMessage() { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -111,5 +93,8 @@ public ProvisioningState provisioningState() { * @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/PeeringRegisteredPrefixProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixProperties.java new file mode 100644 index 000000000000..b7da1f59d2d6 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringRegisteredPrefixProperties.java @@ -0,0 +1,108 @@ +// 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.resourcemanager.peering.models.PrefixValidationState; +import com.azure.resourcemanager.peering.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define a registered prefix. */ +@Fluent +public final class PeeringRegisteredPrefixProperties { + /* + * The customer's prefix from which traffic originates. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /* + * The prefix validation state. + */ + @JsonProperty(value = "prefixValidationState", access = JsonProperty.Access.WRITE_ONLY) + private PrefixValidationState prefixValidationState; + + /* + * The peering service prefix key that is to be shared with the customer. + */ + @JsonProperty(value = "peeringServicePrefixKey", access = JsonProperty.Access.WRITE_ONLY) + private String peeringServicePrefixKey; + + /* + * The error message associated with the validation state, if any. + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the prefix property: The customer's prefix from which traffic originates. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The customer's prefix from which traffic originates. + * + * @param prefix the prefix value to set. + * @return the PeeringRegisteredPrefixProperties object itself. + */ + public PeeringRegisteredPrefixProperties withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the prefixValidationState property: The prefix validation state. + * + * @return the prefixValidationState value. + */ + public PrefixValidationState prefixValidationState() { + return this.prefixValidationState; + } + + /** + * Get the peeringServicePrefixKey property: The peering service prefix key that is to be shared with the customer. + * + * @return the peeringServicePrefixKey value. + */ + public String peeringServicePrefixKey() { + return this.peeringServicePrefixKey; + } + + /** + * Get the errorMessage property: The error message associated with the validation state, if any. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceCountryInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceCountryInner.java index 8770e2db5098..6874f6eff85e 100644 --- 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 @@ -6,14 +6,10 @@ 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. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceInner.java index 749f22d16f86..8bee22031155 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,27 +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.azure.resourcemanager.peering.models.LogAnalyticsWorkspaceProperties; 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 { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceInner.class); - +public final class PeeringServiceInner extends ProxyResource { /* * The SKU that defines the type of the peering service. */ @JsonProperty(value = "sku") private PeeringServiceSku sku; + /* + * The properties that define a peering service. + */ + @JsonProperty(value = "properties") + private PeeringServiceProperties innerProperties; + /* * The location of the resource. */ @@ -36,40 +39,9 @@ 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. * @@ -90,6 +62,15 @@ public PeeringServiceInner withSku(PeeringServiceSku sku) { return this; } + /** + * Get the innerProperties property: The properties that define a peering service. + * + * @return the innerProperties value. + */ + private PeeringServiceProperties innerProperties() { + return this.innerProperties; + } + /** * Get the location property: The location of the resource. * @@ -136,7 +117,7 @@ public PeeringServiceInner withTags(Map tags) { * @return the peeringServiceLocation value. */ public String peeringServiceLocation() { - return this.peeringServiceLocation; + return this.innerProperties() == null ? null : this.innerProperties().peeringServiceLocation(); } /** @@ -146,7 +127,10 @@ public String peeringServiceLocation() { * @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; } @@ -156,7 +140,7 @@ public PeeringServiceInner withPeeringServiceLocation(String peeringServiceLocat * @return the peeringServiceProvider value. */ public String peeringServiceProvider() { - return this.peeringServiceProvider; + return this.innerProperties() == null ? null : this.innerProperties().peeringServiceProvider(); } /** @@ -166,7 +150,10 @@ public String peeringServiceProvider() { * @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,7 +163,7 @@ public PeeringServiceInner withPeeringServiceProvider(String peeringServiceProvi * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -186,7 +173,7 @@ public ProvisioningState provisioningState() { * @return the providerPrimaryPeeringLocation value. */ public String providerPrimaryPeeringLocation() { - return this.providerPrimaryPeeringLocation; + return this.innerProperties() == null ? null : this.innerProperties().providerPrimaryPeeringLocation(); } /** @@ -197,7 +184,10 @@ public String providerPrimaryPeeringLocation() { * @return the PeeringServiceInner object itself. */ public PeeringServiceInner withProviderPrimaryPeeringLocation(String providerPrimaryPeeringLocation) { - this.providerPrimaryPeeringLocation = providerPrimaryPeeringLocation; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceProperties(); + } + this.innerProperties().withProviderPrimaryPeeringLocation(providerPrimaryPeeringLocation); return this; } @@ -208,7 +198,7 @@ public PeeringServiceInner withProviderPrimaryPeeringLocation(String providerPri * @return the providerBackupPeeringLocation value. */ public String providerBackupPeeringLocation() { - return this.providerBackupPeeringLocation; + return this.innerProperties() == null ? null : this.innerProperties().providerBackupPeeringLocation(); } /** @@ -219,7 +209,34 @@ public String providerBackupPeeringLocation() { * @return the PeeringServiceInner object itself. */ public PeeringServiceInner withProviderBackupPeeringLocation(String providerBackupPeeringLocation) { - this.providerBackupPeeringLocation = providerBackupPeeringLocation; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceProperties(); + } + this.innerProperties().withProviderBackupPeeringLocation(providerBackupPeeringLocation); + return this; + } + + /** + * Get the logAnalyticsWorkspaceProperties property: The Log Analytics Workspace Properties. + * + * @return the logAnalyticsWorkspaceProperties value. + */ + public LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties() { + return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsWorkspaceProperties(); + } + + /** + * Set the logAnalyticsWorkspaceProperties property: The Log Analytics Workspace Properties. + * + * @param logAnalyticsWorkspaceProperties the logAnalyticsWorkspaceProperties value to set. + * @return the PeeringServiceInner object itself. + */ + public PeeringServiceInner withLogAnalyticsWorkspaceProperties( + LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceProperties(); + } + this.innerProperties().withLogAnalyticsWorkspaceProperties(logAnalyticsWorkspaceProperties); return this; } @@ -232,10 +249,15 @@ public void validate() { if (sku() != null) { sku().validate(); } + if (innerProperties() != null) { + innerProperties().validate(); + } if (location() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property location in model PeeringServiceInner")); } } + + private static final ClientLogger LOGGER = new ClientLogger(PeeringServiceInner.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationInner.java index f8a70650d7e3..f08f8c6d6cc4 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,26 @@ 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 @Fluent -public class PeeringServiceLocationInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceLocationInner.class); - - /* - * Country of the customer - */ - @JsonProperty(value = "properties.country") - private String country; - +public final class PeeringServiceLocationInner extends ProxyResource { /* - * State of the customer + * The properties that define a peering service location. */ - @JsonProperty(value = "properties.state") - private String state; + @JsonProperty(value = "properties") + private PeeringServiceLocationProperties innerProperties; - /* - * 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 +32,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 +42,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 +55,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 +65,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 +78,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 +88,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 +101,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 000000000000..73b809941b77 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceLocationProperties.java @@ -0,0 +1,98 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define connectivity to the Peering Service Location. */ +@Fluent +public final class PeeringServiceLocationProperties { + /* + * 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 841e9636f4db..f4eb388df2b0 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,64 +5,31 @@ 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 { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicePrefixInner.class); - - /* - * The prefix from which your traffic originates. - */ - @JsonProperty(value = "properties.prefix") - private String prefix; - - /* - * The prefix validation state - */ - @JsonProperty(value = "properties.prefixValidationState", access = JsonProperty.Access.WRITE_ONLY) - private PrefixValidationState prefixValidationState; - - /* - * The 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; - +public final class PeeringServicePrefixInner extends ProxyResource { /* - * The peering service prefix key + * Gets or sets the peering prefix properties. */ - @JsonProperty(value = "properties.peeringServicePrefixKey") - private String peeringServicePrefixKey; + @JsonProperty(value = "properties") + private PeeringServicePrefixProperties innerProperties; - /* - * 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. @@ -70,7 +37,7 @@ public class PeeringServicePrefixInner extends ProxyResource { * @return the prefix value. */ public String prefix() { - return this.prefix; + return this.innerProperties() == null ? null : this.innerProperties().prefix(); } /** @@ -80,7 +47,10 @@ public String prefix() { * @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,7 +60,7 @@ public PeeringServicePrefixInner withPrefix(String prefix) { * @return the prefixValidationState value. */ public PrefixValidationState prefixValidationState() { - return this.prefixValidationState; + return this.innerProperties() == null ? null : this.innerProperties().prefixValidationState(); } /** @@ -99,7 +69,7 @@ public PrefixValidationState prefixValidationState() { * @return the learnedType value. */ public LearnedType learnedType() { - return this.learnedType; + return this.innerProperties() == null ? null : this.innerProperties().learnedType(); } /** @@ -108,7 +78,7 @@ public LearnedType learnedType() { * @return the errorMessage value. */ public String errorMessage() { - return this.errorMessage; + return this.innerProperties() == null ? null : this.innerProperties().errorMessage(); } /** @@ -117,7 +87,7 @@ public String errorMessage() { * @return the events value. */ public List events() { - return this.events; + return this.innerProperties() == null ? null : this.innerProperties().events(); } /** @@ -126,7 +96,7 @@ public List events() { * @return the peeringServicePrefixKey value. */ public String peeringServicePrefixKey() { - return this.peeringServicePrefixKey; + return this.innerProperties() == null ? null : this.innerProperties().peeringServicePrefixKey(); } /** @@ -136,7 +106,10 @@ public String peeringServicePrefixKey() { * @return the PeeringServicePrefixInner object itself. */ public PeeringServicePrefixInner withPeeringServicePrefixKey(String peeringServicePrefixKey) { - this.peeringServicePrefixKey = peeringServicePrefixKey; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServicePrefixProperties(); + } + this.innerProperties().withPeeringServicePrefixKey(peeringServicePrefixKey); return this; } @@ -146,7 +119,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 +128,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/PeeringServicePrefixProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServicePrefixProperties.java new file mode 100644 index 000000000000..9bc3a325e790 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServicePrefixProperties.java @@ -0,0 +1,155 @@ +// 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.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.JsonProperty; +import java.util.List; + +/** The peering service prefix properties class. */ +@Fluent +public final class PeeringServicePrefixProperties { + /* + * The prefix from which your traffic originates. + */ + @JsonProperty(value = "prefix") + private String prefix; + + /* + * The prefix validation state + */ + @JsonProperty(value = "prefixValidationState", access = JsonProperty.Access.WRITE_ONLY) + private PrefixValidationState prefixValidationState; + + /* + * The prefix learned type + */ + @JsonProperty(value = "learnedType", access = JsonProperty.Access.WRITE_ONLY) + private LearnedType learnedType; + + /* + * The error message for validation state + */ + @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String errorMessage; + + /* + * The list of events for peering service prefix + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /* + * The peering service prefix key + */ + @JsonProperty(value = "peeringServicePrefixKey") + private String peeringServicePrefixKey; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the prefix property: The prefix from which your traffic originates. + * + * @return the prefix value. + */ + public String prefix() { + return this.prefix; + } + + /** + * Set the prefix property: The prefix from which your traffic originates. + * + * @param prefix the prefix value to set. + * @return the PeeringServicePrefixProperties object itself. + */ + public PeeringServicePrefixProperties withPrefix(String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get the prefixValidationState property: The prefix validation state. + * + * @return the prefixValidationState value. + */ + public PrefixValidationState prefixValidationState() { + return this.prefixValidationState; + } + + /** + * Get the 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. + * + * @return the events value. + */ + public List events() { + return this.events; + } + + /** + * Get the peeringServicePrefixKey property: The peering service prefix key. + * + * @return the peeringServicePrefixKey value. + */ + public String peeringServicePrefixKey() { + return this.peeringServicePrefixKey; + } + + /** + * Set the peeringServicePrefixKey property: The peering service prefix key. + * + * @param peeringServicePrefixKey the peeringServicePrefixKey value to set. + * @return the PeeringServicePrefixProperties object itself. + */ + public PeeringServicePrefixProperties withPeeringServicePrefixKey(String peeringServicePrefixKey) { + this.peeringServicePrefixKey = peeringServicePrefixKey; + 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 (events() != null) { + events().forEach(e -> e.validate()); + } + } +} 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 000000000000..402b69dc026a --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProperties.java @@ -0,0 +1,175 @@ +// 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.resourcemanager.peering.models.LogAnalyticsWorkspaceProperties; +import com.azure.resourcemanager.peering.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties that define connectivity to the Peering Service. */ +@Fluent +public final class PeeringServiceProperties { + /* + * The location (state/province) of the customer. + */ + @JsonProperty(value = "peeringServiceLocation") + private String peeringServiceLocation; + + /* + * The name of the service provider. + */ + @JsonProperty(value = "peeringServiceProvider") + private String peeringServiceProvider; + + /* + * The provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The primary peering (Microsoft/service provider) location to be used for customer traffic. + */ + @JsonProperty(value = "providerPrimaryPeeringLocation") + private String providerPrimaryPeeringLocation; + + /* + * The backup peering (Microsoft/service provider) location to be used for customer traffic. + */ + @JsonProperty(value = "providerBackupPeeringLocation") + private String providerBackupPeeringLocation; + + /* + * The Log Analytics Workspace Properties + */ + @JsonProperty(value = "logAnalyticsWorkspaceProperties") + private LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties; + + /** + * Get the peeringServiceLocation property: The location (state/province) of the customer. + * + * @return the peeringServiceLocation value. + */ + public String peeringServiceLocation() { + return this.peeringServiceLocation; + } + + /** + * Set the peeringServiceLocation property: The location (state/province) 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 name of the service provider. + * + * @return the peeringServiceProvider value. + */ + public String peeringServiceProvider() { + return this.peeringServiceProvider; + } + + /** + * Set the peeringServiceProvider property: The name of the service provider. + * + * @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; + } + + /** + * 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 PeeringServiceProperties object itself. + */ + public PeeringServiceProperties 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 PeeringServiceProperties object itself. + */ + public PeeringServiceProperties withProviderBackupPeeringLocation(String providerBackupPeeringLocation) { + this.providerBackupPeeringLocation = providerBackupPeeringLocation; + return this; + } + + /** + * Get the logAnalyticsWorkspaceProperties property: The Log Analytics Workspace Properties. + * + * @return the logAnalyticsWorkspaceProperties value. + */ + public LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties() { + return this.logAnalyticsWorkspaceProperties; + } + + /** + * Set the logAnalyticsWorkspaceProperties property: The Log Analytics Workspace Properties. + * + * @param logAnalyticsWorkspaceProperties the logAnalyticsWorkspaceProperties value to set. + * @return the PeeringServiceProperties object itself. + */ + public PeeringServiceProperties withLogAnalyticsWorkspaceProperties( + LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties) { + this.logAnalyticsWorkspaceProperties = logAnalyticsWorkspaceProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logAnalyticsWorkspaceProperties() != null) { + logAnalyticsWorkspaceProperties().validate(); + } + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderInner.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderInner.java index da060a5aa1da..da7e679422c8 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,27 @@ 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 { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceProviderInner.class); - +public final class PeeringServiceProviderInner extends ProxyResource { /* - * 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 +33,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,7 +43,10 @@ public String serviceProviderName() { * @return the PeeringServiceProviderInner object itself. */ public PeeringServiceProviderInner withServiceProviderName(String serviceProviderName) { - this.serviceProviderName = serviceProviderName; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceProviderProperties(); + } + this.innerProperties().withServiceProviderName(serviceProviderName); return this; } @@ -57,7 +56,7 @@ public PeeringServiceProviderInner withServiceProviderName(String serviceProvide * @return the peeringLocations value. */ public List peeringLocations() { - return this.peeringLocations; + return this.innerProperties() == null ? null : this.innerProperties().peeringLocations(); } /** @@ -67,7 +66,10 @@ public List peeringLocations() { * @return the PeeringServiceProviderInner object itself. */ public PeeringServiceProviderInner withPeeringLocations(List peeringLocations) { - this.peeringLocations = peeringLocations; + if (this.innerProperties() == null) { + this.innerProperties = new PeeringServiceProviderProperties(); + } + this.innerProperties().withPeeringLocations(peeringLocations); return this; } @@ -77,5 +79,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 000000000000..d441f9e53f0b --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/fluent/models/PeeringServiceProviderProperties.java @@ -0,0 +1,73 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties that define connectivity to the Peering Service Provider. */ +@Fluent +public final class PeeringServiceProviderProperties { + /* + * The name of the service provider. + */ + @JsonProperty(value = "serviceProviderName") + private String serviceProviderName; + + /* + * The list of locations at which the service provider peers with Microsoft. + */ + @JsonProperty(value = "peeringLocations") + private List peeringLocations; + + /** + * 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; + } + + /** + * 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 PeeringServiceProviderProperties object itself. + */ + public PeeringServiceProviderProperties withPeeringLocations(List peeringLocations) { + this.peeringLocations = peeringLocations; + 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/CdnPeeringPrefixesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/CdnPeeringPrefixesClientImpl.java index d8e93e1c95e6..a9b26f3b3cf4 100644 --- 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 @@ -25,7 +25,6 @@ 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; @@ -33,8 +32,6 @@ /** 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; @@ -89,7 +86,8 @@ Mono> listNext( * @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. + * @return the paginated list of CDN peering prefixes along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String peeringLocation) { @@ -141,7 +139,8 @@ private Mono> listSinglePageAsync(String pe * @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. + * @return the paginated list of CDN peering prefixes along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String peeringLocation, Context context) { @@ -189,7 +188,7 @@ private Mono> listSinglePageAsync(String pe * @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. + * @return the paginated list of CDN peering prefixes as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String peeringLocation) { @@ -205,7 +204,7 @@ private PagedFlux listAsync(String peeringLocation) { * @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. + * @return the paginated list of CDN peering prefixes as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String peeringLocation, Context context) { @@ -221,7 +220,7 @@ private PagedFlux listAsync(String peeringLocation, Conte * @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. + * @return the paginated list of CDN peering prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String peeringLocation) { @@ -236,7 +235,7 @@ public PagedIterable list(String peeringLocation) { * @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. + * @return the paginated list of CDN peering prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String peeringLocation, Context context) { @@ -250,7 +249,8 @@ public PagedIterable list(String peeringLocation, Context * @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. + * @return the paginated list of CDN peering prefixes along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -286,7 +286,8 @@ private Mono> listNextSinglePageAsync(Strin * @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. + * @return the paginated list of CDN peering prefixes along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { 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 index 4594b349f43b..f40b28eda2b7 100644 --- 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 @@ -11,10 +11,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(CdnPeeringPrefixesImpl.class); private final CdnPeeringPrefixesClient innerClient; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ConnectionMonitorTestImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ConnectionMonitorTestImpl.java new file mode 100644 index 000000000000..70091b70aee7 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ConnectionMonitorTestImpl.java @@ -0,0 +1,191 @@ +// 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.ConnectionMonitorTestInner; +import com.azure.resourcemanager.peering.models.ConnectionMonitorTest; +import com.azure.resourcemanager.peering.models.ProvisioningState; +import java.util.Collections; +import java.util.List; + +public final class ConnectionMonitorTestImpl + implements ConnectionMonitorTest, ConnectionMonitorTest.Definition, ConnectionMonitorTest.Update { + private ConnectionMonitorTestInner 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 sourceAgent() { + return this.innerModel().sourceAgent(); + } + + public String destination() { + return this.innerModel().destination(); + } + + public Integer destinationPort() { + return this.innerModel().destinationPort(); + } + + public Integer testFrequencyInSec() { + return this.innerModel().testFrequencyInSec(); + } + + public Boolean isTestSuccessful() { + return this.innerModel().isTestSuccessful(); + } + + public List path() { + List inner = this.innerModel().path(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ConnectionMonitorTestInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.peering.PeeringManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String peeringServiceName; + + private String connectionMonitorTestName; + + public ConnectionMonitorTestImpl withExistingPeeringService(String resourceGroupName, String peeringServiceName) { + this.resourceGroupName = resourceGroupName; + this.peeringServiceName = peeringServiceName; + return this; + } + + public ConnectionMonitorTest create() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitorTests() + .createOrUpdateWithResponse( + resourceGroupName, peeringServiceName, connectionMonitorTestName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ConnectionMonitorTest create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitorTests() + .createOrUpdateWithResponse( + resourceGroupName, peeringServiceName, connectionMonitorTestName, this.innerModel(), context) + .getValue(); + return this; + } + + ConnectionMonitorTestImpl(String name, com.azure.resourcemanager.peering.PeeringManager serviceManager) { + this.innerObject = new ConnectionMonitorTestInner(); + this.serviceManager = serviceManager; + this.connectionMonitorTestName = name; + } + + public ConnectionMonitorTestImpl update() { + return this; + } + + public ConnectionMonitorTest apply() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitorTests() + .createOrUpdateWithResponse( + resourceGroupName, peeringServiceName, connectionMonitorTestName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ConnectionMonitorTest apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitorTests() + .createOrUpdateWithResponse( + resourceGroupName, peeringServiceName, connectionMonitorTestName, this.innerModel(), context) + .getValue(); + return this; + } + + ConnectionMonitorTestImpl( + ConnectionMonitorTestInner innerObject, com.azure.resourcemanager.peering.PeeringManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.peeringServiceName = Utils.getValueFromIdByName(innerObject.id(), "peeringServices"); + this.connectionMonitorTestName = Utils.getValueFromIdByName(innerObject.id(), "connectionMonitorTests"); + } + + public ConnectionMonitorTest refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitorTests() + .getWithResponse(resourceGroupName, peeringServiceName, connectionMonitorTestName, Context.NONE) + .getValue(); + return this; + } + + public ConnectionMonitorTest refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getConnectionMonitorTests() + .getWithResponse(resourceGroupName, peeringServiceName, connectionMonitorTestName, context) + .getValue(); + return this; + } + + public ConnectionMonitorTestImpl withSourceAgent(String sourceAgent) { + this.innerModel().withSourceAgent(sourceAgent); + return this; + } + + public ConnectionMonitorTestImpl withDestination(String destination) { + this.innerModel().withDestination(destination); + return this; + } + + public ConnectionMonitorTestImpl withDestinationPort(Integer destinationPort) { + this.innerModel().withDestinationPort(destinationPort); + return this; + } + + public ConnectionMonitorTestImpl withTestFrequencyInSec(Integer testFrequencyInSec) { + this.innerModel().withTestFrequencyInSec(testFrequencyInSec); + return this; + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ConnectionMonitorTestsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ConnectionMonitorTestsClientImpl.java new file mode 100644 index 000000000000..776222d184f7 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ConnectionMonitorTestsClientImpl.java @@ -0,0 +1,949 @@ +// 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.resourcemanager.peering.fluent.ConnectionMonitorTestsClient; +import com.azure.resourcemanager.peering.fluent.models.ConnectionMonitorTestInner; +import com.azure.resourcemanager.peering.models.ConnectionMonitorTestListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ConnectionMonitorTestsClient. */ +public final class ConnectionMonitorTestsClientImpl implements ConnectionMonitorTestsClient { + /** The proxy service used to perform REST calls. */ + private final ConnectionMonitorTestsService service; + + /** The service client containing this operation class. */ + private final PeeringManagementClientImpl client; + + /** + * Initializes an instance of ConnectionMonitorTestsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ConnectionMonitorTestsClientImpl(PeeringManagementClientImpl client) { + this.service = + RestProxy + .create(ConnectionMonitorTestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PeeringManagementClientConnectionMonitorTests to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PeeringManagementCli") + private interface ConnectionMonitorTestsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" + + "/peeringServices/{peeringServiceName}/connectionMonitorTests/{connectionMonitorTestName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("peeringServiceName") String peeringServiceName, + @PathParam("connectionMonitorTestName") String connectionMonitorTestName, + @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}/connectionMonitorTests/{connectionMonitorTestName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("peeringServiceName") String peeringServiceName, + @PathParam("connectionMonitorTestName") String connectionMonitorTestName, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ConnectionMonitorTestInner connectionMonitorTest, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering" + + "/peeringServices/{peeringServiceName}/connectionMonitorTests/{connectionMonitorTestName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("peeringServiceName") String peeringServiceName, + @PathParam("connectionMonitorTestName") String connectionMonitorTestName, + @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" + + "/peeringServices/{peeringServiceName}/connectionMonitorTests") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByPeeringService( + @HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("peeringServiceName") String peeringServiceName, + @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> listByPeeringServiceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName) { + 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 (connectionMonitorTestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectionMonitorTestName 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, + connectionMonitorTestName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, 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 (connectionMonitorTestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectionMonitorTestName 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, + connectionMonitorTestName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName) { + return getWithResponseAsync(resourceGroupName, peeringServiceName, connectionMonitorTestName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorTestInner get( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName) { + return getAsync(resourceGroupName, peeringServiceName, connectionMonitorTestName).block(); + } + + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, Context context) { + return getWithResponseAsync(resourceGroupName, peeringServiceName, connectionMonitorTestName, context).block(); + } + + /** + * Creates or updates a connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @param connectionMonitorTest The properties needed to create a connection monitor test. + * @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 Connection Monitor Test class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String peeringServiceName, + String connectionMonitorTestName, + ConnectionMonitorTestInner connectionMonitorTest) { + 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 (connectionMonitorTestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectionMonitorTestName 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 (connectionMonitorTest == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorTest is required and cannot be null.")); + } else { + connectionMonitorTest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + connectionMonitorTestName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + connectionMonitorTest, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @param connectionMonitorTest The properties needed to create a connection monitor test. + * @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 Connection Monitor Test class along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String peeringServiceName, + String connectionMonitorTestName, + ConnectionMonitorTestInner connectionMonitorTest, + 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 (connectionMonitorTestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectionMonitorTestName 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 (connectionMonitorTest == null) { + return Mono + .error(new IllegalArgumentException("Parameter connectionMonitorTest is required and cannot be null.")); + } else { + connectionMonitorTest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + connectionMonitorTestName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + connectionMonitorTest, + accept, + context); + } + + /** + * Creates or updates a connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @param connectionMonitorTest The properties needed to create a connection monitor test. + * @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 Connection Monitor Test class on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String peeringServiceName, + String connectionMonitorTestName, + ConnectionMonitorTestInner connectionMonitorTest) { + return createOrUpdateWithResponseAsync( + resourceGroupName, peeringServiceName, connectionMonitorTestName, connectionMonitorTest) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates a connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @param connectionMonitorTest The properties needed to create a connection monitor test. + * @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 Connection Monitor Test class. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ConnectionMonitorTestInner createOrUpdate( + String resourceGroupName, + String peeringServiceName, + String connectionMonitorTestName, + ConnectionMonitorTestInner connectionMonitorTest) { + return createOrUpdateAsync( + resourceGroupName, peeringServiceName, connectionMonitorTestName, connectionMonitorTest) + .block(); + } + + /** + * Creates or updates a connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @param connectionMonitorTest The properties needed to create a connection monitor test. + * @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 Connection Monitor Test class along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String peeringServiceName, + String connectionMonitorTestName, + ConnectionMonitorTestInner connectionMonitorTest, + Context context) { + return createOrUpdateWithResponseAsync( + resourceGroupName, peeringServiceName, connectionMonitorTestName, connectionMonitorTest, context) + .block(); + } + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName) { + 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 (connectionMonitorTestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectionMonitorTestName 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, + connectionMonitorTestName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, 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 (connectionMonitorTestName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter connectionMonitorTestName 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, + connectionMonitorTestName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName) { + return deleteWithResponseAsync(resourceGroupName, peeringServiceName, connectionMonitorTestName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connectionMonitorTestName) { + deleteAsync(resourceGroupName, peeringServiceName, connectionMonitorTestName).block(); + } + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, Context context) { + return deleteWithResponseAsync(resourceGroupName, peeringServiceName, connectionMonitorTestName, context) + .block(); + } + + /** + * Lists all connection monitor tests 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 ManagementException 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 [T] along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPeeringServiceSinglePageAsync( + String resourceGroupName, String peeringServiceName) { + 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 (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 + .listByPeeringService( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + 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 connection monitor tests 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 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 [T] along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPeeringServiceSinglePageAsync( + String resourceGroupName, String peeringServiceName, 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 (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 + .listByPeeringService( + this.client.getEndpoint(), + resourceGroupName, + peeringServiceName, + 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 connection monitor tests 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 ManagementException 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 [T] as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPeeringServiceAsync( + String resourceGroupName, String peeringServiceName) { + return new PagedFlux<>( + () -> listByPeeringServiceSinglePageAsync(resourceGroupName, peeringServiceName), + nextLink -> listByPeeringServiceNextSinglePageAsync(nextLink)); + } + + /** + * Lists all connection monitor tests 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 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 [T] as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByPeeringServiceAsync( + String resourceGroupName, String peeringServiceName, Context context) { + return new PagedFlux<>( + () -> listByPeeringServiceSinglePageAsync(resourceGroupName, peeringServiceName, context), + nextLink -> listByPeeringServiceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all connection monitor tests 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 ManagementException 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 [T] as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPeeringService( + String resourceGroupName, String peeringServiceName) { + return new PagedIterable<>(listByPeeringServiceAsync(resourceGroupName, peeringServiceName)); + } + + /** + * Lists all connection monitor tests 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 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 [T] as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByPeeringService( + String resourceGroupName, String peeringServiceName, Context context) { + return new PagedIterable<>(listByPeeringServiceAsync(resourceGroupName, peeringServiceName, 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 [T] along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPeeringServiceNextSinglePageAsync(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.listByPeeringServiceNext(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 [T] along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByPeeringServiceNextSinglePageAsync( + 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 + .listByPeeringServiceNext(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/ConnectionMonitorTestsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ConnectionMonitorTestsImpl.java new file mode 100644 index 000000000000..420ef6ef00ec --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ConnectionMonitorTestsImpl.java @@ -0,0 +1,216 @@ +// 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.ConnectionMonitorTestsClient; +import com.azure.resourcemanager.peering.fluent.models.ConnectionMonitorTestInner; +import com.azure.resourcemanager.peering.models.ConnectionMonitorTest; +import com.azure.resourcemanager.peering.models.ConnectionMonitorTests; + +public final class ConnectionMonitorTestsImpl implements ConnectionMonitorTests { + private static final ClientLogger LOGGER = new ClientLogger(ConnectionMonitorTestsImpl.class); + + private final ConnectionMonitorTestsClient innerClient; + + private final com.azure.resourcemanager.peering.PeeringManager serviceManager; + + public ConnectionMonitorTestsImpl( + ConnectionMonitorTestsClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ConnectionMonitorTest get( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName) { + ConnectionMonitorTestInner inner = + this.serviceClient().get(resourceGroupName, peeringServiceName, connectionMonitorTestName); + if (inner != null) { + return new ConnectionMonitorTestImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, peeringServiceName, connectionMonitorTestName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ConnectionMonitorTestImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String peeringServiceName, String connectionMonitorTestName) { + this.serviceClient().delete(resourceGroupName, peeringServiceName, connectionMonitorTestName); + } + + public Response deleteWithResponse( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, Context context) { + return this + .serviceClient() + .deleteWithResponse(resourceGroupName, peeringServiceName, connectionMonitorTestName, context); + } + + public PagedIterable listByPeeringService( + String resourceGroupName, String peeringServiceName) { + PagedIterable inner = + this.serviceClient().listByPeeringService(resourceGroupName, peeringServiceName); + return Utils.mapPage(inner, inner1 -> new ConnectionMonitorTestImpl(inner1, this.manager())); + } + + public PagedIterable listByPeeringService( + String resourceGroupName, String peeringServiceName, Context context) { + PagedIterable inner = + this.serviceClient().listByPeeringService(resourceGroupName, peeringServiceName, context); + return Utils.mapPage(inner, inner1 -> new ConnectionMonitorTestImpl(inner1, this.manager())); + } + + public ConnectionMonitorTest 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 connectionMonitorTestName = Utils.getValueFromIdByName(id, "connectionMonitorTests"); + if (connectionMonitorTestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitorTests'.", + id))); + } + return this + .getWithResponse(resourceGroupName, peeringServiceName, connectionMonitorTestName, 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 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 connectionMonitorTestName = Utils.getValueFromIdByName(id, "connectionMonitorTests"); + if (connectionMonitorTestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitorTests'.", + id))); + } + return this.getWithResponse(resourceGroupName, peeringServiceName, connectionMonitorTestName, 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 connectionMonitorTestName = Utils.getValueFromIdByName(id, "connectionMonitorTests"); + if (connectionMonitorTestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitorTests'.", + id))); + } + this.deleteWithResponse(resourceGroupName, peeringServiceName, connectionMonitorTestName, Context.NONE); + } + + 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 connectionMonitorTestName = Utils.getValueFromIdByName(id, "connectionMonitorTests"); + if (connectionMonitorTestName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'connectionMonitorTests'.", + id))); + } + return this.deleteWithResponse(resourceGroupName, peeringServiceName, connectionMonitorTestName, context); + } + + private ConnectionMonitorTestsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.peering.PeeringManager manager() { + return this.serviceManager; + } + + public ConnectionMonitorTestImpl define(String name) { + return new ConnectionMonitorTestImpl(name, this.manager()); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsClientImpl.java index 544847e55a06..e3522aa6aa71 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 @@ -25,17 +25,15 @@ 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.LegacyPeeringsClient; import com.azure.resourcemanager.peering.fluent.models.PeeringInner; +import com.azure.resourcemanager.peering.models.DirectPeeringType; import com.azure.resourcemanager.peering.models.LegacyPeeringsKind; import com.azure.resourcemanager.peering.models.PeeringListResult; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in LegacyPeeringsClient. */ public final class LegacyPeeringsClientImpl implements LegacyPeeringsClient { - private final ClientLogger logger = new ClientLogger(LegacyPeeringsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final LegacyPeeringsService service; @@ -69,6 +67,7 @@ Mono> list( @QueryParam("peeringLocation") String peeringLocation, @QueryParam("kind") LegacyPeeringsKind kind, @QueryParam("asn") Integer asn, + @QueryParam("directPeeringType") DirectPeeringType directPeeringType, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -91,14 +90,15 @@ 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. + * @param directPeeringType The direct peering type. * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String peeringLocation, LegacyPeeringsKind kind, Integer asn) { + String peeringLocation, LegacyPeeringsKind kind, Integer asn, DirectPeeringType directPeeringType) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -128,6 +128,7 @@ private Mono> listSinglePageAsync( peeringLocation, kind, asn, + directPeeringType, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -150,15 +151,20 @@ 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 directPeeringType The direct peering type. * @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 peerings. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context) { + String peeringLocation, + LegacyPeeringsKind kind, + Integer asn, + DirectPeeringType directPeeringType, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -186,6 +192,7 @@ private Mono> listSinglePageAsync( peeringLocation, kind, asn, + directPeeringType, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, @@ -207,15 +214,18 @@ 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 directPeeringType The direct peering type. * @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. + * @return the paginated list of peerings as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String peeringLocation, LegacyPeeringsKind kind, Integer asn) { + private PagedFlux listAsync( + String peeringLocation, LegacyPeeringsKind kind, Integer asn, DirectPeeringType directPeeringType) { return new PagedFlux<>( - () -> listSinglePageAsync(peeringLocation, kind, asn), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(peeringLocation, kind, asn, directPeeringType), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -226,13 +236,15 @@ private PagedFlux listAsync(String peeringLocation, LegacyPeerings * @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. + * @return the paginated list of peerings as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String peeringLocation, LegacyPeeringsKind kind) { final Integer asn = null; + final DirectPeeringType directPeeringType = null; return new PagedFlux<>( - () -> listSinglePageAsync(peeringLocation, kind, asn), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(peeringLocation, kind, asn, directPeeringType), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -241,17 +253,22 @@ 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 directPeeringType The direct peering type. * @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 peerings. + * @return the paginated list of peerings as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context) { + String peeringLocation, + LegacyPeeringsKind kind, + Integer asn, + DirectPeeringType directPeeringType, + Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(peeringLocation, kind, asn, context), + () -> listSinglePageAsync(peeringLocation, kind, asn, directPeeringType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } @@ -263,12 +280,13 @@ private PagedFlux listAsync( * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String peeringLocation, LegacyPeeringsKind kind) { final Integer asn = null; - return new PagedIterable<>(listAsync(peeringLocation, kind, asn)); + final DirectPeeringType directPeeringType = null; + return new PagedIterable<>(listAsync(peeringLocation, kind, asn, directPeeringType)); } /** @@ -277,16 +295,21 @@ 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 directPeeringType The direct peering type. * @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 peerings. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context) { - return new PagedIterable<>(listAsync(peeringLocation, kind, asn, context)); + String peeringLocation, + LegacyPeeringsKind kind, + Integer asn, + DirectPeeringType directPeeringType, + Context context) { + return new PagedIterable<>(listAsync(peeringLocation, kind, asn, directPeeringType, context)); } /** @@ -296,7 +319,7 @@ public PagedIterable list( * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -332,7 +355,7 @@ private Mono> listNextSinglePageAsync(String nextLin * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LegacyPeeringsImpl.java index 9633dbf063a9..b92ff2677aa7 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 @@ -9,13 +9,13 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.peering.fluent.LegacyPeeringsClient; import com.azure.resourcemanager.peering.fluent.models.PeeringInner; +import com.azure.resourcemanager.peering.models.DirectPeeringType; import com.azure.resourcemanager.peering.models.LegacyPeerings; import com.azure.resourcemanager.peering.models.LegacyPeeringsKind; import com.azure.resourcemanager.peering.models.Peering; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class LegacyPeeringsImpl implements LegacyPeerings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyPeeringsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(LegacyPeeringsImpl.class); private final LegacyPeeringsClient innerClient; @@ -32,8 +32,14 @@ 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, + Integer asn, + DirectPeeringType directPeeringType, + Context context) { + PagedIterable inner = + this.serviceClient().list(peeringLocation, kind, asn, directPeeringType, 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/LookingGlassClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LookingGlassClientImpl.java new file mode 100644 index 000000000000..cd9d8e10c7b8 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LookingGlassClientImpl.java @@ -0,0 +1,247 @@ +// 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.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.Post; +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.resourcemanager.peering.fluent.LookingGlassClient; +import com.azure.resourcemanager.peering.fluent.models.LookingGlassOutputInner; +import com.azure.resourcemanager.peering.models.LookingGlassCommand; +import com.azure.resourcemanager.peering.models.LookingGlassSourceType; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in LookingGlassClient. */ +public final class LookingGlassClientImpl implements LookingGlassClient { + /** The proxy service used to perform REST calls. */ + private final LookingGlassService service; + + /** The service client containing this operation class. */ + private final PeeringManagementClientImpl client; + + /** + * Initializes an instance of LookingGlassClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LookingGlassClientImpl(PeeringManagementClientImpl client) { + this.service = + RestProxy.create(LookingGlassService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PeeringManagementClientLookingGlass to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PeeringManagementCli") + private interface LookingGlassService { + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/lookingGlass") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> invoke( + @HostParam("$host") String endpoint, + @QueryParam("command") LookingGlassCommand command, + @QueryParam("sourceType") LookingGlassSourceType sourceType, + @QueryParam("sourceLocation") String sourceLocation, + @QueryParam("destinationIP") String destinationIp, + @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeWithResponseAsync( + LookingGlassCommand command, LookingGlassSourceType sourceType, String sourceLocation, String destinationIp) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (command == null) { + return Mono.error(new IllegalArgumentException("Parameter command is required and cannot be null.")); + } + if (sourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter sourceType is required and cannot be null.")); + } + if (sourceLocation == null) { + return Mono.error(new IllegalArgumentException("Parameter sourceLocation is required and cannot be null.")); + } + if (destinationIp == null) { + return Mono.error(new IllegalArgumentException("Parameter destinationIp 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 + .invoke( + this.client.getEndpoint(), + command, + sourceType, + sourceLocation, + destinationIp, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> invokeWithResponseAsync( + LookingGlassCommand command, + LookingGlassSourceType sourceType, + String sourceLocation, + String destinationIp, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (command == null) { + return Mono.error(new IllegalArgumentException("Parameter command is required and cannot be null.")); + } + if (sourceType == null) { + return Mono.error(new IllegalArgumentException("Parameter sourceType is required and cannot be null.")); + } + if (sourceLocation == null) { + return Mono.error(new IllegalArgumentException("Parameter sourceLocation is required and cannot be null.")); + } + if (destinationIp == null) { + return Mono.error(new IllegalArgumentException("Parameter destinationIp 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 + .invoke( + this.client.getEndpoint(), + command, + sourceType, + sourceLocation, + destinationIp, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono invokeAsync( + LookingGlassCommand command, LookingGlassSourceType sourceType, String sourceLocation, String destinationIp) { + return invokeWithResponseAsync(command, sourceType, sourceLocation, destinationIp) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LookingGlassOutputInner invoke( + LookingGlassCommand command, LookingGlassSourceType sourceType, String sourceLocation, String destinationIp) { + return invokeAsync(command, sourceType, sourceLocation, destinationIp).block(); + } + + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response invokeWithResponse( + LookingGlassCommand command, + LookingGlassSourceType sourceType, + String sourceLocation, + String destinationIp, + Context context) { + return invokeWithResponseAsync(command, sourceType, sourceLocation, destinationIp, context).block(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LookingGlassImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LookingGlassImpl.java new file mode 100644 index 000000000000..75791807b12a --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LookingGlassImpl.java @@ -0,0 +1,67 @@ +// 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.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.LookingGlassClient; +import com.azure.resourcemanager.peering.fluent.models.LookingGlassOutputInner; +import com.azure.resourcemanager.peering.models.LookingGlass; +import com.azure.resourcemanager.peering.models.LookingGlassCommand; +import com.azure.resourcemanager.peering.models.LookingGlassOutput; +import com.azure.resourcemanager.peering.models.LookingGlassSourceType; + +public final class LookingGlassImpl implements LookingGlass { + private static final ClientLogger LOGGER = new ClientLogger(LookingGlassImpl.class); + + private final LookingGlassClient innerClient; + + private final com.azure.resourcemanager.peering.PeeringManager serviceManager; + + public LookingGlassImpl( + LookingGlassClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public LookingGlassOutput invoke( + LookingGlassCommand command, LookingGlassSourceType sourceType, String sourceLocation, String destinationIp) { + LookingGlassOutputInner inner = this.serviceClient().invoke(command, sourceType, sourceLocation, destinationIp); + if (inner != null) { + return new LookingGlassOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response invokeWithResponse( + LookingGlassCommand command, + LookingGlassSourceType sourceType, + String sourceLocation, + String destinationIp, + Context context) { + Response inner = + this.serviceClient().invokeWithResponse(command, sourceType, sourceLocation, destinationIp, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new LookingGlassOutputImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private LookingGlassClient 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/LookingGlassOutputImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LookingGlassOutputImpl.java new file mode 100644 index 000000000000..38a9344c8ae4 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/LookingGlassOutputImpl.java @@ -0,0 +1,37 @@ +// 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.LookingGlassOutputInner; +import com.azure.resourcemanager.peering.models.Command; +import com.azure.resourcemanager.peering.models.LookingGlassOutput; + +public final class LookingGlassOutputImpl implements LookingGlassOutput { + private LookingGlassOutputInner innerObject; + + private final com.azure.resourcemanager.peering.PeeringManager serviceManager; + + LookingGlassOutputImpl( + LookingGlassOutputInner innerObject, com.azure.resourcemanager.peering.PeeringManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Command command() { + return this.innerModel().command(); + } + + public String output() { + return this.innerModel().output(); + } + + public LookingGlassOutputInner 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/OperationImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationImpl.java index 2769fb724264..5b1536854bdb 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationImpl.java @@ -7,6 +7,7 @@ import com.azure.resourcemanager.peering.fluent.models.OperationInner; import com.azure.resourcemanager.peering.models.Operation; import com.azure.resourcemanager.peering.models.OperationDisplayInfo; +import com.azure.resourcemanager.peering.models.ServiceSpecification; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -30,6 +31,10 @@ public Boolean isDataAction() { return this.innerModel().isDataAction(); } + public ServiceSpecification serviceSpecification() { + return this.innerModel().serviceSpecification(); + } + public OperationInner innerModel() { return this.innerObject; } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationsClientImpl.java index 3e0045867d0b..62386bcdd7de 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationsClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationsClientImpl.java @@ -25,7 +25,6 @@ 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.OperationsClient; import com.azure.resourcemanager.peering.fluent.models.OperationInner; import com.azure.resourcemanager.peering.models.OperationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,8 @@ Mono> listNext( * * @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 API operations. + * @return the paginated list of peering API operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +116,8 @@ private Mono> listSinglePageAsync() { * @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 API operations. + * @return the paginated list of peering API operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +147,7 @@ private Mono> listSinglePageAsync(Context context) * * @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 API operations. + * @return the paginated list of peering API operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +161,7 @@ private PagedFlux listAsync() { * @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 API operations. + * @return the paginated list of peering API operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +174,7 @@ private PagedFlux listAsync(Context context) { * * @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 API operations. + * @return the paginated list of peering API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +188,7 @@ public PagedIterable list() { * @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 API operations. + * @return the paginated list of peering API operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +202,8 @@ public PagedIterable list(Context context) { * @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 API operations. + * @return the paginated list of peering API operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +239,8 @@ private Mono> listNextSinglePageAsync(String nextL * @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 API operations. + * @return the paginated list of peering API operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationsImpl.java index 4bb8c597a92c..53d0a41b47e1 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationsImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.peering.fluent.models.OperationInner; import com.azure.resourcemanager.peering.models.Operation; import com.azure.resourcemanager.peering.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnImpl.java index 8c01d2524817..f5ef2a117443 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 @@ -146,9 +146,4 @@ public PeerAsnImpl withPeerName(String peerName) { this.innerModel().withPeerName(peerName); return this; } - - public PeerAsnImpl withValidationState(ValidationState validationState) { - this.innerModel().withValidationState(validationState); - return this; - } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnsClientImpl.java index 13175882e076..034b2e399350 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnsClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeerAsnsClientImpl.java @@ -28,7 +28,6 @@ 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.PeerAsnsClient; import com.azure.resourcemanager.peering.fluent.models.PeerAsnInner; import com.azure.resourcemanager.peering.models.PeerAsnListResult; @@ -36,8 +35,6 @@ /** An instance of this class provides access to all the operations defined in PeerAsnsClient. */ public final class PeerAsnsClientImpl implements PeerAsnsClient { - private final ClientLogger logger = new ClientLogger(PeerAsnsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PeerAsnsService service; @@ -127,7 +124,8 @@ Mono> listBySubscriptionNext( * @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 peer ASN with the specified name under the given subscription. + * @return the peer ASN with the specified name under the given subscription along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String peerAsnName) { @@ -169,7 +167,8 @@ private Mono> getWithResponseAsync(String peerAsnName) { * @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 peer ASN with the specified name under the given subscription. + * @return the peer ASN with the specified name under the given subscription along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String peerAsnName, Context context) { @@ -207,19 +206,12 @@ private Mono> getWithResponseAsync(String peerAsnName, Co * @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 peer ASN with the specified name under the given subscription. + * @return the peer ASN with the specified name under the given subscription on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String peerAsnName) { - return getWithResponseAsync(peerAsnName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(peerAsnName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -244,7 +236,7 @@ public PeerAsnInner get(String peerAsnName) { * @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 peer ASN with the specified name under the given subscription. + * @return the peer ASN with the specified name under the given subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String peerAsnName, Context context) { @@ -259,7 +251,8 @@ public Response getWithResponse(String peerAsnName, Context contex * @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 essential information related to the peer's ASN. + * @return the essential information related to the peer's ASN along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String peerAsnName, PeerAsnInner peerAsn) { @@ -308,7 +301,8 @@ private Mono> createOrUpdateWithResponseAsync(String peer * @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 essential information related to the peer's ASN. + * @return the essential information related to the peer's ASN along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -354,19 +348,11 @@ private Mono> createOrUpdateWithResponseAsync( * @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 essential information related to the peer's ASN. + * @return the essential information related to the peer's ASN on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String peerAsnName, PeerAsnInner peerAsn) { - return createOrUpdateWithResponseAsync(peerAsnName, peerAsn) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return createOrUpdateWithResponseAsync(peerAsnName, peerAsn).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -393,7 +379,7 @@ public PeerAsnInner createOrUpdate(String peerAsnName, PeerAsnInner peerAsn) { * @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 essential information related to the peer's ASN. + * @return the essential information related to the peer's ASN along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -408,7 +394,7 @@ public Response createOrUpdateWithResponse( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String peerAsnName) { @@ -450,7 +436,7 @@ private Mono> deleteWithResponseAsync(String peerAsnName) { * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String peerAsnName, Context context) { @@ -488,11 +474,11 @@ private Mono> deleteWithResponseAsync(String peerAsnName, Context * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String peerAsnName) { - return deleteWithResponseAsync(peerAsnName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(peerAsnName).flatMap(ignored -> Mono.empty()); } /** @@ -516,7 +502,7 @@ public void delete(String peerAsnName) { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String peerAsnName, Context context) { @@ -528,7 +514,8 @@ public Response deleteWithResponse(String peerAsnName, Context context) { * * @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 peer ASNs. + * @return the paginated list of peer ASNs along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -574,7 +561,8 @@ private Mono> listSinglePageAsync() { * @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 peer ASNs. + * @return the paginated list of peer ASNs along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -615,7 +603,7 @@ private Mono> listSinglePageAsync(Context context) { * * @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 peer ASNs. + * @return the paginated list of peer ASNs as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -630,7 +618,7 @@ private PagedFlux listAsync() { * @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 peer ASNs. + * @return the paginated list of peer ASNs as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -643,7 +631,7 @@ private PagedFlux listAsync(Context context) { * * @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 peer ASNs. + * @return the paginated list of peer ASNs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -657,7 +645,7 @@ public PagedIterable list() { * @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 peer ASNs. + * @return the paginated list of peer ASNs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -671,7 +659,8 @@ public PagedIterable list(Context context) { * @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 peer ASNs. + * @return the paginated list of peer ASNs along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -708,7 +697,8 @@ private Mono> listBySubscriptionNextSinglePageAsync( * @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 peer ASNs. + * @return the paginated list of peer ASNs along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { 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 bbe273940b48..cf481d198ee7 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.peering.fluent.models.PeerAsnInner; import com.azure.resourcemanager.peering.models.PeerAsn; import com.azure.resourcemanager.peering.models.PeerAsns; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PeerAsnsImpl implements PeerAsns { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerAsnsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PeerAsnsImpl.class); private final PeerAsnsClient innerClient; @@ -70,7 +69,7 @@ public PagedIterable list(Context context) { public PeerAsn getById(String id) { String peerAsnName = Utils.getValueFromIdByName(id, "peerAsns"); if (peerAsnName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerAsns'.", id))); @@ -81,7 +80,7 @@ public PeerAsn getById(String id) { public Response getByIdWithResponse(String id, Context context) { String peerAsnName = Utils.getValueFromIdByName(id, "peerAsns"); if (peerAsnName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerAsns'.", id))); @@ -92,18 +91,18 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String peerAsnName = Utils.getValueFromIdByName(id, "peerAsns"); if (peerAsnName == null) { - throw logger + throw LOGGER .logExceptionAsError( 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) { String peerAsnName = Utils.getValueFromIdByName(id, "peerAsns"); if (peerAsnName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerAsns'.", id))); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringImpl.java index d590f8d0e81d..3a77b5ca1961 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringImpl.java @@ -79,6 +79,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PeeringInner innerModel() { return this.innerObject; } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringLocationsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringLocationsClientImpl.java index b4d4102365b6..1a27cf3fcf4b 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringLocationsClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringLocationsClientImpl.java @@ -25,7 +25,6 @@ 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.PeeringLocationsClient; import com.azure.resourcemanager.peering.fluent.models.PeeringLocationInner; import com.azure.resourcemanager.peering.models.PeeringLocationListResult; @@ -35,8 +34,6 @@ /** An instance of this class provides access to all the operations defined in PeeringLocationsClient. */ public final class PeeringLocationsClientImpl implements PeeringLocationsClient { - private final ClientLogger logger = new ClientLogger(PeeringLocationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PeeringLocationsService service; @@ -93,7 +90,8 @@ Mono> listNext( * @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 locations. + * @return the paginated list of peering locations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -147,7 +145,8 @@ private Mono> listSinglePageAsync( * @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 locations. + * @return the paginated list of peering locations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -197,7 +196,7 @@ private Mono> listSinglePageAsync( * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -213,7 +212,7 @@ private PagedFlux listAsync( * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(PeeringLocationsKind kind) { @@ -231,7 +230,7 @@ private PagedFlux listAsync(PeeringLocationsKind kind) { * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -248,7 +247,7 @@ private PagedFlux listAsync( * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(PeeringLocationsKind kind) { @@ -265,7 +264,7 @@ public PagedIterable list(PeeringLocationsKind kind) { * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -280,7 +279,8 @@ public PagedIterable list( * @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 locations. + * @return the paginated list of peering locations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -316,7 +316,8 @@ private Mono> listNextSinglePageAsync(String * @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 locations. + * @return the paginated list of peering locations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringLocationsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringLocationsImpl.java index 1bbfd5b794eb..7863f8ac1fb6 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringLocationsImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringLocationsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.peering.models.PeeringLocations; import com.azure.resourcemanager.peering.models.PeeringLocationsDirectPeeringType; import com.azure.resourcemanager.peering.models.PeeringLocationsKind; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PeeringLocationsImpl implements PeeringLocations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringLocationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PeeringLocationsImpl.class); private final PeeringLocationsClient innerClient; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientBuilder.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientBuilder.java index ac626dc5337d..8407fb88a8be 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientBuilder.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public PeeringManagementClientBuilder environment(AzureEnvironment environment) } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the PeeringManagementClientBuilder. */ - public PeeringManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public PeeringManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the PeeringManagementClientBuilder. */ - public PeeringManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public PeeringManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -120,27 +119,26 @@ public PeeringManagementClientBuilder serializerAdapter(SerializerAdapter serial * @return an instance of PeeringManagementClientImpl. */ public PeeringManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); PeeringManagementClientImpl client = new PeeringManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringManagementClientImpl.java index 1f10890a52f1..b1bbecd26831 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 @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -22,7 +23,9 @@ 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.ConnectionMonitorTestsClient; import com.azure.resourcemanager.peering.fluent.LegacyPeeringsClient; +import com.azure.resourcemanager.peering.fluent.LookingGlassClient; import com.azure.resourcemanager.peering.fluent.OperationsClient; import com.azure.resourcemanager.peering.fluent.PeerAsnsClient; import com.azure.resourcemanager.peering.fluent.PeeringLocationsClient; @@ -43,15 +46,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the PeeringManagementClientImpl type. */ @ServiceClient(builder = PeeringManagementClientBuilder.class) public final class PeeringManagementClientImpl implements PeeringManagementClient { - private final ClientLogger logger = new ClientLogger(PeeringManagementClientImpl.class); - /** The Azure subscription ID. */ private final String subscriptionId; @@ -160,6 +160,18 @@ public LegacyPeeringsClient getLegacyPeerings() { return this.legacyPeerings; } + /** The LookingGlassClient object to access its operations. */ + private final LookingGlassClient lookingGlass; + + /** + * Gets the LookingGlassClient object to access its operations. + * + * @return the LookingGlassClient object. + */ + public LookingGlassClient getLookingGlass() { + return this.lookingGlass; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -244,6 +256,18 @@ public ReceivedRoutesClient getReceivedRoutes() { return this.receivedRoutes; } + /** The ConnectionMonitorTestsClient object to access its operations. */ + private final ConnectionMonitorTestsClient connectionMonitorTests; + + /** + * Gets the ConnectionMonitorTestsClient object to access its operations. + * + * @return the ConnectionMonitorTestsClient object. + */ + public ConnectionMonitorTestsClient getConnectionMonitorTests() { + return this.connectionMonitorTests; + } + /** The PeeringServiceCountriesClient object to access its operations. */ private final PeeringServiceCountriesClient peeringServiceCountries; @@ -326,10 +350,11 @@ public PeeringServicesClient getPeeringServices() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-01-01"; + this.apiVersion = "2022-06-01"; this.cdnPeeringPrefixes = new CdnPeeringPrefixesClientImpl(this); this.resourceProviders = new ResourceProvidersClientImpl(this); this.legacyPeerings = new LegacyPeeringsClientImpl(this); + this.lookingGlass = new LookingGlassClientImpl(this); this.operations = new OperationsClientImpl(this); this.peerAsns = new PeerAsnsClientImpl(this); this.peeringLocations = new PeeringLocationsClientImpl(this); @@ -337,6 +362,7 @@ public PeeringServicesClient getPeeringServices() { this.registeredPrefixes = new RegisteredPrefixesClientImpl(this); this.peerings = new PeeringsClientImpl(this); this.receivedRoutes = new ReceivedRoutesClientImpl(this); + this.connectionMonitorTests = new ConnectionMonitorTestsClientImpl(this); this.peeringServiceCountries = new PeeringServiceCountriesClientImpl(this); this.peeringServiceLocations = new PeeringServiceLocationsClientImpl(this); this.prefixes = new PrefixesClientImpl(this); @@ -360,10 +386,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -427,7 +450,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -486,4 +509,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(PeeringManagementClientImpl.class); } 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 index dd30bedb8aeb..32c092e9deed 100644 --- 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 @@ -39,6 +39,10 @@ public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PeeringRegisteredAsnInner innerModel() { return this.innerObject; } 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 index 2c35c1ac2b34..dcde1f56812f 100644 --- 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.peering.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner; import com.azure.resourcemanager.peering.models.PeeringRegisteredPrefix; @@ -48,6 +49,10 @@ public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PeeringRegisteredPrefixInner innerModel() { return this.innerObject; } @@ -151,6 +156,16 @@ public PeeringRegisteredPrefix refresh(Context context) { return this; } + public PeeringRegisteredPrefix validate() { + return serviceManager.registeredPrefixes().validate(resourceGroupName, peeringName, registeredPrefixName); + } + + public Response validateWithResponse(Context context) { + return serviceManager + .registeredPrefixes() + .validateWithResponse(resourceGroupName, peeringName, registeredPrefixName, context); + } + 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 index f608089da9e3..f1617bb7b6aa 100644 --- 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 @@ -25,7 +25,6 @@ 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; @@ -33,8 +32,6 @@ /** 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; @@ -87,7 +84,8 @@ Mono> listNext( * * @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. + * @return the paginated list of peering service countries along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -133,7 +131,8 @@ private Mono> listSinglePageAsync() { * @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. + * @return the paginated list of peering service countries along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -174,7 +173,7 @@ private Mono> listSinglePageAsync(Cont * * @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. + * @return the paginated list of peering service countries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -188,7 +187,7 @@ private PagedFlux listAsync() { * @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. + * @return the paginated list of peering service countries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -201,7 +200,7 @@ private PagedFlux listAsync(Context context) { * * @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. + * @return the paginated list of peering service countries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -215,7 +214,7 @@ public PagedIterable list() { * @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. + * @return the paginated list of peering service countries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -229,7 +228,8 @@ public PagedIterable list(Context context) { * @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. + * @return the paginated list of peering service countries along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -265,7 +265,8 @@ private Mono> listNextSinglePageAsync( * @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. + * @return the paginated list of peering service countries along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { 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 index 1ee72e2e2bae..d10b2911d193 100644 --- 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 @@ -11,10 +11,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(PeeringServiceCountriesImpl.class); private final PeeringServiceCountriesClient innerClient; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceImpl.java index 1aa0c5de92de..b374f1855f71 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 @@ -7,6 +7,7 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeeringServiceInner; +import com.azure.resourcemanager.peering.models.LogAnalyticsWorkspaceProperties; import com.azure.resourcemanager.peering.models.PeeringService; import com.azure.resourcemanager.peering.models.PeeringServiceSku; import com.azure.resourcemanager.peering.models.ProvisioningState; @@ -68,6 +69,10 @@ public String providerBackupPeeringLocation() { return this.innerModel().providerBackupPeeringLocation(); } + public LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties() { + return this.innerModel().logAnalyticsWorkspaceProperties(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -76,6 +81,10 @@ public String regionName() { return this.location(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PeeringServiceInner innerModel() { return this.innerObject; } @@ -219,6 +228,12 @@ public PeeringServiceImpl withProviderBackupPeeringLocation(String providerBacku return this; } + public PeeringServiceImpl withLogAnalyticsWorkspaceProperties( + LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties) { + this.innerModel().withLogAnalyticsWorkspaceProperties(logAnalyticsWorkspaceProperties); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsClientImpl.java index 1d7d178816c1..a420891c8084 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 @@ -25,7 +25,6 @@ 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.PeeringServiceLocationsClient; import com.azure.resourcemanager.peering.fluent.models.PeeringServiceLocationInner; import com.azure.resourcemanager.peering.models.PeeringServiceLocationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in PeeringServiceLocationsClient. */ public final class PeeringServiceLocationsClientImpl implements PeeringServiceLocationsClient { - private final ClientLogger logger = new ClientLogger(PeeringServiceLocationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PeeringServiceLocationsService service; @@ -90,7 +87,8 @@ Mono> listNext( * @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. + * @return the paginated list of peering service locations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String country) { @@ -138,7 +136,8 @@ private Mono> listSinglePageAsync(Str * @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. + * @return the paginated list of peering service locations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String country, Context context) { @@ -182,7 +181,7 @@ private Mono> listSinglePageAsync(Str * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String country) { @@ -194,7 +193,7 @@ private PagedFlux listAsync(String country) { * * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -210,7 +209,7 @@ private PagedFlux listAsync() { * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String country, Context context) { @@ -223,7 +222,7 @@ private PagedFlux listAsync(String country, Context * * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -239,7 +238,7 @@ public PagedIterable list() { * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String country, Context context) { @@ -253,7 +252,8 @@ public PagedIterable list(String country, Context c * @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. + * @return the paginated list of peering service locations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -289,7 +289,8 @@ private Mono> listNextSinglePageAsync * @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. + * @return the paginated list of peering service locations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceLocationsImpl.java index 810cb5a2713e..178b33e6c058 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 @@ -11,10 +11,9 @@ import com.azure.resourcemanager.peering.fluent.models.PeeringServiceLocationInner; import com.azure.resourcemanager.peering.models.PeeringServiceLocation; import com.azure.resourcemanager.peering.models.PeeringServiceLocations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PeeringServiceLocationsImpl implements PeeringServiceLocations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceLocationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PeeringServiceLocationsImpl.class); private final PeeringServiceLocationsClient innerClient; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicePrefixImpl.java index a5ad8dc4665e..8fbf1ec5c4ba 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 @@ -65,6 +65,10 @@ public ProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public String resourceGroupName() { + return resourceGroupName; + } + public PeeringServicePrefixInner innerModel() { return this.innerObject; } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProvidersClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProvidersClientImpl.java index e10fbae881e4..2f3b0b1cf074 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProvidersClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProvidersClientImpl.java @@ -25,7 +25,6 @@ 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.PeeringServiceProvidersClient; import com.azure.resourcemanager.peering.fluent.models.PeeringServiceProviderInner; import com.azure.resourcemanager.peering.models.PeeringServiceProviderListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in PeeringServiceProvidersClient. */ public final class PeeringServiceProvidersClientImpl implements PeeringServiceProvidersClient { - private final ClientLogger logger = new ClientLogger(PeeringServiceProvidersClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PeeringServiceProvidersService service; @@ -87,7 +84,8 @@ Mono> listNext( * * @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 providers. + * @return the paginated list of peering service providers along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -133,7 +131,8 @@ private Mono> listSinglePageAsync() { * @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 providers. + * @return the paginated list of peering service providers along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -174,7 +173,7 @@ private Mono> listSinglePageAsync(Con * * @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 providers. + * @return the paginated list of peering service providers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -188,7 +187,7 @@ private PagedFlux listAsync() { * @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 providers. + * @return the paginated list of peering service providers as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -201,7 +200,7 @@ private PagedFlux listAsync(Context context) { * * @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 providers. + * @return the paginated list of peering service providers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -215,7 +214,7 @@ public PagedIterable list() { * @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 providers. + * @return the paginated list of peering service providers as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -229,7 +228,8 @@ public PagedIterable list(Context context) { * @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 providers. + * @return the paginated list of peering service providers along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -265,7 +265,8 @@ private Mono> listNextSinglePageAsync * @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 providers. + * @return the paginated list of peering service providers along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProvidersImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProvidersImpl.java index 5badc1955881..3310bde3975a 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProvidersImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServiceProvidersImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.peering.fluent.models.PeeringServiceProviderInner; import com.azure.resourcemanager.peering.models.PeeringServiceProvider; import com.azure.resourcemanager.peering.models.PeeringServiceProviders; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PeeringServiceProvidersImpl implements PeeringServiceProviders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceProvidersImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PeeringServiceProvidersImpl.class); private final PeeringServiceProvidersClient innerClient; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicesClientImpl.java index 2ccddfa76f19..61fbe4d1217f 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicesClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringServicesClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -29,7 +30,6 @@ 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.PeeringServicesClient; import com.azure.resourcemanager.peering.fluent.models.PeeringServiceInner; import com.azure.resourcemanager.peering.models.PeeringServiceListResult; @@ -38,8 +38,6 @@ /** An instance of this class provides access to all the operations defined in PeeringServicesClient. */ public final class PeeringServicesClientImpl implements PeeringServicesClient { - private final ClientLogger logger = new ClientLogger(PeeringServicesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PeeringServicesService service; @@ -151,6 +149,17 @@ Mono> list( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/initializeConnectionMonitor") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> initializeConnectionMonitor( + @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}) @@ -180,7 +189,8 @@ Mono> listBySubscriptionNext( * @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 peering service with the specified name under the given subscription and resource group. + * @return an existing peering service with the specified name under the given subscription and resource group along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -230,7 +240,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 peering service with the specified name under the given subscription and resource group. + * @return an existing peering service with the specified name under the given subscription and resource group along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -276,19 +287,13 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 peering service with the specified name under the given subscription and resource group. + * @return an existing peering service with the specified name under the given subscription and resource group on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String peeringServiceName) { return getByResourceGroupWithResponseAsync(resourceGroupName, peeringServiceName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -315,7 +320,8 @@ public PeeringServiceInner getByResourceGroup(String resourceGroupName, String p * @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 peering service with the specified name under the given subscription and resource group. + * @return an existing peering service with the specified name under the given subscription and resource group along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -333,7 +339,7 @@ public Response getByResourceGroupWithResponse( * @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 peering Service. + * @return peering Service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -391,7 +397,7 @@ private Mono> createOrUpdateWithResponseAsync( * @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 peering Service. + * @return peering Service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -445,20 +451,13 @@ private Mono> createOrUpdateWithResponseAsync( * @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 peering Service. + * @return peering Service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( String resourceGroupName, String peeringServiceName, PeeringServiceInner peeringService) { return createOrUpdateWithResponseAsync(resourceGroupName, peeringServiceName, peeringService) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -490,7 +489,7 @@ public PeeringServiceInner createOrUpdate( * @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 peering Service. + * @return peering Service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -506,7 +505,7 @@ public Response createOrUpdateWithResponse( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String peeringServiceName) { @@ -555,7 +554,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -601,12 +600,11 @@ private Mono> deleteWithResponseAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String peeringServiceName) { - return deleteWithResponseAsync(resourceGroupName, peeringServiceName) - .flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, peeringServiceName).flatMap(ignored -> Mono.empty()); } /** @@ -632,7 +630,7 @@ public void delete(String resourceGroupName, String peeringServiceName) { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String peeringServiceName, Context context) { @@ -648,7 +646,7 @@ public Response deleteWithResponse(String resourceGroupName, String peerin * @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 peering Service. + * @return peering Service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -705,7 +703,7 @@ private Mono> updateWithResponseAsync( * @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 peering Service. + * @return peering Service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -758,20 +756,13 @@ private Mono> updateWithResponseAsync( * @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 peering Service. + * @return peering Service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, String peeringServiceName, ResourceTags tags) { return updateWithResponseAsync(resourceGroupName, peeringServiceName, tags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -800,7 +791,7 @@ public PeeringServiceInner update(String resourceGroupName, String peeringServic * @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 peering Service. + * @return peering Service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -815,7 +806,8 @@ public Response updateWithResponse( * @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 services. + * @return the paginated list of peering services along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -867,7 +859,8 @@ private Mono> listByResourceGroupSinglePageAs * @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 services. + * @return the paginated list of peering services along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -916,7 +909,7 @@ private Mono> listByResourceGroupSinglePageAs * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -933,7 +926,7 @@ private PagedFlux listByResourceGroupAsync(String resourceG * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -949,7 +942,7 @@ private PagedFlux listByResourceGroupAsync(String resourceG * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -964,7 +957,7 @@ public PagedIterable listByResourceGroup(String resourceGro * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -976,7 +969,8 @@ public PagedIterable listByResourceGroup(String resourceGro * * @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 services. + * @return the paginated list of peering services along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1022,7 +1016,8 @@ private Mono> listSinglePageAsync() { * @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 services. + * @return the paginated list of peering services along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1063,7 +1058,7 @@ private Mono> listSinglePageAsync(Context con * * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1078,7 +1073,7 @@ private PagedFlux listAsync() { * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1091,7 +1086,7 @@ private PagedFlux listAsync(Context context) { * * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1105,13 +1100,119 @@ public PagedIterable list() { * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> initializeConnectionMonitorWithResponseAsync() { + 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 + .initializeConnectionMonitor( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> initializeConnectionMonitorWithResponseAsync(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 + .initializeConnectionMonitor( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono initializeConnectionMonitorAsync() { + return initializeConnectionMonitorWithResponseAsync().flatMap(ignored -> Mono.empty()); + } + + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 initializeConnectionMonitor() { + initializeConnectionMonitorAsync().block(); + } + + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response initializeConnectionMonitorWithResponse(Context context) { + return initializeConnectionMonitorWithResponseAsync(context).block(); + } + /** * Get the next page of items. * @@ -1119,7 +1220,8 @@ public PagedIterable list(Context context) { * @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 services. + * @return the paginated list of peering services along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1156,7 +1258,8 @@ private Mono> listByResourceGroupNextSinglePa * @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 services. + * @return the paginated list of peering services along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -1192,7 +1295,8 @@ private Mono> listByResourceGroupNextSinglePa * @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 services. + * @return the paginated list of peering services along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1229,7 +1333,8 @@ private Mono> listBySubscriptionNextSinglePag * @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 services. + * @return the paginated list of peering services along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync( 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 7c8483ece284..367e467aa757 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.peering.fluent.models.PeeringServiceInner; import com.azure.resourcemanager.peering.models.PeeringService; import com.azure.resourcemanager.peering.models.PeeringServices; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PeeringServicesImpl implements PeeringServices { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PeeringServicesImpl.class); private final PeeringServicesClient innerClient; @@ -80,10 +79,18 @@ public PagedIterable list(Context context) { return Utils.mapPage(inner, inner1 -> new PeeringServiceImpl(inner1, this.manager())); } + public void initializeConnectionMonitor() { + this.serviceClient().initializeConnectionMonitor(); + } + + public Response initializeConnectionMonitorWithResponse(Context context) { + return this.serviceClient().initializeConnectionMonitorWithResponse(context); + } + public PeeringService getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -91,7 +98,7 @@ public PeeringService getById(String id) { } String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); if (peeringServiceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -103,7 +110,7 @@ public PeeringService getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -111,7 +118,7 @@ public Response getByIdWithResponse(String id, Context context) } String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); if (peeringServiceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -123,7 +130,7 @@ public Response getByIdWithResponse(String id, Context context) public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -131,19 +138,19 @@ public void deleteById(String id) { } String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); if (peeringServiceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( 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) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -151,7 +158,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); if (peeringServiceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringsClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringsClientImpl.java index 66e1cf68edd6..324b93ddafa7 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringsClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PeeringsClientImpl.java @@ -29,7 +29,6 @@ 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.PeeringsClient; import com.azure.resourcemanager.peering.fluent.models.PeeringInner; import com.azure.resourcemanager.peering.models.PeeringListResult; @@ -38,8 +37,6 @@ /** An instance of this class provides access to all the operations defined in PeeringsClient. */ public final class PeeringsClientImpl implements PeeringsClient { - private final ClientLogger logger = new ClientLogger(PeeringsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PeeringsService service; @@ -177,7 +174,8 @@ Mono> listBySubscriptionNext( * @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 peering with the specified name under the given subscription and resource group. + * @return an existing peering with the specified name under the given subscription and resource group along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -226,7 +224,8 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 peering with the specified name under the given subscription and resource group. + * @return an existing peering with the specified name under the given subscription and resource group along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -271,19 +270,13 @@ private Mono> getByResourceGroupWithResponseAsync( * @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 peering with the specified name under the given subscription and resource group. + * @return an existing peering with the specified name under the given subscription and resource group on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String peeringName) { return getByResourceGroupWithResponseAsync(resourceGroupName, peeringName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -310,7 +303,8 @@ public PeeringInner getByResourceGroup(String resourceGroupName, String peeringN * @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 peering with the specified name under the given subscription and resource group. + * @return an existing peering with the specified name under the given subscription and resource group along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -328,7 +322,8 @@ public Response getByResourceGroupWithResponse( * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -385,7 +380,8 @@ private Mono> createOrUpdateWithResponseAsync( * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -438,19 +434,13 @@ private Mono> createOrUpdateWithResponseAsync( * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String peeringName, PeeringInner peering) { return createOrUpdateWithResponseAsync(resourceGroupName, peeringName, peering) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -481,7 +471,8 @@ public PeeringInner createOrUpdate(String resourceGroupName, String peeringName, * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -497,7 +488,7 @@ public Response createOrUpdateWithResponse( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String peeringName) { @@ -545,7 +536,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -590,11 +581,11 @@ private Mono> deleteWithResponseAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String peeringName) { - return deleteWithResponseAsync(resourceGroupName, peeringName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(resourceGroupName, peeringName).flatMap(ignored -> Mono.empty()); } /** @@ -620,7 +611,7 @@ public void delete(String resourceGroupName, String peeringName) { * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String peeringName, Context context) { @@ -636,7 +627,8 @@ public Response deleteWithResponse(String resourceGroupName, String peerin * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -692,7 +684,8 @@ private Mono> updateWithResponseAsync( * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location + * along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -744,19 +737,13 @@ private Mono> updateWithResponseAsync( * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String peeringName, ResourceTags tags) { return updateWithResponseAsync(resourceGroupName, peeringName, tags) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -785,7 +772,8 @@ public PeeringInner update(String resourceGroupName, String peeringName, Resourc * @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 peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location. + * @return peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a location + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -800,7 +788,7 @@ public Response updateWithResponse( * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -852,7 +840,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -901,7 +889,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @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. + * @return the paginated list of peerings as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -918,7 +906,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @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. + * @return the paginated list of peerings as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -934,7 +922,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -949,7 +937,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -961,7 +949,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, * * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1007,7 +995,7 @@ private Mono> listSinglePageAsync() { * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1048,7 +1036,7 @@ private Mono> listSinglePageAsync(Context context) { * * @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. + * @return the paginated list of peerings as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1063,7 +1051,7 @@ private PagedFlux listAsync() { * @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. + * @return the paginated list of peerings as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1076,7 +1064,7 @@ private PagedFlux listAsync(Context context) { * * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1090,7 +1078,7 @@ public PagedIterable list() { * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1104,7 +1092,7 @@ public PagedIterable list(Context context) { * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1141,7 +1129,7 @@ private Mono> listByResourceGroupNextSinglePageAsync * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -1176,7 +1164,7 @@ private Mono> listByResourceGroupNextSinglePageAsync * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1213,7 +1201,7 @@ private Mono> listBySubscriptionNextSinglePageAsync( * @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. + * @return the paginated list of peerings along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, 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 0c21b4c6216c..4709e681bf37 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.peering.fluent.models.PeeringInner; import com.azure.resourcemanager.peering.models.Peering; import com.azure.resourcemanager.peering.models.Peerings; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PeeringsImpl implements Peerings { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PeeringsImpl.class); private final PeeringsClient innerClient; @@ -82,7 +81,7 @@ public PagedIterable list(Context context) { public Peering getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -90,7 +89,7 @@ public Peering getById(String id) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); @@ -101,7 +100,7 @@ public Peering getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -109,7 +108,7 @@ public Response getByIdWithResponse(String id, Context context) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); @@ -120,7 +119,7 @@ public Response getByIdWithResponse(String id, Context context) { public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -128,18 +127,18 @@ public void deleteById(String id) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + throw LOGGER .logExceptionAsError( 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) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -147,7 +146,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesClientImpl.java index df6c887e50a1..ff75bdfa2ae3 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 @@ -28,7 +28,6 @@ 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.PrefixesClient; import com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner; import com.azure.resourcemanager.peering.models.PeeringServicePrefixListResult; @@ -36,8 +35,6 @@ /** An instance of this class provides access to all the operations defined in PrefixesClient. */ public final class PrefixesClientImpl implements PrefixesClient { - private final ClientLogger logger = new ClientLogger(PrefixesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PrefixesService service; @@ -149,7 +146,7 @@ Mono> listByPeeringServiceNext( * @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. + * service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -207,7 +204,7 @@ private Mono> getWithResponseAsync( * @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. + * service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -261,20 +258,13 @@ private Mono> getWithResponseAsync( * @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. + * service on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -287,21 +277,14 @@ private Mono getAsync( * @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. + * service on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -334,7 +317,7 @@ public PeeringServicePrefixInner get(String resourceGroupName, String peeringSer * @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. + * service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -352,7 +335,7 @@ public Response getWithResponse( * @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. + * @return the peering service prefix class along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -418,7 +401,7 @@ private Mono> createOrUpdateWithResponseAsyn * @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. + * @return the peering service prefix class along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -481,7 +464,7 @@ private Mono> createOrUpdateWithResponseAsyn * @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. + * @return the peering service prefix class on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -490,14 +473,7 @@ private Mono createOrUpdateAsync( 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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -532,7 +508,7 @@ public PeeringServicePrefixInner createOrUpdate( * @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. + * @return the peering service prefix class along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -556,7 +532,7 @@ public Response createOrUpdateWithResponse( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -612,7 +588,7 @@ private Mono> deleteWithResponseAsync( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -664,12 +640,12 @@ private Mono> deleteWithResponseAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String peeringServiceName, String prefixName) { return deleteWithResponseAsync(resourceGroupName, peeringServiceName, prefixName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -699,7 +675,7 @@ public void delete(String resourceGroupName, String peeringServiceName, String p * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -716,7 +692,8 @@ public Response deleteWithResponse( * @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 peering service prefixes along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringServiceSinglePageAsync( @@ -777,7 +754,8 @@ private Mono> listByPeeringServiceSingl * @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 peering service prefixes along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringServiceSinglePageAsync( @@ -834,7 +812,7 @@ private Mono> listByPeeringServiceSingl * @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 peering service prefixes as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringServiceAsync( @@ -852,7 +830,7 @@ private PagedFlux listByPeeringServiceAsync( * @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 peering service prefixes as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringServiceAsync( @@ -873,7 +851,7 @@ private PagedFlux listByPeeringServiceAsync( * @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 peering service prefixes as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringServiceAsync( @@ -891,7 +869,7 @@ private PagedFlux listByPeeringServiceAsync( * @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 peering service prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeeringService( @@ -910,7 +888,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 peering service prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeeringService( @@ -925,7 +903,8 @@ 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 peering service prefixes along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringServiceNextSinglePageAsync(String nextLink) { @@ -962,7 +941,8 @@ 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 peering service prefixes along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringServiceNextSinglePageAsync( diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/PrefixesImpl.java index 7b6c5a890d2c..145d56546bdb 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner; import com.azure.resourcemanager.peering.models.PeeringServicePrefix; import com.azure.resourcemanager.peering.models.Prefixes; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PrefixesImpl implements Prefixes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrefixesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PrefixesImpl.class); private final PrefixesClient innerClient; @@ -77,7 +76,7 @@ public PagedIterable listByPeeringService( public PeeringServicePrefix getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -85,7 +84,7 @@ public PeeringServicePrefix getById(String id) { } String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); if (peeringServiceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -93,7 +92,7 @@ public PeeringServicePrefix getById(String id) { } String prefixName = Utils.getValueFromIdByName(id, "prefixes"); if (prefixName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); @@ -107,7 +106,7 @@ public PeeringServicePrefix getById(String id) { public Response getByIdWithResponse(String id, String expand, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -115,7 +114,7 @@ public Response getByIdWithResponse(String id, String expa } String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); if (peeringServiceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -123,7 +122,7 @@ public Response getByIdWithResponse(String id, String expa } String prefixName = Utils.getValueFromIdByName(id, "prefixes"); if (prefixName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); @@ -134,7 +133,7 @@ public Response getByIdWithResponse(String id, String expa public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -142,7 +141,7 @@ public void deleteById(String id) { } String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); if (peeringServiceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -150,18 +149,18 @@ public void deleteById(String id) { } String prefixName = Utils.getValueFromIdByName(id, "prefixes"); if (prefixName == null) { - throw logger + 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(); + this.deleteWithResponse(resourceGroupName, peeringServiceName, prefixName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -169,7 +168,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String peeringServiceName = Utils.getValueFromIdByName(id, "peeringServices"); if (peeringServiceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -177,7 +176,7 @@ public Response deleteByIdWithResponse(String id, Context context) { } String prefixName = Utils.getValueFromIdByName(id, "prefixes"); if (prefixName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'prefixes'.", id))); 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 index c966fd5a4fa6..391ce502aa45 100644 --- 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 @@ -25,7 +25,6 @@ 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; @@ -33,8 +32,6 @@ /** 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; @@ -103,7 +100,8 @@ Mono> listByPeeringNext( * @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. + * @return the paginated list of received routes for the peering along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringSinglePageAsync( @@ -177,7 +175,8 @@ private Mono> listByPeeringSinglePageAs * @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. + * @return the paginated list of received routes for the peering along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringSinglePageAsync( @@ -248,7 +247,7 @@ private Mono> listByPeeringSinglePageAs * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringAsync( @@ -280,7 +279,7 @@ private PagedFlux listByPeeringAsync( * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringAsync(String resourceGroupName, String peeringName) { @@ -316,7 +315,7 @@ private PagedFlux listByPeeringAsync(String resourceG * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringAsync( @@ -350,7 +349,7 @@ private PagedFlux listByPeeringAsync( * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeering(String resourceGroupName, String peeringName) { @@ -384,7 +383,7 @@ public PagedIterable listByPeering(String resourceGro * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeering( @@ -415,7 +414,8 @@ public PagedIterable listByPeering( * @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. + * @return the paginated list of received routes for the peering along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringNextSinglePageAsync(String nextLink) { @@ -451,7 +451,8 @@ private Mono> listByPeeringNextSinglePa * @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. + * @return the paginated list of received routes for the peering along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringNextSinglePageAsync( 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 index 0c2ad7795e25..7493b94574e7 100644 --- 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 @@ -11,10 +11,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(ReceivedRoutesImpl.class); private final ReceivedRoutesClient innerClient; 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 index cf90b31f394b..87befa1fdad2 100644 --- 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 @@ -28,7 +28,6 @@ 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; @@ -36,8 +35,6 @@ /** 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; @@ -147,7 +144,7 @@ Mono> listByPeeringNext( * @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. + * peering along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -203,7 +200,7 @@ private Mono> getWithResponseAsync( * @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. + * peering along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -255,20 +252,13 @@ private Mono> getWithResponseAsync( * @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. + * peering on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -299,7 +289,7 @@ public PeeringRegisteredAsnInner get(String resourceGroupName, String peeringNam * @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. + * peering along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -317,7 +307,8 @@ public Response getWithResponse( * @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. + * @return the customer's ASN that is registered by the peering service provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -382,7 +373,8 @@ private Mono> createOrUpdateWithResponseAsyn * @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. + * @return the customer's ASN that is registered by the peering service provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -444,7 +436,8 @@ private Mono> createOrUpdateWithResponseAsyn * @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. + * @return the customer's ASN that is registered by the peering service provider on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -453,14 +446,7 @@ private Mono createOrUpdateAsync( 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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -495,7 +481,7 @@ public PeeringRegisteredAsnInner createOrUpdate( * @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. + * @return the customer's ASN that is registered by the peering service provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -519,7 +505,7 @@ public Response createOrUpdateWithResponse( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -575,7 +561,7 @@ private Mono> deleteWithResponseAsync( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -627,12 +613,12 @@ private Mono> deleteWithResponseAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String peeringName, String registeredAsnName) { return deleteWithResponseAsync(resourceGroupName, peeringName, registeredAsnName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -662,7 +648,7 @@ public void delete(String resourceGroupName, String peeringName, String register * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -678,7 +664,8 @@ public Response deleteWithResponse( * @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. + * @return the paginated list of peering registered ASNs along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringSinglePageAsync( @@ -736,7 +723,8 @@ private Mono> listByPeeringSinglePageAs * @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. + * @return the paginated list of peering registered ASNs along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringSinglePageAsync( @@ -790,7 +778,7 @@ private Mono> listByPeeringSinglePageAs * @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. + * @return the paginated list of peering registered ASNs as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringAsync(String resourceGroupName, String peeringName) { @@ -808,7 +796,7 @@ private PagedFlux listByPeeringAsync(String resourceG * @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. + * @return the paginated list of peering registered ASNs as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringAsync( @@ -826,7 +814,7 @@ private PagedFlux listByPeeringAsync( * @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. + * @return the paginated list of peering registered ASNs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeering(String resourceGroupName, String peeringName) { @@ -842,7 +830,7 @@ public PagedIterable listByPeering(String resourceGro * @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. + * @return the paginated list of peering registered ASNs as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeering( @@ -857,7 +845,8 @@ public PagedIterable listByPeering( * @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. + * @return the paginated list of peering registered ASNs along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringNextSinglePageAsync(String nextLink) { @@ -893,7 +882,8 @@ private Mono> listByPeeringNextSinglePa * @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. + * @return the paginated list of peering registered ASNs along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringNextSinglePageAsync( 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/RegisteredAsnsImpl.java index bc2139090745..76cf6eadbaf8 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/RegisteredAsnsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner; import com.azure.resourcemanager.peering.models.PeeringRegisteredAsn; import com.azure.resourcemanager.peering.models.RegisteredAsns; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class RegisteredAsnsImpl implements RegisteredAsns { - @JsonIgnore private final ClientLogger logger = new ClientLogger(RegisteredAsnsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(RegisteredAsnsImpl.class); private final RegisteredAsnsClient innerClient; @@ -77,7 +76,7 @@ public PagedIterable listByPeering( public PeeringRegisteredAsn getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -85,14 +84,14 @@ public PeeringRegisteredAsn getById(String id) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); } String registeredAsnName = Utils.getValueFromIdByName(id, "registeredAsns"); if (registeredAsnName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -104,7 +103,7 @@ public PeeringRegisteredAsn getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -112,14 +111,14 @@ public Response getByIdWithResponse(String id, Context con } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); } String registeredAsnName = Utils.getValueFromIdByName(id, "registeredAsns"); if (registeredAsnName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -131,7 +130,7 @@ public Response getByIdWithResponse(String id, Context con public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -139,26 +138,26 @@ public void deleteById(String id) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); } String registeredAsnName = Utils.getValueFromIdByName(id, "registeredAsns"); if (registeredAsnName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String .format("The resource ID '%s' is not valid. Missing path segment 'registeredAsns'.", id))); } - this.deleteWithResponse(resourceGroupName, peeringName, registeredAsnName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, peeringName, registeredAsnName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -166,14 +165,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'peerings'.", id))); } String registeredAsnName = Utils.getValueFromIdByName(id, "registeredAsns"); if (registeredAsnName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String 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 index d7713578ad08..4a6b8eccd78c 100644 --- 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 @@ -13,6 +13,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -28,7 +29,6 @@ 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; @@ -36,8 +36,6 @@ /** 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; @@ -126,6 +124,22 @@ Mono> listByPeering( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings" + + "/{peeringName}/registeredPrefixes/{registeredPrefixName}/validate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate( + @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("{nextLink}") @ExpectedResponses({200}) @@ -148,7 +162,7 @@ Mono> listByPeeringNext( * @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. + * peering along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -205,7 +219,7 @@ private Mono> getWithResponseAsync( * @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. + * peering along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -258,20 +272,13 @@ private Mono> getWithResponseAsync( * @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. + * peering on successful completion of {@link Mono}. */ @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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -304,7 +311,7 @@ public PeeringRegisteredPrefixInner get(String resourceGroupName, String 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. * @return an existing registered prefix with the specified name under the given subscription, resource group and - * peering. + * peering along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -322,7 +329,8 @@ public Response getWithResponse( * @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. + * @return the customer's prefix that is registered by the peering service provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -388,7 +396,8 @@ private Mono> createOrUpdateWithResponseA * @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. + * @return the customer's prefix that is registered by the peering service provider along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -451,7 +460,8 @@ private Mono> createOrUpdateWithResponseA * @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. + * @return the customer's prefix that is registered by the peering service provider on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -460,14 +470,7 @@ private Mono createOrUpdateAsync( 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(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -502,7 +505,7 @@ public PeeringRegisteredPrefixInner createOrUpdate( * @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. + * @return the customer's prefix that is registered by the peering service provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -526,7 +529,7 @@ public Response createOrUpdateWithResponse( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -582,7 +585,7 @@ private Mono> deleteWithResponseAsync( * @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. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -634,12 +637,12 @@ private Mono> deleteWithResponseAsync( * @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. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String peeringName, String registeredPrefixName) { return deleteWithResponseAsync(resourceGroupName, peeringName, registeredPrefixName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** @@ -669,7 +672,7 @@ public void delete(String resourceGroupName, String peeringName, String register * @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. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -685,7 +688,8 @@ public Response deleteWithResponse( * @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. + * @return the paginated list of peering registered prefixes along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringSinglePageAsync( @@ -743,7 +747,8 @@ private Mono> listByPeeringSinglePag * @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. + * @return the paginated list of peering registered prefixes along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringSinglePageAsync( @@ -797,7 +802,7 @@ private Mono> listByPeeringSinglePag * @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. + * @return the paginated list of peering registered prefixes as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringAsync(String resourceGroupName, String peeringName) { @@ -815,7 +820,7 @@ private PagedFlux listByPeeringAsync(String resour * @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. + * @return the paginated list of peering registered prefixes as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByPeeringAsync( @@ -833,7 +838,7 @@ private PagedFlux listByPeeringAsync( * @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. + * @return the paginated list of peering registered prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeering(String resourceGroupName, String peeringName) { @@ -849,7 +854,7 @@ public PagedIterable listByPeering(String resource * @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. + * @return the paginated list of peering registered prefixes as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByPeering( @@ -857,6 +862,173 @@ public PagedIterable listByPeering( return new PagedIterable<>(listByPeeringAsync(resourceGroupName, peeringName, context)); } + /** + * Validates 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 customer's prefix that is registered by the peering service provider along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + 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 + .validate( + this.client.getEndpoint(), + resourceGroupName, + peeringName, + registeredPrefixName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates 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 customer's prefix that is registered by the peering service provider along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync( + 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 + .validate( + this.client.getEndpoint(), + resourceGroupName, + peeringName, + registeredPrefixName, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + accept, + context); + } + + /** + * Validates 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 customer's prefix that is registered by the peering service provider on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync( + String resourceGroupName, String peeringName, String registeredPrefixName) { + return validateWithResponseAsync(resourceGroupName, peeringName, registeredPrefixName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates 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 customer's prefix that is registered by the peering service provider. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PeeringRegisteredPrefixInner validate( + String resourceGroupName, String peeringName, String registeredPrefixName) { + return validateAsync(resourceGroupName, peeringName, registeredPrefixName).block(); + } + + /** + * Validates 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 customer's prefix that is registered by the peering service provider along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse( + String resourceGroupName, String peeringName, String registeredPrefixName, Context context) { + return validateWithResponseAsync(resourceGroupName, peeringName, registeredPrefixName, context).block(); + } + /** * Get the next page of items. * @@ -864,7 +1036,8 @@ public PagedIterable listByPeering( * @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. + * @return the paginated list of peering registered prefixes along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringNextSinglePageAsync(String nextLink) { @@ -900,7 +1073,8 @@ private Mono> listByPeeringNextSingl * @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. + * @return the paginated list of peering registered prefixes along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByPeeringNextSinglePageAsync( 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 index 2e2d83d4cd74..ac7fd1eee77a 100644 --- 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 @@ -13,10 +13,9 @@ 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 static final ClientLogger LOGGER = new ClientLogger(RegisteredPrefixesImpl.class); private final RegisteredPrefixesClient innerClient; @@ -75,10 +74,35 @@ public PagedIterable listByPeering( return Utils.mapPage(inner, inner1 -> new PeeringRegisteredPrefixImpl(inner1, this.manager())); } + public PeeringRegisteredPrefix validate(String resourceGroupName, String peeringName, String registeredPrefixName) { + PeeringRegisteredPrefixInner inner = + this.serviceClient().validate(resourceGroupName, peeringName, registeredPrefixName); + if (inner != null) { + return new PeeringRegisteredPrefixImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response validateWithResponse( + String resourceGroupName, String peeringName, String registeredPrefixName, Context context) { + Response inner = + this.serviceClient().validateWithResponse(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 PeeringRegisteredPrefix getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -86,14 +110,14 @@ public PeeringRegisteredPrefix getById(String id) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + 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 + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -106,7 +130,7 @@ public PeeringRegisteredPrefix getById(String id) { public Response getByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -114,14 +138,14 @@ public Response getByIdWithResponse(String id, Context } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + 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 + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -134,7 +158,7 @@ public Response getByIdWithResponse(String id, Context public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -142,27 +166,27 @@ public void deleteById(String id) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + 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 + 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(); + this.deleteWithResponse(resourceGroupName, peeringName, registeredPrefixName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -170,14 +194,14 @@ public Response deleteByIdWithResponse(String id, Context context) { } String peeringName = Utils.getValueFromIdByName(id, "peerings"); if (peeringName == null) { - throw logger + 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 + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ResourceProvidersClientImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ResourceProvidersClientImpl.java index 56a06f36a347..954119315f83 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ResourceProvidersClientImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ResourceProvidersClientImpl.java @@ -22,7 +22,6 @@ 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.ResourceProvidersClient; import com.azure.resourcemanager.peering.models.CheckServiceProviderAvailabilityInput; import com.azure.resourcemanager.peering.models.Enum0; @@ -30,8 +29,6 @@ /** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ public final class ResourceProvidersClientImpl implements ResourceProvidersClient { - private final ClientLogger logger = new ClientLogger(ResourceProvidersClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ResourceProvidersService service; @@ -57,7 +54,7 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien @ServiceInterface(name = "PeeringManagementCli") private interface ResourceProvidersService { @Headers({"Content-Type: application/json"}) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/CheckServiceProviderAvailability") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/checkServiceProviderAvailability") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> checkServiceProviderAvailability( @@ -77,7 +74,7 @@ Mono> checkServiceProviderAvailability( * @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. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkServiceProviderAvailabilityWithResponseAsync( @@ -126,7 +123,7 @@ private Mono> checkServiceProviderAvailabilityWithResponseAsync( * @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. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkServiceProviderAvailabilityWithResponseAsync( @@ -171,20 +168,13 @@ private Mono> checkServiceProviderAvailabilityWithResponseAsync( * @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. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkServiceProviderAvailabilityAsync( CheckServiceProviderAvailabilityInput checkServiceProviderAvailabilityInput) { return checkServiceProviderAvailabilityWithResponseAsync(checkServiceProviderAvailabilityInput) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -212,7 +202,7 @@ public Enum0 checkServiceProviderAvailability( * @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. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkServiceProviderAvailabilityWithResponse( diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ResourceProvidersImpl.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ResourceProvidersImpl.java index 29d6b9272cc7..b6e81d03f51f 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ResourceProvidersImpl.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/implementation/ResourceProvidersImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.peering.models.CheckServiceProviderAvailabilityInput; import com.azure.resourcemanager.peering.models.Enum0; import com.azure.resourcemanager.peering.models.ResourceProviders; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ResourceProvidersImpl implements ResourceProviders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceProvidersImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); private final ResourceProvidersClient innerClient; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/BgpSession.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/BgpSession.java index e285cc76f142..000525fbf8fd 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 @@ -5,15 +5,11 @@ 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 properties that define a BGP session. */ @Fluent public final class BgpSession { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BgpSession.class); - /* * The IPv4 prefix that contains both ends' IPv4 addresses. */ 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 index 59289b141a5f..a6ea3f55657e 100644 --- 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 @@ -5,17 +5,13 @@ 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. */ 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 index b2162b04bbbb..5d3a1fb0d355 100644 --- 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 @@ -16,7 +16,7 @@ public interface CdnPeeringPrefixes { * @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. + * @return the paginated list of CDN peering prefixes as paginated response with {@link PagedIterable}. */ PagedIterable list(String peeringLocation); @@ -28,7 +28,7 @@ public interface CdnPeeringPrefixes { * @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. + * @return the paginated list of CDN peering prefixes as paginated response with {@link PagedIterable}. */ PagedIterable list(String peeringLocation, Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CheckServiceProviderAvailabilityInput.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/CheckServiceProviderAvailabilityInput.java index 8d3a2daae988..d9cf8708fc65 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 @@ -5,15 +5,11 @@ 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; /** Class for CheckServiceProviderAvailabilityInput. */ @Fluent public final class CheckServiceProviderAvailabilityInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckServiceProviderAvailabilityInput.class); - /* * Gets or sets the peering service location. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Command.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Command.java new file mode 100644 index 000000000000..ca6813188d32 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Command.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Command. */ +public final class Command extends ExpandableStringEnum { + /** Static value Traceroute for Command. */ + public static final Command TRACEROUTE = fromString("Traceroute"); + + /** Static value Ping for Command. */ + public static final Command PING = fromString("Ping"); + + /** Static value BgpRoute for Command. */ + public static final Command BGP_ROUTE = fromString("BgpRoute"); + + /** + * Creates or finds a Command from its string representation. + * + * @param name a name to look for. + * @return the corresponding Command. + */ + @JsonCreator + public static Command fromString(String name) { + return fromString(name, Command.class); + } + + /** + * Gets known Command values. + * + * @return known Command values. + */ + public static Collection values() { + return values(Command.class); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionMonitorTest.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionMonitorTest.java new file mode 100644 index 000000000000..c90de28c2256 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionMonitorTest.java @@ -0,0 +1,267 @@ +// 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.ConnectionMonitorTestInner; +import java.util.List; + +/** An immutable client-side representation of ConnectionMonitorTest. */ +public interface ConnectionMonitorTest { + /** + * 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 sourceAgent property: The Connection Monitor test source agent. + * + * @return the sourceAgent value. + */ + String sourceAgent(); + + /** + * Gets the destination property: The Connection Monitor test destination. + * + * @return the destination value. + */ + String destination(); + + /** + * Gets the destinationPort property: The Connection Monitor test destination port. + * + * @return the destinationPort value. + */ + Integer destinationPort(); + + /** + * Gets the testFrequencyInSec property: The Connection Monitor test frequency in seconds. + * + * @return the testFrequencyInSec value. + */ + Integer testFrequencyInSec(); + + /** + * Gets the isTestSuccessful property: The flag that indicates if the Connection Monitor test is successful or not. + * + * @return the isTestSuccessful value. + */ + Boolean isTestSuccessful(); + + /** + * Gets the path property: The path representing the Connection Monitor test. + * + * @return the path value. + */ + List path(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.peering.fluent.models.ConnectionMonitorTestInner object. + * + * @return the inner object. + */ + ConnectionMonitorTestInner innerModel(); + + /** The entirety of the ConnectionMonitorTest definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ConnectionMonitorTest definition stages. */ + interface DefinitionStages { + /** The first stage of the ConnectionMonitorTest definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ConnectionMonitorTest definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, peeringServiceName. + * + * @param resourceGroupName The name of the resource group. + * @param peeringServiceName The name of the peering service. + * @return the next definition stage. + */ + WithCreate withExistingPeeringService(String resourceGroupName, String peeringServiceName); + } + /** + * The stage of the ConnectionMonitorTest 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.WithSourceAgent, + DefinitionStages.WithDestination, + DefinitionStages.WithDestinationPort, + DefinitionStages.WithTestFrequencyInSec { + /** + * Executes the create request. + * + * @return the created resource. + */ + ConnectionMonitorTest create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ConnectionMonitorTest create(Context context); + } + /** The stage of the ConnectionMonitorTest definition allowing to specify sourceAgent. */ + interface WithSourceAgent { + /** + * Specifies the sourceAgent property: The Connection Monitor test source agent. + * + * @param sourceAgent The Connection Monitor test source agent. + * @return the next definition stage. + */ + WithCreate withSourceAgent(String sourceAgent); + } + /** The stage of the ConnectionMonitorTest definition allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: The Connection Monitor test destination. + * + * @param destination The Connection Monitor test destination. + * @return the next definition stage. + */ + WithCreate withDestination(String destination); + } + /** The stage of the ConnectionMonitorTest definition allowing to specify destinationPort. */ + interface WithDestinationPort { + /** + * Specifies the destinationPort property: The Connection Monitor test destination port. + * + * @param destinationPort The Connection Monitor test destination port. + * @return the next definition stage. + */ + WithCreate withDestinationPort(Integer destinationPort); + } + /** The stage of the ConnectionMonitorTest definition allowing to specify testFrequencyInSec. */ + interface WithTestFrequencyInSec { + /** + * Specifies the testFrequencyInSec property: The Connection Monitor test frequency in seconds. + * + * @param testFrequencyInSec The Connection Monitor test frequency in seconds. + * @return the next definition stage. + */ + WithCreate withTestFrequencyInSec(Integer testFrequencyInSec); + } + } + /** + * Begins update for the ConnectionMonitorTest resource. + * + * @return the stage of resource update. + */ + ConnectionMonitorTest.Update update(); + + /** The template for ConnectionMonitorTest update. */ + interface Update + extends UpdateStages.WithSourceAgent, + UpdateStages.WithDestination, + UpdateStages.WithDestinationPort, + UpdateStages.WithTestFrequencyInSec { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ConnectionMonitorTest apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ConnectionMonitorTest apply(Context context); + } + /** The ConnectionMonitorTest update stages. */ + interface UpdateStages { + /** The stage of the ConnectionMonitorTest update allowing to specify sourceAgent. */ + interface WithSourceAgent { + /** + * Specifies the sourceAgent property: The Connection Monitor test source agent. + * + * @param sourceAgent The Connection Monitor test source agent. + * @return the next definition stage. + */ + Update withSourceAgent(String sourceAgent); + } + /** The stage of the ConnectionMonitorTest update allowing to specify destination. */ + interface WithDestination { + /** + * Specifies the destination property: The Connection Monitor test destination. + * + * @param destination The Connection Monitor test destination. + * @return the next definition stage. + */ + Update withDestination(String destination); + } + /** The stage of the ConnectionMonitorTest update allowing to specify destinationPort. */ + interface WithDestinationPort { + /** + * Specifies the destinationPort property: The Connection Monitor test destination port. + * + * @param destinationPort The Connection Monitor test destination port. + * @return the next definition stage. + */ + Update withDestinationPort(Integer destinationPort); + } + /** The stage of the ConnectionMonitorTest update allowing to specify testFrequencyInSec. */ + interface WithTestFrequencyInSec { + /** + * Specifies the testFrequencyInSec property: The Connection Monitor test frequency in seconds. + * + * @param testFrequencyInSec The Connection Monitor test frequency in seconds. + * @return the next definition stage. + */ + Update withTestFrequencyInSec(Integer testFrequencyInSec); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ConnectionMonitorTest refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ConnectionMonitorTest refresh(Context context); +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionMonitorTestListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionMonitorTestListResult.java new file mode 100644 index 000000000000..0e4977feeeb8 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionMonitorTestListResult.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.resourcemanager.peering.fluent.models.ConnectionMonitorTestInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The paginated list of [T]. */ +@Fluent +public final class ConnectionMonitorTestListResult { + /* + * The list of [T]. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The link to fetch the next page of [T]. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: The list of [T]. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of [T]. + * + * @param value the value value to set. + * @return the ConnectionMonitorTestListResult object itself. + */ + public ConnectionMonitorTestListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to fetch the next page of [T]. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to fetch the next page of [T]. + * + * @param nextLink the nextLink value to set. + * @return the ConnectionMonitorTestListResult object itself. + */ + public ConnectionMonitorTestListResult 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/ConnectionMonitorTests.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionMonitorTests.java new file mode 100644 index 000000000000..f4c4055f65b0 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionMonitorTests.java @@ -0,0 +1,158 @@ +// 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 ConnectionMonitorTests. */ +public interface ConnectionMonitorTests { + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service. + */ + ConnectionMonitorTest get(String resourceGroupName, String peeringServiceName, String connectionMonitorTestName); + + /** + * Gets an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connection monitor test with the specified name under the given subscription, resource group + * and peering service along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, Context context); + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 connectionMonitorTestName); + + /** + * Deletes an existing connection monitor test 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 connectionMonitorTestName The name of the connection monitor test. + * @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 {@link Response}. + */ + Response deleteWithResponse( + String resourceGroupName, String peeringServiceName, String connectionMonitorTestName, Context context); + + /** + * Lists all connection monitor tests 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 [T] as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPeeringService(String resourceGroupName, String peeringServiceName); + + /** + * Lists all connection monitor tests 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 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 [T] as paginated response with {@link PagedIterable}. + */ + PagedIterable listByPeeringService( + String resourceGroupName, String peeringServiceName, Context context); + + /** + * Gets an existing connection monitor test 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 connection monitor test with the specified name under the given subscription, resource group + * and peering service along with {@link Response}. + */ + ConnectionMonitorTest getById(String id); + + /** + * Gets an existing connection monitor test 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 an existing connection monitor test with the specified name under the given subscription, resource group + * and peering service along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes an existing connection monitor test 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 connection monitor test 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 {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConnectionMonitorTest resource. + * + * @param name resource name. + * @return the first stage of the new ConnectionMonitorTest definition. + */ + ConnectionMonitorTest.DefinitionStages.Blank define(String name); +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionState.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionState.java index d17a09f1a698..bcba158f3736 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionState.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ConnectionState.java @@ -34,6 +34,12 @@ public final class ConnectionState extends ExpandableStringEnum /** Static value Active for ConnectionState. */ public static final ConnectionState ACTIVE = fromString("Active"); + /** Static value TypeChangeRequested for ConnectionState. */ + public static final ConnectionState TYPE_CHANGE_REQUESTED = fromString("TypeChangeRequested"); + + /** Static value TypeChangeInProgress for ConnectionState. */ + public static final ConnectionState TYPE_CHANGE_IN_PROGRESS = fromString("TypeChangeInProgress"); + /** * Creates or finds a ConnectionState from its string representation. * @@ -45,7 +51,11 @@ public static ConnectionState fromString(String name) { return fromString(name, ConnectionState.class); } - /** @return known ConnectionState values. */ + /** + * Gets known ConnectionState values. + * + * @return known ConnectionState values. + */ public static Collection values() { return values(ConnectionState.class); } 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 index 73276b13ba43..f2ccddb3fcd7 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectConnection.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectConnection.java index f1525cab182d..e87ac74c6cf8 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 @@ -5,15 +5,11 @@ 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 properties that define a direct connection. */ @Fluent public final class DirectConnection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DirectConnection.class); - /* * The bandwidth of the connection. */ @@ -33,22 +29,19 @@ public final class DirectConnection { private SessionAddressProvider sessionAddressProvider; /* - * The flag that indicates whether or not the connection is used for - * peering service. + * The flag that indicates whether or not the connection is used for peering service. */ @JsonProperty(value = "useForPeeringService") private Boolean useForPeeringService; /* - * The ID used within Microsoft's peering provisioning system to track the - * connection + * 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. + * The PeeringDB.com ID of the facility at which the connection has to be set up. */ @JsonProperty(value = "peeringDBFacilityId") private Integer peeringDBFacilityId; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringFacility.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringFacility.java index b396d6ea1f62..a40da96fa4ed 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringFacility.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringFacility.java @@ -5,15 +5,11 @@ 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 properties that define a direct peering facility. */ @Fluent public final class DirectPeeringFacility { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DirectPeeringFacility.class); - /* * The address of the direct peering facility. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringType.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/DirectPeeringType.java index f919a586d09e..f483375eb8dc 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 @@ -28,6 +28,12 @@ public final class DirectPeeringType extends ExpandableStringEnum values() { return values(DirectPeeringType.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Enum0.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Enum0.java index 76c73910ecd8..5bbef42540b4 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Enum0.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Enum0.java @@ -27,7 +27,11 @@ public static Enum0 fromString(String name) { return fromString(name, Enum0.class); } - /** @return known Enum0 values. */ + /** + * Gets known Enum0 values. + * + * @return known Enum0 values. + */ public static Collection values() { return values(Enum0.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangeConnection.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangeConnection.java index a0fd9eca4f84..2e33ecf0f092 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 @@ -5,18 +5,13 @@ 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 properties that define an exchange connection. */ @Fluent public final class ExchangeConnection { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExchangeConnection.class); - /* - * The PeeringDB.com ID of the facility at which the connection has to be - * set up. + * The PeeringDB.com ID of the facility at which the connection has to be set up. */ @JsonProperty(value = "peeringDBFacilityId") private Integer peeringDBFacilityId; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangePeeringFacility.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangePeeringFacility.java index b90bd8db9877..279b024bd01c 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangePeeringFacility.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ExchangePeeringFacility.java @@ -5,15 +5,11 @@ 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 properties that define an exchange peering facility. */ @Fluent public final class ExchangePeeringFacility { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ExchangePeeringFacility.class); - /* * The name of the exchange peering facility. */ @@ -21,8 +17,7 @@ public final class ExchangePeeringFacility { private String exchangeName; /* - * The bandwidth of the connection between Microsoft and the exchange - * peering facility. + * The bandwidth of the connection between Microsoft and the exchange peering facility. */ @JsonProperty(value = "bandwidthInMbps") private Integer bandwidthInMbps; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Family.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Family.java index e8b8a5a0ed9a..326b4d851d58 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Family.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Family.java @@ -27,7 +27,11 @@ public static Family fromString(String name) { return fromString(name, Family.class); } - /** @return known Family values. */ + /** + * Gets known Family values. + * + * @return known Family values. + */ public static Collection values() { return values(Family.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Kind.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Kind.java index f803b94cb2f3..1a608ef26155 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Kind.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Kind.java @@ -27,7 +27,11 @@ public static Kind fromString(String name) { return fromString(name, Kind.class); } - /** @return known Kind values. */ + /** + * Gets known Kind values. + * + * @return known Kind values. + */ public static Collection values() { return values(Kind.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LearnedType.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LearnedType.java index a80433c8327d..842a4d2c0e75 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 @@ -30,7 +30,11 @@ public static LearnedType fromString(String name) { return fromString(name, LearnedType.class); } - /** @return known LearnedType values. */ + /** + * Gets known LearnedType values. + * + * @return known LearnedType values. + */ public static Collection values() { return values(LearnedType.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeerings.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeerings.java index f41687314042..ed950019efad 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 @@ -17,7 +17,7 @@ public interface LegacyPeerings { * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ PagedIterable list(String peeringLocation, LegacyPeeringsKind kind); @@ -27,11 +27,17 @@ 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 directPeeringType The direct peering type. * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ - PagedIterable list(String peeringLocation, LegacyPeeringsKind kind, Integer asn, Context context); + PagedIterable list( + String peeringLocation, + LegacyPeeringsKind kind, + Integer asn, + DirectPeeringType directPeeringType, + Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeeringsKind.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeeringsKind.java index 740c35f38e41..d33c421abd9b 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeeringsKind.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LegacyPeeringsKind.java @@ -27,7 +27,11 @@ public static LegacyPeeringsKind fromString(String name) { return fromString(name, LegacyPeeringsKind.class); } - /** @return known LegacyPeeringsKind values. */ + /** + * Gets known LegacyPeeringsKind values. + * + * @return known LegacyPeeringsKind values. + */ public static Collection values() { return values(LegacyPeeringsKind.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LogAnalyticsWorkspaceProperties.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LogAnalyticsWorkspaceProperties.java new file mode 100644 index 000000000000..d27698c90ac9 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LogAnalyticsWorkspaceProperties.java @@ -0,0 +1,66 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties that define a Log Analytics Workspace. */ +@Immutable +public final class LogAnalyticsWorkspaceProperties { + /* + * The Workspace ID. + */ + @JsonProperty(value = "workspaceID", access = JsonProperty.Access.WRITE_ONLY) + private String workspaceId; + + /* + * The Workspace Key. + */ + @JsonProperty(value = "key", access = JsonProperty.Access.WRITE_ONLY) + private String key; + + /* + * The list of connected agents. + */ + @JsonProperty(value = "connectedAgents", access = JsonProperty.Access.WRITE_ONLY) + private List connectedAgents; + + /** + * Get the workspaceId property: The Workspace ID. + * + * @return the workspaceId value. + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Get the key property: The Workspace Key. + * + * @return the key value. + */ + public String key() { + return this.key; + } + + /** + * Get the connectedAgents property: The list of connected agents. + * + * @return the connectedAgents value. + */ + public List connectedAgents() { + return this.connectedAgents; + } + + /** + * 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/LookingGlass.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlass.java new file mode 100644 index 000000000000..99c939b697de --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlass.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.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of LookingGlass. */ +public interface LookingGlass { + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model. + */ + LookingGlassOutput invoke( + LookingGlassCommand command, LookingGlassSourceType sourceType, String sourceLocation, String destinationIp); + + /** + * Run looking glass functionality. + * + * @param command The command to be executed: ping, traceroute, bgpRoute. + * @param sourceType The type of the source: Edge site or Azure Region. + * @param sourceLocation The location of the source. + * @param destinationIp The IP address of the destination. + * @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 looking glass output model along with {@link Response}. + */ + Response invokeWithResponse( + LookingGlassCommand command, + LookingGlassSourceType sourceType, + String sourceLocation, + String destinationIp, + Context context); +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassCommand.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassCommand.java new file mode 100644 index 000000000000..0517ecc2b98c --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassCommand.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LookingGlassCommand. */ +public final class LookingGlassCommand extends ExpandableStringEnum { + /** Static value Traceroute for LookingGlassCommand. */ + public static final LookingGlassCommand TRACEROUTE = fromString("Traceroute"); + + /** Static value Ping for LookingGlassCommand. */ + public static final LookingGlassCommand PING = fromString("Ping"); + + /** Static value BgpRoute for LookingGlassCommand. */ + public static final LookingGlassCommand BGP_ROUTE = fromString("BgpRoute"); + + /** + * Creates or finds a LookingGlassCommand from its string representation. + * + * @param name a name to look for. + * @return the corresponding LookingGlassCommand. + */ + @JsonCreator + public static LookingGlassCommand fromString(String name) { + return fromString(name, LookingGlassCommand.class); + } + + /** + * Gets known LookingGlassCommand values. + * + * @return known LookingGlassCommand values. + */ + public static Collection values() { + return values(LookingGlassCommand.class); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassOutput.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassOutput.java new file mode 100644 index 000000000000..db881d4292ba --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassOutput.java @@ -0,0 +1,31 @@ +// 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.LookingGlassOutputInner; + +/** An immutable client-side representation of LookingGlassOutput. */ +public interface LookingGlassOutput { + /** + * Gets the command property: Invoked command. + * + * @return the command value. + */ + Command command(); + + /** + * Gets the output property: Output of the command. + * + * @return the output value. + */ + String output(); + + /** + * Gets the inner com.azure.resourcemanager.peering.fluent.models.LookingGlassOutputInner object. + * + * @return the inner object. + */ + LookingGlassOutputInner innerModel(); +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassSourceType.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassSourceType.java new file mode 100644 index 000000000000..51583ee804ac --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/LookingGlassSourceType.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.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for LookingGlassSourceType. */ +public final class LookingGlassSourceType extends ExpandableStringEnum { + /** Static value EdgeSite for LookingGlassSourceType. */ + public static final LookingGlassSourceType EDGE_SITE = fromString("EdgeSite"); + + /** Static value AzureRegion for LookingGlassSourceType. */ + public static final LookingGlassSourceType AZURE_REGION = fromString("AzureRegion"); + + /** + * Creates or finds a LookingGlassSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding LookingGlassSourceType. + */ + @JsonCreator + public static LookingGlassSourceType fromString(String name) { + return fromString(name, LookingGlassSourceType.class); + } + + /** + * Gets known LookingGlassSourceType values. + * + * @return known LookingGlassSourceType values. + */ + public static Collection values() { + return values(LookingGlassSourceType.class); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/MetricDimension.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/MetricDimension.java new file mode 100644 index 000000000000..1094739c1c9f --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/MetricDimension.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.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Dimensions of the metric. */ +@Immutable +public final class MetricDimension { + /* + * Name of the dimension. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Localized friendly display name of the dimension. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /** + * Get the name property: Name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: Localized friendly display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * 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/MetricSpecification.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/MetricSpecification.java new file mode 100644 index 000000000000..17e5b0fedbb6 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/MetricSpecification.java @@ -0,0 +1,130 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifications of the Metrics for Azure Monitoring. */ +@Immutable +public final class MetricSpecification { + /* + * Name of the metric. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Localized friendly display name of the metric. + */ + @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) + private String displayName; + + /* + * Localized friendly description of the metric. + */ + @JsonProperty(value = "displayDescription", access = JsonProperty.Access.WRITE_ONLY) + private String displayDescription; + + /* + * Unit that makes sense for the metric. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /* + * Aggregation type will be set to one of the values: Average, Minimum, Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType", access = JsonProperty.Access.WRITE_ONLY) + private String aggregationType; + + /* + * Supported time grain types for the metric. + */ + @JsonProperty(value = "supportedTimeGrainTypes", access = JsonProperty.Access.WRITE_ONLY) + private List supportedTimeGrainTypes; + + /* + * Dimensions of the metric. + */ + @JsonProperty(value = "dimensions", access = JsonProperty.Access.WRITE_ONLY) + private List dimensions; + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: Localized friendly display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the displayDescription property: Localized friendly description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Get the unit property: Unit that makes sense for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Get the aggregationType property: Aggregation type will be set to one of the values: Average, Minimum, Maximum, + * Total, Count. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Get the supportedTimeGrainTypes property: Supported time grain types for the metric. + * + * @return the supportedTimeGrainTypes value. + */ + public List supportedTimeGrainTypes() { + return this.supportedTimeGrainTypes; + } + + /** + * Get the dimensions property: Dimensions of the metric. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Operation.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Operation.java index 37e6ba4d7543..dc2a15a83aa7 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Operation.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Operation.java @@ -29,6 +29,13 @@ public interface Operation { */ Boolean isDataAction(); + /** + * Gets the serviceSpecification property: Service specification payload. + * + * @return the serviceSpecification value. + */ + ServiceSpecification serviceSpecification(); + /** * Gets the inner com.azure.resourcemanager.peering.fluent.models.OperationInner object. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/OperationDisplayInfo.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/OperationDisplayInfo.java index 4f2b502131f2..5b41d898e709 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/OperationDisplayInfo.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/OperationDisplayInfo.java @@ -5,15 +5,11 @@ 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; /** The information related to the operation. */ @Immutable public final class OperationDisplayInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplayInfo.class); - /* * The name of the resource provider. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/OperationListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/OperationListResult.java index f5397a6a3c91..5c9f88569ca2 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/OperationListResult.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/OperationListResult.java @@ -5,17 +5,13 @@ 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.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The paginated list of peering API operations. */ @Fluent public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * The list of peering API operations. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Operations.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Operations.java index c09167cf50fb..5580d5dad577 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Operations.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @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 API operations. + * @return the paginated list of peering API operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @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 API operations. + * @return the paginated list of peering API operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsn.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsn.java index 7f376692e5d8..1326ec158d5b 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 @@ -88,8 +88,7 @@ interface Blank extends WithCreate { interface WithCreate extends DefinitionStages.WithPeerAsn, DefinitionStages.WithPeerContactDetail, - DefinitionStages.WithPeerName, - DefinitionStages.WithValidationState { + DefinitionStages.WithPeerName { /** * Executes the create request. * @@ -135,16 +134,6 @@ interface WithPeerName { */ WithCreate withPeerName(String peerName); } - /** The stage of the PeerAsn definition allowing to specify validationState. */ - interface WithValidationState { - /** - * Specifies the validationState property: The validation state of the ASN associated with the peer.. - * - * @param validationState The validation state of the ASN associated with the peer. - * @return the next definition stage. - */ - WithCreate withValidationState(ValidationState validationState); - } } /** * Begins update for the PeerAsn resource. @@ -154,11 +143,7 @@ interface WithValidationState { PeerAsn.Update update(); /** The template for PeerAsn update. */ - interface Update - extends UpdateStages.WithPeerAsn, - UpdateStages.WithPeerContactDetail, - UpdateStages.WithPeerName, - UpdateStages.WithValidationState { + interface Update extends UpdateStages.WithPeerAsn, UpdateStages.WithPeerContactDetail, UpdateStages.WithPeerName { /** * Executes the update request. * @@ -206,16 +191,6 @@ interface WithPeerName { */ Update withPeerName(String peerName); } - /** The stage of the PeerAsn update allowing to specify validationState. */ - interface WithValidationState { - /** - * Specifies the validationState property: The validation state of the ASN associated with the peer.. - * - * @param validationState The validation state of the ASN associated with the peer. - * @return the next definition stage. - */ - Update withValidationState(ValidationState validationState); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsnListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsnListResult.java index e78c575edafb..7b35756df842 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsnListResult.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsnListResult.java @@ -5,17 +5,13 @@ 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.PeerAsnInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The paginated list of peer ASNs. */ @Fluent public final class PeerAsnListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeerAsnListResult.class); - /* * The list of peer ASNs. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsns.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsns.java index a192acdc729f..df033230ac2e 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsns.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeerAsns.java @@ -29,7 +29,7 @@ public interface PeerAsns { * @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 peer ASN with the specified name under the given subscription. + * @return the peer ASN with the specified name under the given subscription along with {@link Response}. */ Response getWithResponse(String peerAsnName, Context context); @@ -51,7 +51,7 @@ public interface PeerAsns { * @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. + * @return the {@link Response}. */ Response deleteWithResponse(String peerAsnName, Context context); @@ -60,7 +60,7 @@ public interface PeerAsns { * * @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 peer ASNs. + * @return the paginated list of peer ASNs as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -71,7 +71,7 @@ public interface PeerAsns { * @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 peer ASNs. + * @return the paginated list of peer ASNs as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -82,7 +82,7 @@ public interface PeerAsns { * @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 peer ASN with the specified name under the given subscription. + * @return the peer ASN with the specified name under the given subscription along with {@link Response}. */ PeerAsn getById(String id); @@ -94,7 +94,7 @@ public interface PeerAsns { * @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 peer ASN with the specified name under the given subscription. + * @return the peer ASN with the specified name under the given subscription along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -116,7 +116,7 @@ public interface PeerAsns { * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Peering.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Peering.java index bd0f5712ce46..f2a2d707a31c 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Peering.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Peering.java @@ -102,6 +102,13 @@ public interface Peering { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringInner object. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringBandwidthOffer.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringBandwidthOffer.java index 525d2f09f92e..3ebeb87c4c57 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringBandwidthOffer.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringBandwidthOffer.java @@ -5,15 +5,11 @@ 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 properties that define a peering bandwidth offer. */ @Fluent public final class PeeringBandwidthOffer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringBandwidthOffer.class); - /* * The name of the bandwidth offer. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringListResult.java index e40e5457ce10..ac3800b38ac2 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringListResult.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringListResult.java @@ -5,17 +5,13 @@ 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.PeeringInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The paginated list of peerings. */ @Fluent public final class PeeringListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringListResult.class); - /* * The list of peerings. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationListResult.java index 1cd4c918f61b..664be3d311b0 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationListResult.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationListResult.java @@ -5,17 +5,13 @@ 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.PeeringLocationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The paginated list of peering locations. */ @Fluent public final class PeeringLocationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringLocationListResult.class); - /* * The list of peering locations. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationPropertiesDirect.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationPropertiesDirect.java index cf58f366bd44..71873aefa1e4 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationPropertiesDirect.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationPropertiesDirect.java @@ -5,16 +5,12 @@ 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 properties that define a direct peering location. */ @Fluent public final class PeeringLocationPropertiesDirect { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringLocationPropertiesDirect.class); - /* * The list of direct peering facilities at the peering location. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationPropertiesExchange.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationPropertiesExchange.java index 1cbaada2a4ac..a59e0d07977d 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationPropertiesExchange.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationPropertiesExchange.java @@ -5,16 +5,12 @@ 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 properties that define an exchange peering location. */ @Fluent public final class PeeringLocationPropertiesExchange { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringLocationPropertiesExchange.class); - /* * The list of exchange peering facilities at the peering location. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocations.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocations.java index 2628f5048fa6..272c6b81a1e5 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocations.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocations.java @@ -16,7 +16,7 @@ public interface PeeringLocations { * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedIterable}. */ PagedIterable list(PeeringLocationsKind kind); @@ -29,7 +29,7 @@ public interface PeeringLocations { * @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 locations. + * @return the paginated list of peering locations as paginated response with {@link PagedIterable}. */ PagedIterable list( PeeringLocationsKind kind, PeeringLocationsDirectPeeringType directPeeringType, Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsDirectPeeringType.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsDirectPeeringType.java index 69a0bb7b0010..210e6dcf1f95 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 @@ -28,6 +28,12 @@ public final class PeeringLocationsDirectPeeringType extends ExpandableStringEnu /** Static value IxRs for PeeringLocationsDirectPeeringType. */ public static final PeeringLocationsDirectPeeringType IX_RS = fromString("IxRs"); + /** Static value Voice for PeeringLocationsDirectPeeringType. */ + public static final PeeringLocationsDirectPeeringType VOICE = fromString("Voice"); + + /** Static value EdgeZoneForOperators for PeeringLocationsDirectPeeringType. */ + public static final PeeringLocationsDirectPeeringType EDGE_ZONE_FOR_OPERATORS = fromString("EdgeZoneForOperators"); + /** * Creates or finds a PeeringLocationsDirectPeeringType from its string representation. * @@ -39,7 +45,11 @@ public static PeeringLocationsDirectPeeringType fromString(String name) { return fromString(name, PeeringLocationsDirectPeeringType.class); } - /** @return known PeeringLocationsDirectPeeringType values. */ + /** + * Gets known PeeringLocationsDirectPeeringType values. + * + * @return known PeeringLocationsDirectPeeringType values. + */ public static Collection values() { return values(PeeringLocationsDirectPeeringType.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsKind.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsKind.java index ee9102c416b4..4396aaef7fa9 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsKind.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringLocationsKind.java @@ -27,7 +27,11 @@ public static PeeringLocationsKind fromString(String name) { return fromString(name, PeeringLocationsKind.class); } - /** @return known PeeringLocationsKind values. */ + /** + * Gets known PeeringLocationsKind values. + * + * @return known PeeringLocationsKind values. + */ public static Collection values() { return values(PeeringLocationsKind.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesDirect.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesDirect.java index eb302c8bdbfc..0b0a1334336d 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 @@ -6,16 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The properties that define a direct peering. */ @Fluent public final class PeeringPropertiesDirect { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringPropertiesDirect.class); - /* * The set of connections that constitute a direct peering. */ @@ -23,8 +19,7 @@ public final class PeeringPropertiesDirect { private List connections; /* - * The flag that indicates whether or not the peering is used for peering - * service. + * The flag that indicates whether or not the peering is used for peering service. */ @JsonProperty(value = "useForPeeringService", access = JsonProperty.Access.WRITE_ONLY) private Boolean useForPeeringService; diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesExchange.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesExchange.java index ee7b08f8af44..1c0867c623c0 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesExchange.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringPropertiesExchange.java @@ -6,16 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.SubResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The properties that define an exchange peering. */ @Fluent public final class PeeringPropertiesExchange { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringPropertiesExchange.class); - /* * The set of connections that constitute an exchange peering. */ 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 index 1b1b4fbecce8..2427c91fcb0c 100644 --- 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 @@ -5,17 +5,13 @@ 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. */ 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 index fe1a0fab361a..ab425fb5017a 100644 --- 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 @@ -51,6 +51,13 @@ public interface PeeringRegisteredAsn { */ ProvisioningState provisioningState(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredAsnInner object. * 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 index eb41f52b5d86..07a243140d93 100644 --- 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 @@ -5,17 +5,13 @@ 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. */ 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 index bd2aaebc8bf1..103635f62161 100644 --- 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 @@ -4,6 +4,7 @@ package com.azure.resourcemanager.peering.models; +import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner; @@ -65,6 +66,13 @@ public interface PeeringRegisteredPrefix { */ ProvisioningState provisioningState(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringRegisteredPrefixInner object. * @@ -174,4 +182,26 @@ interface WithPrefix { * @return the refreshed resource. */ PeeringRegisteredPrefix refresh(Context context); + + /** + * Validates an existing registered prefix with the specified name under the given subscription, resource group and + * 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. + * @return the customer's prefix that is registered by the peering service provider. + */ + PeeringRegisteredPrefix validate(); + + /** + * Validates an existing registered prefix with the specified name under the given subscription, resource group and + * 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 customer's prefix that is registered by the peering service provider along with {@link Response}. + */ + Response validateWithResponse(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 index 01e646f232ed..e7df77f01aa0 100644 --- 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 @@ -5,17 +5,13 @@ 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. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringService.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringService.java index 672b02e966d0..a7ec14702fcd 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 @@ -90,6 +90,13 @@ public interface PeeringService { */ String providerBackupPeeringLocation(); + /** + * Gets the logAnalyticsWorkspaceProperties property: The Log Analytics Workspace Properties. + * + * @return the logAnalyticsWorkspaceProperties value. + */ + LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties(); + /** * Gets the region of the resource. * @@ -104,6 +111,13 @@ public interface PeeringService { */ String regionName(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringServiceInner object. * @@ -161,7 +175,8 @@ interface WithCreate DefinitionStages.WithPeeringServiceLocation, DefinitionStages.WithPeeringServiceProvider, DefinitionStages.WithProviderPrimaryPeeringLocation, - DefinitionStages.WithProviderBackupPeeringLocation { + DefinitionStages.WithProviderBackupPeeringLocation, + DefinitionStages.WithLogAnalyticsWorkspaceProperties { /** * Executes the create request. * @@ -241,6 +256,17 @@ interface WithProviderBackupPeeringLocation { */ WithCreate withProviderBackupPeeringLocation(String providerBackupPeeringLocation); } + /** The stage of the PeeringService definition allowing to specify logAnalyticsWorkspaceProperties. */ + interface WithLogAnalyticsWorkspaceProperties { + /** + * Specifies the logAnalyticsWorkspaceProperties property: The Log Analytics Workspace Properties. + * + * @param logAnalyticsWorkspaceProperties The Log Analytics Workspace Properties. + * @return the next definition stage. + */ + WithCreate withLogAnalyticsWorkspaceProperties( + LogAnalyticsWorkspaceProperties logAnalyticsWorkspaceProperties); + } } /** * 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 index a35743bf6cad..8b8a7cb16846 100644 --- 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 @@ -14,7 +14,7 @@ public interface PeeringServiceCountries { * * @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. + * @return the paginated list of peering service countries as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface PeeringServiceCountries { * @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. + * @return the paginated list of peering service countries as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } 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 index bc4ad9e60cf4..6dfa594f4687 100644 --- 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 @@ -5,17 +5,13 @@ 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. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceListResult.java index 1613758bbdda..606b7caa43e1 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceListResult.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceListResult.java @@ -5,17 +5,13 @@ 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.PeeringServiceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The paginated list of peering services. */ @Fluent public final class PeeringServiceListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceListResult.class); - /* * The list of peering services. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocationListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocationListResult.java index a47a823bdb9d..6898512ee5c2 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocationListResult.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocationListResult.java @@ -5,17 +5,13 @@ 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.PeeringServiceLocationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The paginated list of peering service locations. */ @Fluent public final class PeeringServiceLocationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceLocationListResult.class); - /* * The list of peering service locations. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocations.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceLocations.java index d56158e7fa02..1e92eca2b151 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 @@ -14,7 +14,7 @@ public interface PeeringServiceLocations { * * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -26,7 +26,7 @@ public interface PeeringServiceLocations { * @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. + * @return the paginated list of peering service locations as paginated response with {@link PagedIterable}. */ PagedIterable list(String country, Context context); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefix.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefix.java index e61d63a8dfad..c586cdfa9865 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 @@ -80,6 +80,13 @@ public interface PeeringServicePrefix { */ ProvisioningState provisioningState(); + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + /** * Gets the inner com.azure.resourcemanager.peering.fluent.models.PeeringServicePrefixInner object. * 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 index 6c5ea697a8c8..3fbcdd295ed6 100644 --- 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 @@ -5,16 +5,12 @@ 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. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServicePrefixListResult.java index c425a81c843a..a5113d1ab4b3 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 @@ -5,17 +5,13 @@ 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.PeeringServicePrefixInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The paginated list of peering service prefixes. */ @Fluent public final class PeeringServicePrefixListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServicePrefixListResult.class); - /* * The list of peering service prefixes. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProviderListResult.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProviderListResult.java index 340e726eb31d..df69dba449b6 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProviderListResult.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProviderListResult.java @@ -5,17 +5,13 @@ 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.PeeringServiceProviderInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The paginated list of peering service providers. */ @Fluent public final class PeeringServiceProviderListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringServiceProviderListResult.class); - /* * The list of peering service providers. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProviders.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProviders.java index fb4edbe09d4e..7bdf40ae2fe2 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProviders.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServiceProviders.java @@ -14,7 +14,7 @@ public interface PeeringServiceProviders { * * @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 providers. + * @return the paginated list of peering service providers as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface PeeringServiceProviders { * @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 providers. + * @return the paginated list of peering service providers as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } 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 index 5330d6be5d90..60104f5fc5c2 100644 --- 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 @@ -5,15 +5,11 @@ 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. */ diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServices.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServices.java index 9166c4e27722..31079c6e9645 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServices.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringServices.java @@ -31,7 +31,8 @@ public interface PeeringServices { * @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 peering service with the specified name under the given subscription and resource group. + * @return an existing peering service with the specified name under the given subscription and resource group along + * with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String peeringServiceName, Context context); @@ -56,7 +57,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String peeringServiceName, Context context); @@ -67,7 +68,7 @@ Response getByResourceGroupWithResponse( * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -79,7 +80,7 @@ Response getByResourceGroupWithResponse( * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -88,7 +89,7 @@ Response getByResourceGroupWithResponse( * * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -99,10 +100,29 @@ Response getByResourceGroupWithResponse( * @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 services. + * @return the paginated list of peering services as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 initializeConnectionMonitor(); + + /** + * Initialize Peering Service for Connection Monitor functionality. + * + * @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 {@link Response}. + */ + Response initializeConnectionMonitorWithResponse(Context context); + /** * Gets an existing peering service with the specified name under the given subscription and resource group. * @@ -110,7 +130,8 @@ Response getByResourceGroupWithResponse( * @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 peering service with the specified name under the given subscription and resource group. + * @return an existing peering service with the specified name under the given subscription and resource group along + * with {@link Response}. */ PeeringService getById(String id); @@ -122,7 +143,8 @@ Response getByResourceGroupWithResponse( * @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 peering service with the specified name under the given subscription and resource group. + * @return an existing peering service with the specified name under the given subscription and resource group along + * with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -144,7 +166,7 @@ Response getByResourceGroupWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringSku.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PeeringSku.java index 1abe50536382..a852830f2ec6 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 @@ -5,15 +5,11 @@ 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 tier and kind of the peering. */ @Fluent public final class PeeringSku { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PeeringSku.class); - /* * The name of the peering SKU. */ @@ -23,19 +19,19 @@ public final class PeeringSku { /* * The tier of the peering SKU. */ - @JsonProperty(value = "tier") + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) private Tier tier; /* * The family of the peering SKU. */ - @JsonProperty(value = "family") + @JsonProperty(value = "family", access = JsonProperty.Access.WRITE_ONLY) private Family family; /* * The size of the peering SKU. */ - @JsonProperty(value = "size") + @JsonProperty(value = "size", access = JsonProperty.Access.WRITE_ONLY) private Size size; /** @@ -67,17 +63,6 @@ public Tier tier() { return this.tier; } - /** - * Set the tier property: The tier of the peering SKU. - * - * @param tier the tier value to set. - * @return the PeeringSku object itself. - */ - public PeeringSku withTier(Tier tier) { - this.tier = tier; - return this; - } - /** * Get the family property: The family of the peering SKU. * @@ -87,17 +72,6 @@ public Family family() { return this.family; } - /** - * Set the family property: The family of the peering SKU. - * - * @param family the family value to set. - * @return the PeeringSku object itself. - */ - public PeeringSku withFamily(Family family) { - this.family = family; - return this; - } - /** * Get the size property: The size of the peering SKU. * @@ -107,17 +81,6 @@ public Size size() { return this.size; } - /** - * Set the size property: The size of the peering SKU. - * - * @param size the size value to set. - * @return the PeeringSku object itself. - */ - public PeeringSku withSize(Size size) { - this.size = size; - return this; - } - /** * Validates the instance. * diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Peerings.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Peerings.java index b0bee129f0a5..24f2c0224249 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Peerings.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Peerings.java @@ -31,7 +31,8 @@ public interface Peerings { * @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 peering with the specified name under the given subscription and resource group. + * @return an existing peering with the specified name under the given subscription and resource group along with + * {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String peeringName, Context context); @@ -55,7 +56,7 @@ public interface Peerings { * @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. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String peeringName, Context context); @@ -66,7 +67,7 @@ public interface Peerings { * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -78,7 +79,7 @@ public interface Peerings { * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -87,7 +88,7 @@ public interface Peerings { * * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -98,7 +99,7 @@ public interface Peerings { * @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. + * @return the paginated list of peerings as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -109,7 +110,8 @@ public interface Peerings { * @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 peering with the specified name under the given subscription and resource group. + * @return an existing peering with the specified name under the given subscription and resource group along with + * {@link Response}. */ Peering getById(String id); @@ -121,7 +123,8 @@ public interface Peerings { * @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 peering with the specified name under the given subscription and resource group. + * @return an existing peering with the specified name under the given subscription and resource group along with + * {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -143,7 +146,7 @@ public interface Peerings { * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PrefixValidationState.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/PrefixValidationState.java index 0d546fb46990..b3379a373125 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 @@ -42,7 +42,11 @@ public static PrefixValidationState fromString(String name) { return fromString(name, PrefixValidationState.class); } - /** @return known PrefixValidationState values. */ + /** + * Gets known PrefixValidationState values. + * + * @return known PrefixValidationState values. + */ public static Collection values() { return values(PrefixValidationState.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Prefixes.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Prefixes.java index 60efd24e0bff..a85a209ebed1 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Prefixes.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Prefixes.java @@ -36,7 +36,7 @@ public interface Prefixes { * @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. + * service along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String peeringServiceName, String prefixName, String expand, Context context); @@ -65,7 +65,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String peeringServiceName, String prefixName, Context context); @@ -78,7 +78,7 @@ Response deleteWithResponse( * @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 peering service prefixes as paginated response with {@link PagedIterable}. */ PagedIterable listByPeeringService(String resourceGroupName, String peeringServiceName); @@ -92,7 +92,7 @@ Response deleteWithResponse( * @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 peering service prefixes as paginated response with {@link PagedIterable}. */ PagedIterable listByPeeringService( String resourceGroupName, String peeringServiceName, String expand, Context context); @@ -105,7 +105,7 @@ PagedIterable listByPeeringService( * @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. + * service along with {@link Response}. */ PeeringServicePrefix getById(String id); @@ -119,7 +119,7 @@ PagedIterable listByPeeringService( * @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. + * service along with {@link Response}. */ Response getByIdWithResponse(String id, String expand, Context context); @@ -143,7 +143,7 @@ PagedIterable listByPeeringService( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ProvisioningState.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ProvisioningState.java index 0d98df9ca1b3..be7858003d99 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ProvisioningState.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ProvisioningState.java @@ -33,7 +33,11 @@ public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } - /** @return known ProvisioningState values. */ + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ public static Collection values() { return values(ProvisioningState.class); } 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 index 9389aed4d6c0..c9ce1536962f 100644 --- 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 @@ -17,7 +17,7 @@ public interface ReceivedRoutes { * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedIterable}. */ PagedIterable listByPeering(String resourceGroupName, String peeringName); @@ -35,7 +35,7 @@ public interface ReceivedRoutes { * @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. + * @return the paginated list of received routes for the peering as paginated response with {@link PagedIterable}. */ PagedIterable listByPeering( String resourceGroupName, 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 index 10266f355e17..00cb03ba9012 100644 --- 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 @@ -35,7 +35,7 @@ public interface RegisteredAsns { * @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. + * peering along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String peeringName, String registeredAsnName, Context context); @@ -64,7 +64,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String peeringName, String registeredAsnName, Context context); @@ -77,7 +77,7 @@ Response deleteWithResponse( * @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. + * @return the paginated list of peering registered ASNs as paginated response with {@link PagedIterable}. */ PagedIterable listByPeering(String resourceGroupName, String peeringName); @@ -90,7 +90,7 @@ Response deleteWithResponse( * @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. + * @return the paginated list of peering registered ASNs as paginated response with {@link PagedIterable}. */ PagedIterable listByPeering(String resourceGroupName, String peeringName, Context context); @@ -102,7 +102,7 @@ Response deleteWithResponse( * @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. + * peering along with {@link Response}. */ PeeringRegisteredAsn getById(String id); @@ -115,7 +115,7 @@ Response deleteWithResponse( * @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. + * peering along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -139,7 +139,7 @@ Response deleteWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); 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 index 3a315626c335..806f06bcd5c7 100644 --- 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 @@ -37,7 +37,7 @@ public interface RegisteredPrefixes { * @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. + * peering along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String peeringName, String registeredPrefixName, Context context); @@ -66,7 +66,7 @@ Response getWithResponse( * @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. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String peeringName, String registeredPrefixName, Context context); @@ -79,7 +79,7 @@ Response deleteWithResponse( * @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. + * @return the paginated list of peering registered prefixes as paginated response with {@link PagedIterable}. */ PagedIterable listByPeering(String resourceGroupName, String peeringName); @@ -92,10 +92,40 @@ Response deleteWithResponse( * @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. + * @return the paginated list of peering registered prefixes as paginated response with {@link PagedIterable}. */ PagedIterable listByPeering(String resourceGroupName, String peeringName, Context context); + /** + * Validates 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 the customer's prefix that is registered by the peering service provider. + */ + PeeringRegisteredPrefix validate(String resourceGroupName, String peeringName, String registeredPrefixName); + + /** + * Validates 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 customer's prefix that is registered by the peering service provider along with {@link Response}. + */ + Response validateWithResponse( + String resourceGroupName, String peeringName, String registeredPrefixName, Context context); + /** * Gets an existing registered prefix with the specified name under the given subscription, resource group and * peering. @@ -105,7 +135,7 @@ Response deleteWithResponse( * @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. + * peering along with {@link Response}. */ PeeringRegisteredPrefix getById(String id); @@ -119,7 +149,7 @@ Response deleteWithResponse( * @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. + * peering along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -143,7 +173,7 @@ Response deleteWithResponse( * @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. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ResourceProviders.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ResourceProviders.java index dfe3423e1217..7e8471c1369e 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ResourceProviders.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ResourceProviders.java @@ -30,7 +30,7 @@ public interface ResourceProviders { * @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. + * @return the response body along with {@link Response}. */ Response checkServiceProviderAvailabilityWithResponse( CheckServiceProviderAvailabilityInput checkServiceProviderAvailabilityInput, Context context); 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 58861fff4f6a..1c7bbd0eb466 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 @@ -5,20 +5,18 @@ 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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** The resource tags. */ @Fluent public final class ResourceTags { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceTags.class); - /* * 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 index 7bb91ac9ca26..938b077fdc7f 100644 --- 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 @@ -39,7 +39,11 @@ public static Role fromString(String name) { return fromString(name, Role.class); } - /** @return known Role values. */ + /** + * Gets known Role values. + * + * @return known Role values. + */ public static Collection values() { return values(Role.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ServiceSpecification.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ServiceSpecification.java new file mode 100644 index 000000000000..26294d071b09 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ServiceSpecification.java @@ -0,0 +1,39 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Service specification payload. */ +@Immutable +public final class ServiceSpecification { + /* + * Specifications of the Metrics for Azure Monitoring. + */ + @JsonProperty(value = "metricSpecifications", access = JsonProperty.Access.WRITE_ONLY) + private List metricSpecifications; + + /** + * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionAddressProvider.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionAddressProvider.java index 8fec6c8a037f..12e7ff13685f 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionAddressProvider.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionAddressProvider.java @@ -27,7 +27,11 @@ public static SessionAddressProvider fromString(String name) { return fromString(name, SessionAddressProvider.class); } - /** @return known SessionAddressProvider values. */ + /** + * Gets known SessionAddressProvider values. + * + * @return known SessionAddressProvider values. + */ public static Collection values() { return values(SessionAddressProvider.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionStateV4.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionStateV4.java index 36c40fca4442..f9c3bd9ad6a8 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionStateV4.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionStateV4.java @@ -54,7 +54,11 @@ public static SessionStateV4 fromString(String name) { return fromString(name, SessionStateV4.class); } - /** @return known SessionStateV4 values. */ + /** + * Gets known SessionStateV4 values. + * + * @return known SessionStateV4 values. + */ public static Collection values() { return values(SessionStateV4.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionStateV6.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionStateV6.java index 0c76eb25a21f..3aabc985cf26 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionStateV6.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/SessionStateV6.java @@ -54,7 +54,11 @@ public static SessionStateV6 fromString(String name) { return fromString(name, SessionStateV6.class); } - /** @return known SessionStateV6 values. */ + /** + * Gets known SessionStateV6 values. + * + * @return known SessionStateV6 values. + */ public static Collection values() { return values(SessionStateV6.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Size.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Size.java index c15388e1caf5..d4b7fe7e39f4 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Size.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Size.java @@ -30,7 +30,11 @@ public static Size fromString(String name) { return fromString(name, Size.class); } - /** @return known Size values. */ + /** + * Gets known Size values. + * + * @return known Size values. + */ public static Collection values() { return values(Size.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Tier.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Tier.java index aa1399cd136d..ecd090bf1eef 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Tier.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/Tier.java @@ -27,7 +27,11 @@ public static Tier fromString(String name) { return fromString(name, Tier.class); } - /** @return known Tier values. */ + /** + * Gets known Tier values. + * + * @return known Tier values. + */ public static Collection values() { return values(Tier.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ValidationState.java b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ValidationState.java index a3e98a33fa9c..ea0b07d32e23 100644 --- a/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ValidationState.java +++ b/sdk/peering/azure-resourcemanager-peering/src/main/java/com/azure/resourcemanager/peering/models/ValidationState.java @@ -33,7 +33,11 @@ public static ValidationState fromString(String name) { return fromString(name, ValidationState.class); } - /** @return known ValidationState values. */ + /** + * Gets known ValidationState values. + * + * @return known ValidationState values. + */ public static Collection values() { return values(ValidationState.class); } diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/CdnPeeringPrefixesListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/CdnPeeringPrefixesListSamples.java new file mode 100644 index 000000000000..2fc4cec9db2a --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/CdnPeeringPrefixesListSamples.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 CdnPeeringPrefixes List. */ +public final class CdnPeeringPrefixesListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListCdnPeeringPrefixes.json + */ + /** + * Sample code: List all the cdn peering prefixes advertised at a particular peering location. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllTheCdnPeeringPrefixesAdvertisedAtAParticularPeeringLocation( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.cdnPeeringPrefixes().list("peeringLocation0", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsCreateOrUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..155918b3a34f --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsCreateOrUpdateSamples.java @@ -0,0 +1,28 @@ +// 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 ConnectionMonitorTests CreateOrUpdate. */ +public final class ConnectionMonitorTestsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/CreateOrUpdateConnectionMonitorTest.json + */ + /** + * Sample code: Create or Update Connection Monitor Test. + * + * @param manager Entry point to PeeringManager. + */ + public static void createOrUpdateConnectionMonitorTest(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .connectionMonitorTests() + .define("connectionMonitorTestName") + .withExistingPeeringService("rgName", "peeringServiceName") + .withSourceAgent("Example Source Agent") + .withDestination("Example Destination") + .withDestinationPort(443) + .withTestFrequencyInSec(30) + .create(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsDeleteSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsDeleteSamples.java new file mode 100644 index 000000000000..37739dea1240 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsDeleteSamples.java @@ -0,0 +1,24 @@ +// 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 ConnectionMonitorTests Delete. */ +public final class ConnectionMonitorTestsDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/DeleteConnectionMonitorTest.json + */ + /** + * Sample code: Delete Connection Monitor Test. + * + * @param manager Entry point to PeeringManager. + */ + public static void deleteConnectionMonitorTest(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .connectionMonitorTests() + .deleteWithResponse("rgName", "peeringServiceName", "connectionMonitorTestName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsGetSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsGetSamples.java new file mode 100644 index 000000000000..d5d616ce1c1b --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsGetSamples.java @@ -0,0 +1,24 @@ +// 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 ConnectionMonitorTests Get. */ +public final class ConnectionMonitorTestsGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/GetConnectionMonitorTest.json + */ + /** + * Sample code: Get Connection Monitor Test. + * + * @param manager Entry point to PeeringManager. + */ + public static void getConnectionMonitorTest(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .connectionMonitorTests() + .getWithResponse("rgName", "peeringServiceName", "connectionMonitorTestName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsListByPeeringServiceSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsListByPeeringServiceSamples.java new file mode 100644 index 000000000000..44a1123991e6 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ConnectionMonitorTestsListByPeeringServiceSamples.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 ConnectionMonitorTests ListByPeeringService. */ +public final class ConnectionMonitorTestsListByPeeringServiceSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListConnectionMonitorTestsByPeeringService.json + */ + /** + * Sample code: List all Connection Monitor Tests associated with the peering service. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllConnectionMonitorTestsAssociatedWithThePeeringService( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.connectionMonitorTests().listByPeeringService("rgName", "peeringServiceName", Context.NONE); + } +} 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 000000000000..c051b524a200 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/LegacyPeeringsListSamples.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; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.peering.models.DirectPeeringType; +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/stable/2022-06-01/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, null, DirectPeeringType.EDGE, Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/LookingGlassInvokeSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/LookingGlassInvokeSamples.java new file mode 100644 index 000000000000..bf381205109a --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/LookingGlassInvokeSamples.java @@ -0,0 +1,31 @@ +// 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.LookingGlassCommand; +import com.azure.resourcemanager.peering.models.LookingGlassSourceType; + +/** Samples for LookingGlass Invoke. */ +public final class LookingGlassInvokeSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/LookingGlassInvokeCommand.json + */ + /** + * Sample code: Call looking glass to execute a command. + * + * @param manager Entry point to PeeringManager. + */ + public static void callLookingGlassToExecuteACommand(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .lookingGlass() + .invokeWithResponse( + LookingGlassCommand.TRACEROUTE, + LookingGlassSourceType.AZURE_REGION, + "West US", + "0.0.0.0", + 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 000000000000..39508e2cfcb5 --- /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/stable/2022-06-01/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 000000000000..9669a951b8e5 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeerAsnsCreateOrUpdateSamples.java @@ -0,0 +1,44 @@ +// 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.ContactDetail; +import com.azure.resourcemanager.peering.models.Role; +import java.util.Arrays; + +/** Samples for PeerAsns CreateOrUpdate. */ +public final class PeerAsnsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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("peerAsnName") + .withPeerAsn(65000) + .withPeerContactDetail( + Arrays + .asList( + new ContactDetail() + .withRole(Role.NOC) + .withEmail("noc@contoso.com") + .withPhone("+1 (234) 567-8999"), + new ContactDetail() + .withRole(Role.POLICY) + .withEmail("abc@contoso.com") + .withPhone("+1 (234) 567-8900"), + new ContactDetail() + .withRole(Role.TECHNICAL) + .withEmail("xyz@contoso.com") + .withPhone("+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 000000000000..455113ad0a66 --- /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/stable/2022-06-01/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("peerAsnName", 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 000000000000..505582695f20 --- /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/stable/2022-06-01/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("peerAsnName", 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 000000000000..d789c6228b5c --- /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/stable/2022-06-01/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 000000000000..936d108a72a2 --- /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/stable/2022-06-01/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/stable/2022-06-01/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/PeeringServiceCountriesListSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServiceCountriesListSamples.java new file mode 100644 index 000000000000..242dc86c90bd --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServiceCountriesListSamples.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 PeeringServiceCountries List. */ +public final class PeeringServiceCountriesListSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListPeeringServiceCountriesBySubscription.json + */ + /** + * Sample code: List peering service countries. + * + * @param manager Entry point to PeeringManager. + */ + public static void listPeeringServiceCountries(com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServiceCountries().list(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 000000000000..d801dfb6e81f --- /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/stable/2022-06-01/examples/ListPeeringServiceLocationsBySubscription.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(null, 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 000000000000..5cae56475f29 --- /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/stable/2022-06-01/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 000000000000..8982e3163a2e --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// 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/stable/2022-06-01/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("peeringServiceName") + .withRegion("eastus") + .withExistingResourceGroup("rgName") + .withPeeringServiceLocation("state1") + .withPeeringServiceProvider("serviceProvider1") + .withProviderPrimaryPeeringLocation("peeringLocation1") + .withProviderBackupPeeringLocation("peeringLocation2") + .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 000000000000..6daa6a6498bd --- /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/stable/2022-06-01/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("rgName", "peeringServiceName", 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 000000000000..4067dae4c821 --- /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/stable/2022-06-01/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("rgName", "peeringServiceName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesInitializeConnectionMonitorSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesInitializeConnectionMonitorSamples.java new file mode 100644 index 000000000000..c5e792a23b44 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringServicesInitializeConnectionMonitorSamples.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 PeeringServices InitializeConnectionMonitor. */ +public final class PeeringServicesInitializeConnectionMonitorSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/InitializeConnectionMonitor.json + */ + /** + * Sample code: Initialize Peering Service for Connection Monitor functionality. + * + * @param manager Entry point to PeeringManager. + */ + public static void initializePeeringServiceForConnectionMonitorFunctionality( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.peeringServices().initializeConnectionMonitorWithResponse(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 000000000000..c1f67fdb587a --- /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/stable/2022-06-01/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("rgName", 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 000000000000..d7d279c9e7bc --- /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/stable/2022-06-01/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 000000000000..caf17ad4b8e8 --- /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/stable/2022-06-01/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("rgName", "peeringServiceName", 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 000000000000..e70474bd1ccb --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PeeringsCreateOrUpdateSamples.java @@ -0,0 +1,155 @@ +// 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.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/stable/2022-06-01/examples/CreatePeeringWithExchangeRouteServer.json + */ + /** + * Sample code: Create a peering with exchange route server. + * + * @param manager Entry point to PeeringManager. + */ + public static void createAPeeringWithExchangeRouteServer(com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .peerings() + .define("peeringName") + .withRegion("eastus") + .withExistingResourceGroup("rgName") + .withSku(new PeeringSku().withName("Premium_Direct_Free")) + .withKind(Kind.DIRECT) + .withDirect( + new PeeringPropertiesDirect() + .withConnections( + Arrays + .asList( + new DirectConnection() + .withBandwidthInMbps(10000) + .withSessionAddressProvider(SessionAddressProvider.PEER) + .withUseForPeeringService(true) + .withPeeringDBFacilityId(99999) + .withBgpSession( + new BgpSession() + .withSessionPrefixV4("192.168.0.0/24") + .withMicrosoftSessionIPv4Address("192.168.0.123") + .withPeerSessionIPv4Address("192.168.0.234") + .withMaxPrefixesAdvertisedV4(1000) + .withMaxPrefixesAdvertisedV6(100)) + .withConnectionIdentifier("5F4CB5C7-6B43-4444-9338-9ABC72606C16"))) + .withPeerAsn( + new SubResource().withId("/subscriptions/subId/providers/Microsoft.Peering/peerAsns/myAsn1")) + .withDirectPeeringType(DirectPeeringType.IX_RS)) + .withPeeringLocation("peeringLocation0") + .create(); + } + + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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("peeringName") + .withRegion("eastus") + .withExistingResourceGroup("rgName") + .withSku(new PeeringSku().withName("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/stable/2022-06-01/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("peeringName") + .withRegion("eastus") + .withExistingResourceGroup("rgName") + .withSku(new PeeringSku().withName("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) + .withConnectionIdentifier("8AB00818-D533-4504-A25A-03A17F61201C"))) + .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 000000000000..4bf8812778f4 --- /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/stable/2022-06-01/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("rgName", "peeringName", 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 000000000000..0ad39ac89fe4 --- /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/stable/2022-06-01/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("rgName", "peeringName", 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 000000000000..88934742355a --- /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/stable/2022-06-01/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("rgName", 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 000000000000..3468c464f874 --- /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/stable/2022-06-01/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 000000000000..2dfcc6aa2b1a --- /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/stable/2022-06-01/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("rgName", "peeringName", 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/PrefixesCreateOrUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b419c2ca3f3b --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesCreateOrUpdateSamples.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 Prefixes CreateOrUpdate. */ +public final class PrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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 + .prefixes() + .define("peeringServicePrefixName") + .withExistingPeeringService("rgName", "peeringServiceName") + .withPrefix("192.168.1.0/24") + .withPeeringServicePrefixKey("00000000-0000-0000-0000-000000000000") + .create(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesDeleteSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesDeleteSamples.java new file mode 100644 index 000000000000..34db4470370a --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesDeleteSamples.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 Delete. */ +public final class PrefixesDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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.prefixes().deleteWithResponse("rgName", "peeringServiceName", "peeringServicePrefixName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesGetSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesGetSamples.java new file mode 100644 index 000000000000..ec707f98be98 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/PrefixesGetSamples.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 Prefixes Get. */ +public final class PrefixesGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/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 + .prefixes() + .getWithResponse("rgName", "peeringServiceName", "peeringServicePrefixName", null, Context.NONE); + } +} 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 000000000000..2298e450a8cb --- /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/stable/2022-06-01/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("rgName", "peeringServiceName", null, Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ReceivedRoutesListByPeeringSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ReceivedRoutesListByPeeringSamples.java new file mode 100644 index 000000000000..51ef8a9af222 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/ReceivedRoutesListByPeeringSamples.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; + +import com.azure.core.util.Context; + +/** Samples for ReceivedRoutes ListByPeering. */ +public final class ReceivedRoutesListByPeeringSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/GetPeeringReceivedRoutes.json + */ + /** + * Sample code: Lists the prefixes received over the specified peering under the given subscription and resource + * group. + * + * @param manager Entry point to PeeringManager. + */ + public static void listsThePrefixesReceivedOverTheSpecifiedPeeringUnderTheGivenSubscriptionAndResourceGroup( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .receivedRoutes() + .listByPeering("rgName", "peeringName", "1.1.1.0/24", "123 456", "Valid", "Valid", null, Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsCreateOrUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..13faac8925f8 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsCreateOrUpdateSamples.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 RegisteredAsns CreateOrUpdate. */ +public final class RegisteredAsnsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/CreateRegisteredAsn.json + */ + /** + * Sample code: Create or update a registered ASN for the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void createOrUpdateARegisteredASNForThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .registeredAsns() + .define("registeredAsnName") + .withExistingPeering("rgName", "peeringName") + .withAsn(65000) + .create(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsDeleteSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsDeleteSamples.java new file mode 100644 index 000000000000..f73c81a1f9ce --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsDeleteSamples.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 RegisteredAsns Delete. */ +public final class RegisteredAsnsDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/DeleteRegisteredAsn.json + */ + /** + * Sample code: Deletes a registered ASN associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void deletesARegisteredASNAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredAsns().deleteWithResponse("rgName", "peeringName", "registeredAsnName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsGetSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsGetSamples.java new file mode 100644 index 000000000000..574b1bbe66cf --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsGetSamples.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 RegisteredAsns Get. */ +public final class RegisteredAsnsGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/GetRegisteredAsn.json + */ + /** + * Sample code: Get a registered ASN associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void getARegisteredASNAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredAsns().getWithResponse("rgName", "peeringName", "registeredAsnName0", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsListByPeeringSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsListByPeeringSamples.java new file mode 100644 index 000000000000..144579697608 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredAsnsListByPeeringSamples.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 RegisteredAsns ListByPeering. */ +public final class RegisteredAsnsListByPeeringSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListRegisteredAsnsByPeering.json + */ + /** + * Sample code: List all the registered ASNs associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllTheRegisteredASNsAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredAsns().listByPeering("rgName", "peeringName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesCreateOrUpdateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2973477b6575 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesCreateOrUpdateSamples.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 RegisteredPrefixes CreateOrUpdate. */ +public final class RegisteredPrefixesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/CreateRegisteredPrefix.json + */ + /** + * Sample code: Create or update a registered prefix for the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void createOrUpdateARegisteredPrefixForThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .registeredPrefixes() + .define("registeredPrefixName") + .withExistingPeering("rgName", "peeringName") + .withPrefix("10.22.20.0/24") + .create(); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesDeleteSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesDeleteSamples.java new file mode 100644 index 000000000000..68226b0294c7 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesDeleteSamples.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 RegisteredPrefixes Delete. */ +public final class RegisteredPrefixesDeleteSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/DeleteRegisteredPrefix.json + */ + /** + * Sample code: Deletes a registered prefix associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void deletesARegisteredPrefixAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredPrefixes().deleteWithResponse("rgName", "peeringName", "registeredPrefixName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesGetSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesGetSamples.java new file mode 100644 index 000000000000..91b9f347c1de --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesGetSamples.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 RegisteredPrefixes Get. */ +public final class RegisteredPrefixesGetSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/GetRegisteredPrefix.json + */ + /** + * Sample code: Get a registered prefix associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void getARegisteredPrefixAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredPrefixes().getWithResponse("rgName", "peeringName", "registeredPrefixName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesListByPeeringSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesListByPeeringSamples.java new file mode 100644 index 000000000000..9fe612279de8 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesListByPeeringSamples.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 RegisteredPrefixes ListByPeering. */ +public final class RegisteredPrefixesListByPeeringSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ListRegisteredPrefixesByPeering.json + */ + /** + * Sample code: List all the registered prefixes associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void listAllTheRegisteredPrefixesAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager.registeredPrefixes().listByPeering("rgName", "peeringName", Context.NONE); + } +} diff --git a/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesValidateSamples.java b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesValidateSamples.java new file mode 100644 index 000000000000..75440c7a12f6 --- /dev/null +++ b/sdk/peering/azure-resourcemanager-peering/src/samples/java/com/azure/resourcemanager/peering/generated/RegisteredPrefixesValidateSamples.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 RegisteredPrefixes Validate. */ +public final class RegisteredPrefixesValidateSamples { + /* + * x-ms-original-file: specification/peering/resource-manager/Microsoft.Peering/stable/2022-06-01/examples/ValidateRegisteredPrefix.json + */ + /** + * Sample code: Validate a registered prefix associated with the peering. + * + * @param manager Entry point to PeeringManager. + */ + public static void validateARegisteredPrefixAssociatedWithThePeering( + com.azure.resourcemanager.peering.PeeringManager manager) { + manager + .registeredPrefixes() + .validateWithResponse("rgName", "peeringName", "registeredPrefixName", 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 000000000000..e274b532f906 --- /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/stable/2022-06-01/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); + } +}