From 70d66507e204d411557c310391a4fdaa43c6f24b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 25 Mar 2022 08:06:50 +0000 Subject: [PATCH] CodeGen from PR 18388 in Azure/azure-rest-api-specs Merge ee1eb71945e8d4afec0086d3c2ac99f790cd66ec into 202149c96d7e5cdd07cdcbc138309142b55321ad --- .../CHANGELOG.md | 3 +- .../README.md | 5 +- .../SAMPLE.md | 544 ++++++++++++++++++ .../pom.xml | 98 ++-- .../DelegatedNetworkManager.java | 44 +- .../fluent/ControllersClient.java | 20 +- .../fluent/DelegatedNetworksClient.java | 10 +- .../fluent/DelegatedSubnetServicesClient.java | 34 +- .../fluent/OperationsClient.java | 6 +- .../OrchestratorInstanceServicesClient.java | 53 +- .../models/DelegatedControllerInner.java | 92 +-- .../fluent/models/DelegatedSubnetInner.java | 86 ++- .../models/DelegatedSubnetProperties.java | 111 ++++ .../fluent/models/OperationInner.java | 6 +- .../fluent/models/OrchestratorInner.java | 203 +------ .../implementation/ControllersClientImpl.java | 78 +-- .../implementation/ControllersImpl.java | 19 +- .../DelegatedControllerImpl.java | 22 +- .../DelegatedNetworksClientImpl.java | 45 +- .../implementation/DelegatedNetworksImpl.java | 3 +- .../DelegatedSubnetServicesClientImpl.java | 138 +++-- .../DelegatedSubnetServicesImpl.java | 19 +- .../implementation/DncImpl.java | 6 +- .../implementation/OperationsClientImpl.java | 27 +- .../implementation/OperationsImpl.java | 3 +- .../implementation/OrchestratorImpl.java | 64 +-- ...rchestratorInstanceServicesClientImpl.java | 211 ++++--- .../OrchestratorInstanceServicesImpl.java | 36 +- .../models/ControllerDetails.java | 4 - .../models/ControllerResource.java | 8 +- .../ControllerResourceUpdateParameters.java | 6 +- .../delegatednetwork/models/Controllers.java | 6 +- .../models/DelegatedController.java | 34 +- .../models/DelegatedControllerProperties.java | 96 ++++ .../models/DelegatedControllers.java | 7 +- .../models/DelegatedNetworks.java | 10 +- .../models/DelegatedSubnetResource.java | 8 +- .../models/DelegatedSubnetServices.java | 14 +- .../models/DelegatedSubnets.java | 7 +- .../models/ErrorAdditionalInfo.java | 54 -- .../models/OperationDisplay.java | 4 - .../models/OperationListResult.java | 4 - .../delegatednetwork/models/Operations.java | 6 +- .../delegatednetwork/models/Orchestrator.java | 130 +---- .../models/OrchestratorIdentity.java | 4 - .../models/OrchestratorInstanceServices.java | 38 +- .../models/OrchestratorResource.java | 7 +- .../OrchestratorResourceProperties.java | 223 +++++++ .../OrchestratorResourceUpdateParameters.java | 6 +- .../models/Orchestrators.java | 7 +- .../models/ResourceUpdateParameters.java | 6 +- .../models/SubnetDetails.java | 4 - .../generated/ControllerCreateSamples.java | 25 + .../generated/ControllerDeleteSamples.java | 22 + .../ControllerGetByResourceGroupSamples.java | 23 + .../generated/ControllerPatchSamples.java | 38 ++ ...atedNetworkListByResourceGroupSamples.java | 23 + .../DelegatedNetworkListSamples.java | 23 + .../DelegatedSubnetServiceDeleteSamples.java | 23 + ...ubnetServiceGetByResourceGroupSamples.java | 23 + ...bnetServiceListByResourceGroupSamples.java | 23 + .../DelegatedSubnetServiceListSamples.java | 23 + ...gatedSubnetServicePatchDetailsSamples.java | 42 ++ ...legatedSubnetServicePutDetailsSamples.java | 36 ++ .../generated/OperationsListSamples.java | 23 + ...hestratorInstanceServiceCreateSamples.java | 46 ++ ...hestratorInstanceServiceDeleteSamples.java | 23 + ...tanceServiceGetByResourceGroupSamples.java | 23 + ...anceServiceListByResourceGroupSamples.java | 23 + ...rchestratorInstanceServiceListSamples.java | 23 + ...chestratorInstanceServicePatchSamples.java | 42 ++ 71 files changed, 2167 insertions(+), 1039 deletions(-) create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/SAMPLE.md create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetProperties.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllerProperties.java delete mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ErrorAdditionalInfo.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceProperties.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerCreateSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerDeleteSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerGetByResourceGroupSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerPatchSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedNetworkListByResourceGroupSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedNetworkListSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceDeleteSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceGetByResourceGroupSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceListByResourceGroupSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceListSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServicePatchDetailsSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServicePutDetailsSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OperationsListSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceCreateSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceDeleteSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceGetByResourceGroupSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceListByResourceGroupSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceListSamples.java create mode 100644 sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServicePatchSamples.java diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md index c98aaabefa15c..a43869f7f25ab 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-03-25) +- Azure Resource Manager DelegatedNetwork client library for Java. This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15. 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-03-26) diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md index f1d0fdec13d66..c1d0c825ff971 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-delegatednetwork - 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/delegatednetwork/azure-resourcemanager-delegatednetwork/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/SAMPLE.md b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/SAMPLE.md new file mode 100644 index 0000000000000..d2eb1231b9de3 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/SAMPLE.md @@ -0,0 +1,544 @@ +# Code snippets and samples + + +## Controller + +- [Create](#controller_create) +- [Delete](#controller_delete) +- [GetByResourceGroup](#controller_getbyresourcegroup) +- [Patch](#controller_patch) + +## DelegatedNetwork + +- [List](#delegatednetwork_list) +- [ListByResourceGroup](#delegatednetwork_listbyresourcegroup) + +## DelegatedSubnetService + +- [Delete](#delegatedsubnetservice_delete) +- [GetByResourceGroup](#delegatedsubnetservice_getbyresourcegroup) +- [List](#delegatedsubnetservice_list) +- [ListByResourceGroup](#delegatedsubnetservice_listbyresourcegroup) +- [PatchDetails](#delegatedsubnetservice_patchdetails) +- [PutDetails](#delegatedsubnetservice_putdetails) + +## Operations + +- [List](#operations_list) + +## OrchestratorInstanceService + +- [Create](#orchestratorinstanceservice_create) +- [Delete](#orchestratorinstanceservice_delete) +- [GetByResourceGroup](#orchestratorinstanceservice_getbyresourcegroup) +- [List](#orchestratorinstanceservice_list) +- [ListByResourceGroup](#orchestratorinstanceservice_listbyresourcegroup) +- [Patch](#orchestratorinstanceservice_patch) +### Controller_Create + +```java +/** Samples for Controller Create. */ +public final class ControllerCreateSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/putController.json + */ + /** + * Sample code: Create controller. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void createController(com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager + .controllers() + .define("testcontroller") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .create(); + } +} +``` + +### Controller_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Controller Delete. */ +public final class ControllerDeleteSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/deleteController.json + */ + /** + * Sample code: Delete controller. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void deleteController(com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.controllers().delete("TestRG", "testcontroller", Context.NONE); + } +} +``` + +### Controller_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Controller GetByResourceGroup. */ +public final class ControllerGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/getController.json + */ + /** + * Sample code: Get details of a controller. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDetailsOfAController( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.controllers().getByResourceGroupWithResponse("TestRG", "testcontroller", Context.NONE); + } +} +``` + +### Controller_Patch + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Controller Patch. */ +public final class ControllerPatchSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/patchController.json + */ + /** + * Sample code: update controller. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void updateController(com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + DelegatedController resource = + manager.controllers().getByResourceGroupWithResponse("TestRG", "testcontroller", Context.NONE).getValue(); + resource.update().withTags(mapOf("key", "value")).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; + } +} +``` + +### DelegatedNetwork_List + +```java +import com.azure.core.util.Context; + +/** Samples for DelegatedNetwork List. */ +public final class DelegatedNetworkListSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/controllerListBySub.json + */ + /** + * Sample code: Get DelegatedController resources by subscription. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDelegatedControllerResourcesBySubscription( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedNetworks().list(Context.NONE); + } +} +``` + +### DelegatedNetwork_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DelegatedNetwork ListByResourceGroup. */ +public final class DelegatedNetworkListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/controllerListByRG.json + */ + /** + * Sample code: Get DelegatedNetwork resources by resource group. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDelegatedNetworkResourcesByResourceGroup( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedNetworks().listByResourceGroup("testRG", Context.NONE); + } +} +``` + +### DelegatedSubnetService_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DelegatedSubnetService Delete. */ +public final class DelegatedSubnetServiceDeleteSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/deleteDelegatedSubnet.json + */ + /** + * Sample code: delete delegated subnet. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void deleteDelegatedSubnet( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedSubnetServices().delete("TestRG", "delegated1", null, Context.NONE); + } +} +``` + +### DelegatedSubnetService_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DelegatedSubnetService GetByResourceGroup. */ +public final class DelegatedSubnetServiceGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/getDelegatedSubnet.json + */ + /** + * Sample code: Get details of a delegated subnet. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDetailsOfADelegatedSubnet( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedSubnetServices().getByResourceGroupWithResponse("TestRG", "delegated1", Context.NONE); + } +} +``` + +### DelegatedSubnetService_List + +```java +import com.azure.core.util.Context; + +/** Samples for DelegatedSubnetService List. */ +public final class DelegatedSubnetServiceListSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/delegatedSubnetListBySub.json + */ + /** + * Sample code: Get DelegatedSubnets resources by subscription. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDelegatedSubnetsResourcesBySubscription( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedSubnetServices().list(Context.NONE); + } +} +``` + +### DelegatedSubnetService_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DelegatedSubnetService ListByResourceGroup. */ +public final class DelegatedSubnetServiceListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/delegatedSubnetListByRG.json + */ + /** + * Sample code: Get DelegatedSubnets resources by resource group. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDelegatedSubnetsResourcesByResourceGroup( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedSubnetServices().listByResourceGroup("testRG", Context.NONE); + } +} +``` + +### DelegatedSubnetService_PatchDetails + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnet; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DelegatedSubnetService PatchDetails. */ +public final class DelegatedSubnetServicePatchDetailsSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/patchDelegatedSubnet.json + */ + /** + * Sample code: patch delegated subnet. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void patchDelegatedSubnet( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + DelegatedSubnet resource = + manager + .delegatedSubnetServices() + .getByResourceGroupWithResponse("TestRG", "delegated1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "value")).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; + } +} +``` + +### DelegatedSubnetService_PutDetails + +```java +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails; + +/** Samples for DelegatedSubnetService PutDetails. */ +public final class DelegatedSubnetServicePutDetailsSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/putDelegatedSubnet.json + */ + /** + * Sample code: put delegated subnet. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void putDelegatedSubnet(com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager + .delegatedSubnetServices() + .define("delegated1") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .withSubnetDetails( + new SubnetDetails() + .withId( + "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet")) + .withControllerDetails( + new ControllerDetails() + .withId( + "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.DelegatedNetwork/controller/dnctestcontroller")) + .create(); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/delegatedNetworkOperationsList.json + */ + /** + * Sample code: Get available operations. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getAvailableOperations( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### OrchestratorInstanceService_Create + +```java +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorIdentity; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorKind; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceProperties; +import com.azure.resourcemanager.delegatednetwork.models.ResourceIdentityType; + +/** Samples for OrchestratorInstanceService Create. */ +public final class OrchestratorInstanceServiceCreateSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/putOrchestrator.json + */ + /** + * Sample code: Create orchestrator instance. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void createOrchestratorInstance( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager + .orchestratorInstanceServices() + .define("testk8s1") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .withKind(OrchestratorKind.KUBERNETES) + .withIdentity(new OrchestratorIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties( + new OrchestratorResourceProperties() + .withOrchestratorAppId("546192d7-503f-477a-9cfe-4efc3ee2b6e1") + .withOrchestratorTenantId("da6192d7-503f-477a-9cfe-4efc3ee2b6c3") + .withClusterRootCA("ddsadsad344mfdsfdl") + .withApiServerEndpoint("https://testk8s.cloudapp.net") + .withPrivateLinkResourceId( + "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.Network/privateLinkServices/plresource1") + .withControllerDetails( + new ControllerDetails() + .withId( + "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.DelegatedNetwork/controller/testcontroller"))) + .create(); + } +} +``` + +### OrchestratorInstanceService_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for OrchestratorInstanceService Delete. */ +public final class OrchestratorInstanceServiceDeleteSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/deleteOrchestrator.json + */ + /** + * Sample code: Delete Orchestrator Instance. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void deleteOrchestratorInstance( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.orchestratorInstanceServices().delete("TestRG", "k8stest1", null, Context.NONE); + } +} +``` + +### OrchestratorInstanceService_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for OrchestratorInstanceService GetByResourceGroup. */ +public final class OrchestratorInstanceServiceGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/getOrchestrator.json + */ + /** + * Sample code: Get details of a orchestratorInstance. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDetailsOfAOrchestratorInstance( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.orchestratorInstanceServices().getByResourceGroupWithResponse("TestRG", "testk8s1", Context.NONE); + } +} +``` + +### OrchestratorInstanceService_List + +```java +import com.azure.core.util.Context; + +/** Samples for OrchestratorInstanceService List. */ +public final class OrchestratorInstanceServiceListSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/orchestratorInstanceListBySub.json + */ + /** + * Sample code: Get orchestratorInstance resources by subscription. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getOrchestratorInstanceResourcesBySubscription( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.orchestratorInstanceServices().list(Context.NONE); + } +} +``` + +### OrchestratorInstanceService_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for OrchestratorInstanceService ListByResourceGroup. */ +public final class OrchestratorInstanceServiceListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/orchestratorInstanceListByRG.json + */ + /** + * Sample code: Get OrchestratorInstance resources by resource group. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getOrchestratorInstanceResourcesByResourceGroup( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.orchestratorInstanceServices().listByResourceGroup("testRG", Context.NONE); + } +} +``` + +### OrchestratorInstanceService_Patch + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.models.Orchestrator; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OrchestratorInstanceService Patch. */ +public final class OrchestratorInstanceServicePatchSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/patchOrchestrator.json + */ + /** + * Sample code: update Orchestrator Instance. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void updateOrchestratorInstance( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + Orchestrator resource = + manager + .orchestratorInstanceServices() + .getByResourceGroupWithResponse("TestRG", "testk8s1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "value")).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/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml index 6165357ff4193..1712ef695dc2b 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/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-delegatednetwork - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-delegatednetwork + 1.0.0-beta.2 + jar - Microsoft Azure SDK for DelegatedNetwork Management - This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for DelegatedNetwork Management + This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15. + 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.26.0 - - - com.azure - azure-core-management - 1.5.3 - - + + 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.26.0 + + + com.azure + azure-core-management + 1.5.3 + + diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java index 11a2ce3389f29..666d8b3ac2cb5 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -37,6 +38,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to DelegatedNetworkManager. DNC web api provides way to create, get and delete dnc controller. */ public final class DelegatedNetworkManager { @@ -88,11 +90,12 @@ 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 Duration defaultPollInterval; @@ -132,6 +135,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. * @@ -150,9 +164,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; } @@ -188,19 +204,33 @@ public DelegatedNetworkManager authenticate(TokenCredential credential, AzurePro userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/ControllersClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/ControllersClient.java index 04ecd03a98473..95683c5c5ac6a 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/ControllersClient.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/ControllersClient.java @@ -37,7 +37,7 @@ public interface ControllersClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dnc controller. + * @return details about the specified dnc controller along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -52,9 +52,9 @@ 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 represents an instance of a DNC controller. + * @return the {@link SyncPoller} for polling of represents an instance of a DNC controller. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DelegatedControllerInner> beginCreate( String resourceGroupName, String resourceName, DelegatedControllerInner parameters); @@ -68,9 +68,9 @@ SyncPoller, DelegatedControllerInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return the {@link SyncPoller} for polling of represents an instance of a DNC controller. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DelegatedControllerInner> beginCreate( String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context); @@ -112,9 +112,9 @@ DelegatedControllerInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); /** @@ -126,9 +126,9 @@ DelegatedControllerInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); /** @@ -181,7 +181,7 @@ DelegatedControllerInner patch( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return represents an instance of a DNC controller along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response patchWithResponse( diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedNetworksClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedNetworksClient.java index d718696a04715..40a4654b557a8 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedNetworksClient.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedNetworksClient.java @@ -17,7 +17,7 @@ public interface DelegatedNetworksClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface DelegatedNetworksClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -41,7 +41,8 @@ public interface DelegatedNetworksClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -54,7 +55,8 @@ public interface DelegatedNetworksClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedSubnetServicesClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedSubnetServicesClient.java index cc4fb5dea2586..cbb23834946b2 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedSubnetServicesClient.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/DelegatedSubnetServicesClient.java @@ -38,7 +38,7 @@ public interface DelegatedSubnetServicesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dnc DelegatedSubnet Link. + * @return details about the specified dnc DelegatedSubnet Link along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -53,9 +53,9 @@ 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 represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DelegatedSubnetInner> beginPutDetails( String resourceGroupName, String resourceName, DelegatedSubnetInner parameters); @@ -69,9 +69,9 @@ SyncPoller, DelegatedSubnetInner> beginPutDetai * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DelegatedSubnetInner> beginPutDetails( String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context); @@ -114,9 +114,9 @@ DelegatedSubnetInner putDetails( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DelegatedSubnetInner> beginPatchDetails( String resourceGroupName, String resourceName, ResourceUpdateParameters parameters); @@ -130,9 +130,9 @@ SyncPoller, DelegatedSubnetInner> beginPatchDet * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DelegatedSubnetInner> beginPatchDetails( String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context); @@ -176,9 +176,9 @@ DelegatedSubnetInner patchDetails( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Boolean forceDelete); /** @@ -191,9 +191,9 @@ DelegatedSubnetInner patchDetails( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, Boolean forceDelete, Context context); @@ -241,7 +241,7 @@ SyncPoller, Void> beginDelete( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -253,7 +253,7 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -265,7 +265,7 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -278,7 +278,7 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OperationsClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OperationsClient.java index 62fb59247fa1d..3ade9c13af1a5 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OperationsClient.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OperationsClient.java @@ -17,7 +17,8 @@ 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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +30,8 @@ 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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java index 5754145b96159..85557e692db13 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java @@ -38,7 +38,7 @@ public interface OrchestratorInstanceServicesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the orchestrator instance. + * @return details about the orchestrator instance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -53,9 +53,9 @@ 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 represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OrchestratorInner> beginCreate( String resourceGroupName, String resourceName, OrchestratorInner parameters); @@ -69,9 +69,9 @@ SyncPoller, OrchestratorInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OrchestratorInner> beginCreate( String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context); @@ -110,27 +110,43 @@ OrchestratorInner create( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Boolean forceDelete); /** * Deletes the Orchestrator Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context); + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); + void delete(String resourceGroupName, String resourceName, Boolean forceDelete); /** * Deletes the Orchestrator Instance. @@ -149,13 +165,14 @@ OrchestratorInner create( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, Context context); + void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context); /** * Update Orchestrator Instance. @@ -182,7 +199,7 @@ OrchestratorInner patch( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response patchWithResponse( @@ -196,7 +213,8 @@ Response patchWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -208,7 +226,8 @@ Response patchWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -220,7 +239,8 @@ Response patchWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -233,7 +253,8 @@ Response patchWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java index 0caf85444ff84..850a2c49ea431 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java @@ -4,95 +4,28 @@ package com.azure.resourcemanager.delegatednetwork.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.delegatednetwork.models.ControllerResource; -import com.azure.resourcemanager.delegatednetwork.models.ControllerState; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedControllerProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of a DNC controller. */ -@JsonFlatten -@Immutable -public class DelegatedControllerInner extends ControllerResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedControllerInner.class); - +@Fluent +public final class DelegatedControllerInner extends ControllerResource { /* - * Resource guid. - */ - @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The current state of dnc controller resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ControllerState provisioningState; - - /* - * dnc application id should be used by customer to authenticate with dnc - * gateway. - */ - @JsonProperty(value = "properties.dncAppId", access = JsonProperty.Access.WRITE_ONLY) - private String dncAppId; - - /* - * tenant id of dnc application id - */ - @JsonProperty(value = "properties.dncTenantId", access = JsonProperty.Access.WRITE_ONLY) - private String dncTenantId; - - /* - * dnc endpoint url that customers can use to connect to - */ - @JsonProperty(value = "properties.dncEndpoint", access = JsonProperty.Access.WRITE_ONLY) - private String dncEndpoint; - - /** - * Get the resourceGuid property: Resource guid. - * - * @return the resourceGuid value. + * Properties of the provision operation request. */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The current state of dnc controller resource. - * - * @return the provisioningState value. - */ - public ControllerState provisioningState() { - return this.provisioningState; - } - - /** - * Get the dncAppId property: dnc application id should be used by customer to authenticate with dnc gateway. - * - * @return the dncAppId value. - */ - public String dncAppId() { - return this.dncAppId; - } - - /** - * Get the dncTenantId property: tenant id of dnc application id. - * - * @return the dncTenantId value. - */ - public String dncTenantId() { - return this.dncTenantId; - } + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private DelegatedControllerProperties properties; /** - * Get the dncEndpoint property: dnc endpoint url that customers can use to connect to. + * Get the properties property: Properties of the provision operation request. * - * @return the dncEndpoint value. + * @return the properties value. */ - public String dncEndpoint() { - return this.dncEndpoint; + public DelegatedControllerProperties properties() { + return this.properties; } /** {@inheritDoc} */ @@ -117,5 +50,8 @@ public DelegatedControllerInner withTags(Map tags) { @Override public void validate() { super.validate(); + if (properties() != null) { + properties().validate(); + } } } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java index f1d158e5da6d4..e5327423cc00c 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java @@ -5,45 +5,44 @@ package com.azure.resourcemanager.delegatednetwork.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetResource; import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetState; import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of a orchestrator. */ -@JsonFlatten @Fluent -public class DelegatedSubnetInner extends DelegatedSubnetResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetInner.class); - +public final class DelegatedSubnetInner extends DelegatedSubnetResource { /* - * Resource guid. + * Properties of the provision operation request. */ - @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; + @JsonProperty(value = "properties") + private DelegatedSubnetProperties innerProperties; - /* - * The current state of dnc delegated subnet resource. + /** + * Get the innerProperties property: Properties of the provision operation request. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private DelegatedSubnetState provisioningState; + private DelegatedSubnetProperties innerProperties() { + return this.innerProperties; + } - /* - * subnet details - */ - @JsonProperty(value = "properties.subnetDetails") - private SubnetDetails subnetDetails; + /** {@inheritDoc} */ + @Override + public DelegatedSubnetInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * Properties of the controller. - */ - @JsonProperty(value = "properties.controllerDetails") - private ControllerDetails controllerDetails; + /** {@inheritDoc} */ + @Override + public DelegatedSubnetInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the resourceGuid property: Resource guid. @@ -51,7 +50,7 @@ public class DelegatedSubnetInner extends DelegatedSubnetResource { * @return the resourceGuid value. */ public String resourceGuid() { - return this.resourceGuid; + return this.innerProperties() == null ? null : this.innerProperties().resourceGuid(); } /** @@ -60,7 +59,7 @@ public String resourceGuid() { * @return the provisioningState value. */ public DelegatedSubnetState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -69,7 +68,7 @@ public DelegatedSubnetState provisioningState() { * @return the subnetDetails value. */ public SubnetDetails subnetDetails() { - return this.subnetDetails; + return this.innerProperties() == null ? null : this.innerProperties().subnetDetails(); } /** @@ -79,7 +78,10 @@ public SubnetDetails subnetDetails() { * @return the DelegatedSubnetInner object itself. */ public DelegatedSubnetInner withSubnetDetails(SubnetDetails subnetDetails) { - this.subnetDetails = subnetDetails; + if (this.innerProperties() == null) { + this.innerProperties = new DelegatedSubnetProperties(); + } + this.innerProperties().withSubnetDetails(subnetDetails); return this; } @@ -89,7 +91,7 @@ public DelegatedSubnetInner withSubnetDetails(SubnetDetails subnetDetails) { * @return the controllerDetails value. */ public ControllerDetails controllerDetails() { - return this.controllerDetails; + return this.innerProperties() == null ? null : this.innerProperties().controllerDetails(); } /** @@ -99,21 +101,10 @@ public ControllerDetails controllerDetails() { * @return the DelegatedSubnetInner object itself. */ public DelegatedSubnetInner withControllerDetails(ControllerDetails controllerDetails) { - this.controllerDetails = controllerDetails; - return this; - } - - /** {@inheritDoc} */ - @Override - public DelegatedSubnetInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DelegatedSubnetInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new DelegatedSubnetProperties(); + } + this.innerProperties().withControllerDetails(controllerDetails); return this; } @@ -125,11 +116,8 @@ public DelegatedSubnetInner withTags(Map tags) { @Override public void validate() { super.validate(); - if (subnetDetails() != null) { - subnetDetails().validate(); - } - if (controllerDetails() != null) { - controllerDetails().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetProperties.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetProperties.java new file mode 100644 index 0000000000000..1c44a0ca040e8 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetProperties.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetState; +import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of delegated subnet. */ +@Fluent +public final class DelegatedSubnetProperties { + /* + * Resource guid. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of dnc delegated subnet resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DelegatedSubnetState provisioningState; + + /* + * subnet details + */ + @JsonProperty(value = "subnetDetails") + private SubnetDetails subnetDetails; + + /* + * Properties of the controller. + */ + @JsonProperty(value = "controllerDetails") + private ControllerDetails controllerDetails; + + /** + * Get the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of dnc delegated subnet resource. + * + * @return the provisioningState value. + */ + public DelegatedSubnetState provisioningState() { + return this.provisioningState; + } + + /** + * Get the subnetDetails property: subnet details. + * + * @return the subnetDetails value. + */ + public SubnetDetails subnetDetails() { + return this.subnetDetails; + } + + /** + * Set the subnetDetails property: subnet details. + * + * @param subnetDetails the subnetDetails value to set. + * @return the DelegatedSubnetProperties object itself. + */ + public DelegatedSubnetProperties withSubnetDetails(SubnetDetails subnetDetails) { + this.subnetDetails = subnetDetails; + return this; + } + + /** + * Get the controllerDetails property: Properties of the controller. + * + * @return the controllerDetails value. + */ + public ControllerDetails controllerDetails() { + return this.controllerDetails; + } + + /** + * Set the controllerDetails property: Properties of the controller. + * + * @param controllerDetails the controllerDetails value to set. + * @return the DelegatedSubnetProperties object itself. + */ + public DelegatedSubnetProperties withControllerDetails(ControllerDetails controllerDetails) { + this.controllerDetails = controllerDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetDetails() != null) { + subnetDetails().validate(); + } + if (controllerDetails() != null) { + controllerDetails().validate(); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OperationInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OperationInner.java index 210cba6c929a8..bd47c0fa2e49a 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OperationInner.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OperationInner.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.delegatednetwork.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.delegatednetwork.models.ActionType; import com.azure.resourcemanager.delegatednetwork.models.OperationDisplay; import com.azure.resourcemanager.delegatednetwork.models.Origin; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Details of a REST API operation, returned from the Resource Provider Operations API. */ +/** REST API Operation Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * The name of the operation, as per Resource-Based Access Control (RBAC). * Examples: "Microsoft.Compute/virtualMachines/write", diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java index 0c92f1200f070..41d782726c4c4 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java @@ -5,212 +5,39 @@ package com.azure.resourcemanager.delegatednetwork.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorIdentity; -import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceState; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorKind; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResource; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of a orchestrator. */ -@JsonFlatten @Fluent -public class OrchestratorInner extends OrchestratorResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorInner.class); - - /* - * Resource guid. - */ - @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The current state of orchestratorInstance resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private OrchestratorInstanceState provisioningState; - - /* - * AAD ID used with apiserver - */ - @JsonProperty(value = "properties.orchestratorAppId") - private String orchestratorAppId; - +public final class OrchestratorInner extends OrchestratorResource { /* - * TenantID of server App ID - */ - @JsonProperty(value = "properties.orchestratorTenantId") - private String orchestratorTenantId; - - /* - * RootCA certificate of kubernetes cluster base64 encoded - */ - @JsonProperty(value = "properties.clusterRootCA") - private String clusterRootCA; - - /* - * K8s APIServer url. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified - */ - @JsonProperty(value = "properties.apiServerEndpoint") - private String apiServerEndpoint; - - /* - * private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified - */ - @JsonProperty(value = "properties.privateLinkResourceId") - private String privateLinkResourceId; - - /* - * Properties of the controller. - */ - @JsonProperty(value = "properties.controllerDetails") - private ControllerDetails controllerDetails; - - /** - * Get the resourceGuid property: Resource guid. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The current state of orchestratorInstance resource. - * - * @return the provisioningState value. - */ - public OrchestratorInstanceState provisioningState() { - return this.provisioningState; - } - - /** - * Get the orchestratorAppId property: AAD ID used with apiserver. - * - * @return the orchestratorAppId value. - */ - public String orchestratorAppId() { - return this.orchestratorAppId; - } - - /** - * Set the orchestratorAppId property: AAD ID used with apiserver. - * - * @param orchestratorAppId the orchestratorAppId value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withOrchestratorAppId(String orchestratorAppId) { - this.orchestratorAppId = orchestratorAppId; - return this; - } - - /** - * Get the orchestratorTenantId property: TenantID of server App ID. - * - * @return the orchestratorTenantId value. - */ - public String orchestratorTenantId() { - return this.orchestratorTenantId; - } - - /** - * Set the orchestratorTenantId property: TenantID of server App ID. - * - * @param orchestratorTenantId the orchestratorTenantId value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withOrchestratorTenantId(String orchestratorTenantId) { - this.orchestratorTenantId = orchestratorTenantId; - return this; - } - - /** - * Get the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. - * - * @return the clusterRootCA value. - */ - public String clusterRootCA() { - return this.clusterRootCA; - } - - /** - * Set the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. - * - * @param clusterRootCA the clusterRootCA value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withClusterRootCA(String clusterRootCA) { - this.clusterRootCA = clusterRootCA; - return this; - } - - /** - * Get the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId - * can be specified. - * - * @return the apiServerEndpoint value. - */ - public String apiServerEndpoint() { - return this.apiServerEndpoint; - } - - /** - * Set the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId - * can be specified. - * - * @param apiServerEndpoint the apiServerEndpoint value to set. - * @return the OrchestratorInner object itself. + * Properties of the provision operation request. */ - public OrchestratorInner withApiServerEndpoint(String apiServerEndpoint) { - this.apiServerEndpoint = apiServerEndpoint; - return this; - } - - /** - * Get the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * - * @return the privateLinkResourceId value. - */ - public String privateLinkResourceId() { - return this.privateLinkResourceId; - } - - /** - * Set the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * - * @param privateLinkResourceId the privateLinkResourceId value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withPrivateLinkResourceId(String privateLinkResourceId) { - this.privateLinkResourceId = privateLinkResourceId; - return this; - } + @JsonProperty(value = "properties") + private OrchestratorResourceProperties properties; /** - * Get the controllerDetails property: Properties of the controller. + * Get the properties property: Properties of the provision operation request. * - * @return the controllerDetails value. + * @return the properties value. */ - public ControllerDetails controllerDetails() { - return this.controllerDetails; + public OrchestratorResourceProperties properties() { + return this.properties; } /** - * Set the controllerDetails property: Properties of the controller. + * Set the properties property: Properties of the provision operation request. * - * @param controllerDetails the controllerDetails value to set. + * @param properties the properties value to set. * @return the OrchestratorInner object itself. */ - public OrchestratorInner withControllerDetails(ControllerDetails controllerDetails) { - this.controllerDetails = controllerDetails; + public OrchestratorInner withProperties(OrchestratorResourceProperties properties) { + this.properties = properties; return this; } @@ -250,8 +77,8 @@ public OrchestratorInner withTags(Map tags) { @Override public void validate() { super.validate(); - if (controllerDetails() != null) { - controllerDetails().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersClientImpl.java index aa85281364412..a1e1fe6d3e9e9 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersClientImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersClientImpl.java @@ -26,7 +26,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.delegatednetwork.fluent.ControllersClient; @@ -38,8 +37,6 @@ /** An instance of this class provides access to all the operations defined in ControllersClient. */ public final class ControllersClientImpl implements ControllersClient { - private final ClientLogger logger = new ClientLogger(ControllersClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ControllersService service; @@ -134,7 +131,8 @@ Mono> patch( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dnc controller. + * @return details about the specified dnc controller along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -183,7 +181,8 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dnc controller. + * @return details about the specified dnc controller along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -228,7 +227,7 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dnc controller. + * @return details about the specified dnc controller on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { @@ -267,7 +266,7 @@ public DelegatedControllerInner getByResourceGroup(String resourceGroupName, 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 details about the specified dnc controller. + * @return details about the specified dnc controller along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -284,7 +283,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 represents an instance of a DNC controller. + * @return represents an instance of a DNC controller along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -340,7 +340,8 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return represents an instance of a DNC controller along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -392,9 +393,9 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return the {@link PollerFlux} for polling of represents an instance of a DNC controller. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DelegatedControllerInner> beginCreateAsync( String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { Mono>> mono = createWithResponseAsync(resourceGroupName, resourceName, parameters); @@ -405,7 +406,7 @@ private PollerFlux, DelegatedControllerInne this.client.getHttpPipeline(), DelegatedControllerInner.class, DelegatedControllerInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -418,9 +419,9 @@ private PollerFlux, DelegatedControllerInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return the {@link PollerFlux} for polling of represents an instance of a DNC controller. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DelegatedControllerInner> beginCreateAsync( String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context) { context = this.client.mergeContext(context); @@ -445,9 +446,9 @@ private PollerFlux, DelegatedControllerInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return the {@link SyncPoller} for polling of represents an instance of a DNC controller. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DelegatedControllerInner> beginCreate( String resourceGroupName, String resourceName, DelegatedControllerInner parameters) { return beginCreateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); @@ -463,9 +464,9 @@ public SyncPoller, DelegatedControllerInner * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return the {@link SyncPoller} for polling of represents an instance of a DNC controller. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DelegatedControllerInner> beginCreate( String resourceGroupName, String resourceName, DelegatedControllerInner parameters, Context context) { return beginCreateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); @@ -480,7 +481,7 @@ public SyncPoller, DelegatedControllerInner * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return represents an instance of a DNC controller on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -500,7 +501,7 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return represents an instance of a DNC controller on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -553,7 +554,7 @@ public DelegatedControllerInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 resourceName) { @@ -601,7 +602,7 @@ private Mono>> deleteWithResponseAsync(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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -646,14 +647,15 @@ 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 PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -665,9 +667,9 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, Context context) { context = this.client.mergeContext(context); @@ -685,9 +687,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); } @@ -701,9 +703,9 @@ public SyncPoller, Void> beginDelete(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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); @@ -717,7 +719,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 resourceName) { @@ -733,7 +735,7 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 resourceName, Context context) { @@ -780,7 +782,8 @@ public void delete(String resourceGroupName, String resourceName, 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 represents an instance of a DNC controller. + * @return represents an instance of a DNC controller along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> patchWithResponseAsync( @@ -836,7 +839,8 @@ private Mono> patchWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return represents an instance of a DNC controller along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> patchWithResponseAsync( @@ -888,7 +892,7 @@ private Mono> patchWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return represents an instance of a DNC controller on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono patchAsync( @@ -931,7 +935,7 @@ public DelegatedControllerInner patch( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a DNC controller. + * @return represents an instance of a DNC controller along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response patchWithResponse( diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersImpl.java index ce7c789a246b9..1131af6bc9039 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/ControllersImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; import com.azure.resourcemanager.delegatednetwork.models.Controllers; import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ControllersImpl implements Controllers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllersImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ControllersImpl.class); private final ControllersClient innerClient; @@ -63,7 +62,7 @@ public void delete(String resourceGroupName, String resourceName, Context contex public DelegatedController getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -71,7 +70,7 @@ public DelegatedController getById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "controller"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'controller'.", id))); @@ -82,7 +81,7 @@ public DelegatedController 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 @@ -90,7 +89,7 @@ public Response getByIdWithResponse(String id, Context cont } String resourceName = Utils.getValueFromIdByName(id, "controller"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'controller'.", id))); @@ -101,7 +100,7 @@ public Response getByIdWithResponse(String id, Context cont public void deleteById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -109,7 +108,7 @@ public void deleteById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "controller"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'controller'.", id))); @@ -120,7 +119,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -128,7 +127,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String resourceName = Utils.getValueFromIdByName(id, "controller"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'controller'.", id))); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java index b80b43b13394a..5427764991367 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; import com.azure.resourcemanager.delegatednetwork.models.ControllerResourceUpdateParameters; -import com.azure.resourcemanager.delegatednetwork.models.ControllerState; import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedControllerProperties; import java.util.Collections; import java.util.Map; @@ -44,24 +44,8 @@ public Map tags() { } } - public String resourceGuid() { - return this.innerModel().resourceGuid(); - } - - public ControllerState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String dncAppId() { - return this.innerModel().dncAppId(); - } - - public String dncTenantId() { - return this.innerModel().dncTenantId(); - } - - public String dncEndpoint() { - return this.innerModel().dncEndpoint(); + public DelegatedControllerProperties properties() { + return this.innerModel().properties(); } public Region region() { diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksClientImpl.java index b0e7d5449eaf1..d6dfaae036a2d 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksClientImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksClientImpl.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.delegatednetwork.fluent.DelegatedNetworksClient; import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; import com.azure.resourcemanager.delegatednetwork.models.DelegatedControllers; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in DelegatedNetworksClient. */ public final class DelegatedNetworksClientImpl implements DelegatedNetworksClient { - private final ClientLogger logger = new ClientLogger(DelegatedNetworksClientImpl.class); - /** The proxy service used to perform REST calls. */ private final DelegatedNetworksService service; @@ -110,7 +107,8 @@ Mono> listByResourceGroupNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -156,7 +154,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 all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -197,7 +196,7 @@ private Mono> listSinglePageAsync(Contex * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -212,7 +211,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 all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -225,7 +224,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 all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription 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 all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -253,7 +252,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 all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -305,7 +305,8 @@ private Mono> listByResourceGroupSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -354,7 +355,7 @@ private Mono> listByResourceGroupSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -371,7 +372,7 @@ private PagedFlux listByResourceGroupAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -387,7 +388,8 @@ private PagedFlux listByResourceGroupAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -402,7 +404,8 @@ public PagedIterable listByResourceGroup(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 all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -416,7 +419,8 @@ public PagedIterable listByResourceGroup(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 an array of Delegated controller resources. + * @return an array of Delegated controller resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -453,7 +457,8 @@ private Mono> listBySubscriptionNextSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of Delegated controller resources. + * @return an array of Delegated controller resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync( @@ -489,7 +494,8 @@ private Mono> listBySubscriptionNextSing * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of Delegated controller resources. + * @return an array of Delegated controller resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -526,7 +532,8 @@ private Mono> listByResourceGroupNextSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of Delegated controller resources. + * @return an array of Delegated controller resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksImpl.java index d6c8be1c779bb..7c4d25c806278 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedNetworksImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; import com.azure.resourcemanager.delegatednetwork.models.DelegatedNetworks; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class DelegatedNetworksImpl implements DelegatedNetworks { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedNetworksImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(DelegatedNetworksImpl.class); private final DelegatedNetworksClient innerClient; diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesClientImpl.java index 3f5e760f435d3..290ea3c0295f0 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesClientImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.delegatednetwork.fluent.DelegatedSubnetServicesClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in DelegatedSubnetServicesClient. */ public final class DelegatedSubnetServicesClientImpl implements DelegatedSubnetServicesClient { - private final ClientLogger logger = new ClientLogger(DelegatedSubnetServicesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final DelegatedSubnetServicesService service; @@ -187,7 +184,8 @@ Mono> listByResourceGroupNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dnc DelegatedSubnet Link. + * @return details about the specified dnc DelegatedSubnet Link along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -236,7 +234,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 details about the specified dnc DelegatedSubnet Link. + * @return details about the specified dnc DelegatedSubnet Link along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -281,7 +280,7 @@ 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 details about the specified dnc DelegatedSubnet Link. + * @return details about the specified dnc DelegatedSubnet Link on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { @@ -320,7 +319,7 @@ public DelegatedSubnetInner getByResourceGroup(String resourceGroupName, 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 details about the specified dnc DelegatedSubnet Link. + * @return details about the specified dnc DelegatedSubnet Link along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -337,7 +336,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 represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> putDetailsWithResponseAsync( @@ -393,7 +393,8 @@ private Mono>> putDetailsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> putDetailsWithResponseAsync( @@ -445,9 +446,9 @@ private Mono>> putDetailsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link PollerFlux} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DelegatedSubnetInner> beginPutDetailsAsync( String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { Mono>> mono = @@ -459,7 +460,7 @@ private PollerFlux, DelegatedSubnetInner> begin this.client.getHttpPipeline(), DelegatedSubnetInner.class, DelegatedSubnetInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -472,9 +473,9 @@ private PollerFlux, DelegatedSubnetInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link PollerFlux} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DelegatedSubnetInner> beginPutDetailsAsync( String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context) { context = this.client.mergeContext(context); @@ -495,9 +496,9 @@ private PollerFlux, DelegatedSubnetInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DelegatedSubnetInner> beginPutDetails( String resourceGroupName, String resourceName, DelegatedSubnetInner parameters) { return beginPutDetailsAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); @@ -513,9 +514,9 @@ public SyncPoller, DelegatedSubnetInner> beginP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DelegatedSubnetInner> beginPutDetails( String resourceGroupName, String resourceName, DelegatedSubnetInner parameters, Context context) { return beginPutDetailsAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); @@ -530,7 +531,7 @@ public SyncPoller, DelegatedSubnetInner> beginP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono putDetailsAsync( @@ -550,7 +551,7 @@ private Mono putDetailsAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono putDetailsAsync( @@ -604,7 +605,8 @@ public DelegatedSubnetInner putDetails( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> patchDetailsWithResponseAsync( @@ -660,7 +662,8 @@ private Mono>> patchDetailsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> patchDetailsWithResponseAsync( @@ -712,9 +715,9 @@ private Mono>> patchDetailsWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link PollerFlux} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DelegatedSubnetInner> beginPatchDetailsAsync( String resourceGroupName, String resourceName, ResourceUpdateParameters parameters) { Mono>> mono = @@ -726,7 +729,7 @@ private PollerFlux, DelegatedSubnetInner> begin this.client.getHttpPipeline(), DelegatedSubnetInner.class, DelegatedSubnetInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -739,9 +742,9 @@ private PollerFlux, DelegatedSubnetInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link PollerFlux} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DelegatedSubnetInner> beginPatchDetailsAsync( String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context) { context = this.client.mergeContext(context); @@ -762,9 +765,9 @@ private PollerFlux, DelegatedSubnetInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DelegatedSubnetInner> beginPatchDetails( String resourceGroupName, String resourceName, ResourceUpdateParameters parameters) { return beginPatchDetailsAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); @@ -780,9 +783,9 @@ public SyncPoller, DelegatedSubnetInner> beginP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DelegatedSubnetInner> beginPatchDetails( String resourceGroupName, String resourceName, ResourceUpdateParameters parameters, Context context) { return beginPatchDetailsAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); @@ -797,7 +800,7 @@ public SyncPoller, DelegatedSubnetInner> beginP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono patchDetailsAsync( @@ -817,7 +820,7 @@ private Mono patchDetailsAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono patchDetailsAsync( @@ -871,7 +874,7 @@ public DelegatedSubnetInner patchDetails( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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( @@ -922,7 +925,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( @@ -969,15 +972,16 @@ 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 PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, Boolean forceDelete) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, forceDelete); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -990,9 +994,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { context = this.client.mergeContext(context); @@ -1012,9 +1016,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, Boolean forceDelete) { return beginDeleteAsync(resourceGroupName, resourceName, forceDelete).getSyncPoller(); @@ -1030,9 +1034,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, forceDelete, context).getSyncPoller(); @@ -1047,7 +1051,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 resourceName, Boolean forceDelete) { @@ -1064,7 +1068,7 @@ private Mono deleteAsync(String resourceGroupName, String resourceName, Bo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 resourceName) { @@ -1084,7 +1088,7 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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( @@ -1145,7 +1149,8 @@ public void delete(String resourceGroupName, String resourceName, Boolean forceD * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1191,7 +1196,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 all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1232,7 +1238,7 @@ private Mono> listSinglePageAsync(Context co * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1247,7 +1253,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 all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1260,7 +1266,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 all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1274,7 +1280,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 all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1288,7 +1294,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 all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -1340,7 +1347,8 @@ private Mono> listByResourceGroupSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1389,7 +1397,7 @@ private Mono> listByResourceGroupSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1406,7 +1414,7 @@ private PagedFlux listByResourceGroupAsync(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 all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -1422,7 +1430,7 @@ private PagedFlux listByResourceGroupAsync(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 all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1437,7 +1445,7 @@ public PagedIterable listByResourceGroup(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1451,7 +1459,8 @@ public PagedIterable listByResourceGroup(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of DelegatedSubnet resources. + * @return an array of DelegatedSubnet resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1488,7 +1497,8 @@ private Mono> listBySubscriptionNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of DelegatedSubnet resources. + * @return an array of DelegatedSubnet resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync( @@ -1524,7 +1534,8 @@ private Mono> listBySubscriptionNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of DelegatedSubnet resources. + * @return an array of DelegatedSubnet resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1561,7 +1572,8 @@ private Mono> listByResourceGroupNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of DelegatedSubnet resources. + * @return an array of DelegatedSubnet resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesImpl.java index b72a9c2ee1bef..13929369d7468 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetServicesImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnet; import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetServices; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class DelegatedSubnetServicesImpl implements DelegatedSubnetServices { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetServicesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(DelegatedSubnetServicesImpl.class); private final DelegatedSubnetServicesClient innerClient; @@ -89,7 +88,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNa public DelegatedSubnet getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -97,7 +96,7 @@ public DelegatedSubnet getById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "delegatedSubnets"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -110,7 +109,7 @@ public DelegatedSubnet 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 @@ -118,7 +117,7 @@ public Response getByIdWithResponse(String id, Context context) } String resourceName = Utils.getValueFromIdByName(id, "delegatedSubnets"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -131,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 @@ -139,7 +138,7 @@ public void deleteById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "delegatedSubnets"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -153,7 +152,7 @@ public void deleteById(String id) { public void deleteByIdWithResponse(String id, Boolean forceDelete, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -161,7 +160,7 @@ public void deleteByIdWithResponse(String id, Boolean forceDelete, Context conte } String resourceName = Utils.getValueFromIdByName(id, "delegatedSubnets"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncImpl.java index 4103986e2dce2..938b1a1a52d7a 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DncImpl.java @@ -40,8 +40,6 @@ /** Initializes a new instance of the DncImpl type. */ @ServiceClient(builder = DncBuilder.class) public final class DncImpl implements Dnc { - private final ClientLogger logger = new ClientLogger(DncImpl.class); - /** The ID of the target subscription. */ private final String subscriptionId; @@ -287,7 +285,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -346,4 +344,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(DncImpl.class); } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsClientImpl.java index 8cbcd06c8bff8..e307207a652bc 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsClientImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/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.delegatednetwork.fluent.OperationsClient; import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; import com.azure.resourcemanager.delegatednetwork.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; @@ -84,7 +81,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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -117,7 +115,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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -147,7 +146,8 @@ 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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -161,7 +161,8 @@ 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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -174,7 +175,8 @@ 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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -188,7 +190,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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -202,7 +205,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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -238,7 +242,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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider 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/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsImpl.java index b70998d4b7068..8ad045ea4cadd 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; import com.azure.resourcemanager.delegatednetwork.models.Operation; import com.azure.resourcemanager.delegatednetwork.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/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java index 4419c88e709e7..a19a5d02e096a 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java @@ -7,11 +7,10 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; -import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; import com.azure.resourcemanager.delegatednetwork.models.Orchestrator; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorIdentity; -import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceState; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorKind; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceProperties; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceUpdateParameters; import java.util.Collections; import java.util.Map; @@ -54,36 +53,8 @@ public OrchestratorIdentity identity() { return this.innerModel().identity(); } - public String resourceGuid() { - return this.innerModel().resourceGuid(); - } - - public OrchestratorInstanceState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String orchestratorAppId() { - return this.innerModel().orchestratorAppId(); - } - - public String orchestratorTenantId() { - return this.innerModel().orchestratorTenantId(); - } - - public String clusterRootCA() { - return this.innerModel().clusterRootCA(); - } - - public String apiServerEndpoint() { - return this.innerModel().apiServerEndpoint(); - } - - public String privateLinkResourceId() { - return this.innerModel().privateLinkResourceId(); - } - - public ControllerDetails controllerDetails() { - return this.innerModel().controllerDetails(); + public OrchestratorResourceProperties properties() { + return this.innerModel().properties(); } public Region region() { @@ -221,33 +192,8 @@ public OrchestratorImpl withIdentity(OrchestratorIdentity identity) { return this; } - public OrchestratorImpl withOrchestratorAppId(String orchestratorAppId) { - this.innerModel().withOrchestratorAppId(orchestratorAppId); - return this; - } - - public OrchestratorImpl withOrchestratorTenantId(String orchestratorTenantId) { - this.innerModel().withOrchestratorTenantId(orchestratorTenantId); - return this; - } - - public OrchestratorImpl withClusterRootCA(String clusterRootCA) { - this.innerModel().withClusterRootCA(clusterRootCA); - return this; - } - - public OrchestratorImpl withApiServerEndpoint(String apiServerEndpoint) { - this.innerModel().withApiServerEndpoint(apiServerEndpoint); - return this; - } - - public OrchestratorImpl withPrivateLinkResourceId(String privateLinkResourceId) { - this.innerModel().withPrivateLinkResourceId(privateLinkResourceId); - return this; - } - - public OrchestratorImpl withControllerDetails(ControllerDetails controllerDetails) { - this.innerModel().withControllerDetails(controllerDetails); + public OrchestratorImpl withProperties(OrchestratorResourceProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java index 60a07e956be01..25febe5051e57 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.delegatednetwork.fluent.OrchestratorInstanceServicesClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in OrchestratorInstanceServicesClient. */ public final class OrchestratorInstanceServicesClientImpl implements OrchestratorInstanceServicesClient { - private final ClientLogger logger = new ClientLogger(OrchestratorInstanceServicesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OrchestratorInstanceServicesService service; @@ -114,6 +111,7 @@ Mono>> delete( @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("forceDelete") Boolean forceDelete, @HeaderParam("Accept") String accept, Context context); @@ -187,7 +185,8 @@ Mono> listByResourceGroupNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the orchestrator instance. + * @return details about the orchestrator instance along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -236,7 +235,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 details about the orchestrator instance. + * @return details about the orchestrator instance along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -281,7 +281,7 @@ 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 details about the orchestrator instance. + * @return details about the orchestrator instance on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { @@ -320,7 +320,7 @@ public OrchestratorInner getByResourceGroup(String resourceGroupName, String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the orchestrator instance. + * @return details about the orchestrator instance along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -337,7 +337,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 represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -393,7 +394,8 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -445,16 +447,20 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link PollerFlux} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OrchestratorInner> beginCreateAsync( String resourceGroupName, String resourceName, OrchestratorInner parameters) { Mono>> mono = createWithResponseAsync(resourceGroupName, resourceName, parameters); return this .client .getLroResult( - mono, this.client.getHttpPipeline(), OrchestratorInner.class, OrchestratorInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + OrchestratorInner.class, + OrchestratorInner.class, + this.client.getContext()); } /** @@ -467,9 +473,9 @@ private PollerFlux, OrchestratorInner> beginCreate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link PollerFlux} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OrchestratorInner> beginCreateAsync( String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context) { context = this.client.mergeContext(context); @@ -490,9 +496,9 @@ private PollerFlux, OrchestratorInner> beginCreate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OrchestratorInner> beginCreate( String resourceGroupName, String resourceName, OrchestratorInner parameters) { return beginCreateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); @@ -508,9 +514,9 @@ public SyncPoller, OrchestratorInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return the {@link SyncPoller} for polling of represents an instance of a orchestrator. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OrchestratorInner> beginCreate( String resourceGroupName, String resourceName, OrchestratorInner parameters, Context context) { return beginCreateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); @@ -525,7 +531,7 @@ public SyncPoller, OrchestratorInner> beginCreate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -545,7 +551,7 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -594,13 +600,15 @@ public OrchestratorInner create( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, Boolean forceDelete) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -631,6 +639,7 @@ private Mono>> deleteWithResponseAsync(String resource resourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), + forceDelete, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -641,15 +650,16 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -678,6 +688,7 @@ private Mono>> deleteWithResponseAsync( resourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), + forceDelete, accept, context); } @@ -687,17 +698,20 @@ private Mono>> deleteWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete 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 completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, Boolean forceDelete) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, forceDelete); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -705,17 +719,19 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, Context context) { + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, forceDelete, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); @@ -726,14 +742,16 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete 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 completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete).getSyncPoller(); } /** @@ -741,16 +759,35 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete, context).getSyncPoller(); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -761,11 +798,14 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + final Boolean forceDelete = null; + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -773,19 +813,36 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context) + private Mono deleteAsync( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete, context) .last() .flatMap(this.client::getLroFinalResultOrError); } + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete) { + deleteAsync(resourceGroupName, resourceName, forceDelete).block(); + } + /** * Deletes the Orchestrator Instance. * @@ -797,7 +854,8 @@ private Mono deleteAsync(String resourceGroupName, String resourceName, Co */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String resourceName) { - deleteAsync(resourceGroupName, resourceName).block(); + final Boolean forceDelete = null; + deleteAsync(resourceGroupName, resourceName, forceDelete).block(); } /** @@ -805,14 +863,15 @@ public void delete(String resourceGroupName, String resourceName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, Context context) { - deleteAsync(resourceGroupName, resourceName, context).block(); + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + deleteAsync(resourceGroupName, resourceName, forceDelete, context).block(); } /** @@ -824,7 +883,8 @@ public void delete(String resourceGroupName, String resourceName, 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 represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> patchWithResponseAsync( @@ -880,7 +940,8 @@ private Mono> patchWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> patchWithResponseAsync( @@ -935,7 +996,7 @@ private Mono> patchWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono patchAsync( @@ -978,7 +1039,7 @@ public OrchestratorInner patch( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents an instance of a orchestrator. + * @return represents an instance of a orchestrator along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response patchWithResponse( @@ -994,7 +1055,8 @@ public Response patchWithResponse( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1040,7 +1102,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 all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1081,7 +1144,7 @@ private Mono> listSinglePageAsync(Context conte * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1096,7 +1159,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 all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1109,7 +1172,8 @@ 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 all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1123,7 +1187,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 all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1137,7 +1202,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 all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -1189,7 +1255,8 @@ private Mono> listByResourceGroupSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1238,7 +1305,7 @@ private Mono> listByResourceGroupSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1255,7 +1322,7 @@ private PagedFlux listByResourceGroupAsync(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 all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -1271,7 +1338,8 @@ private PagedFlux listByResourceGroupAsync(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 all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1286,7 +1354,8 @@ public PagedIterable listByResourceGroup(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1300,7 +1369,8 @@ public PagedIterable listByResourceGroup(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of OrchestratorInstance resources. + * @return an array of OrchestratorInstance resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1337,7 +1407,8 @@ private Mono> listBySubscriptionNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of OrchestratorInstance resources. + * @return an array of OrchestratorInstance resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync( @@ -1373,7 +1444,8 @@ private Mono> listBySubscriptionNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of OrchestratorInstance resources. + * @return an array of OrchestratorInstance resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1410,7 +1482,8 @@ private Mono> listByResourceGroupNextSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 array of OrchestratorInstance resources. + * @return an array of OrchestratorInstance resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java index af5ad06b2e41e..f05b1544c35ca 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; import com.azure.resourcemanager.delegatednetwork.models.Orchestrator; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceServices; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OrchestratorInstanceServicesImpl implements OrchestratorInstanceServices { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorInstanceServicesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OrchestratorInstanceServicesImpl.class); private final OrchestratorInstanceServicesClient innerClient; @@ -53,12 +52,16 @@ public Response getByResourceGroupWithResponse( } } - public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete) { + this.serviceClient().delete(resourceGroupName, resourceName, forceDelete); + } + + public void delete(String resourceGroupName, String resourceName) { this.serviceClient().delete(resourceGroupName, resourceName); } - public void delete(String resourceGroupName, String resourceName, Context context) { - this.serviceClient().delete(resourceGroupName, resourceName, context); + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, forceDelete, context); } public PagedIterable list() { @@ -84,7 +87,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, public Orchestrator getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -92,7 +95,7 @@ public Orchestrator getById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "orchestrators"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); @@ -103,7 +106,7 @@ public Orchestrator 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 +114,7 @@ public Response getByIdWithResponse(String id, Context context) { } String resourceName = Utils.getValueFromIdByName(id, "orchestrators"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); @@ -122,7 +125,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 @@ -130,18 +133,19 @@ public void deleteById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "orchestrators"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); } - this.delete(resourceGroupName, resourceName, Context.NONE); + Boolean localForceDelete = null; + this.delete(resourceGroupName, resourceName, localForceDelete, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Boolean forceDelete, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -149,12 +153,12 @@ public void deleteByIdWithResponse(String id, Context context) { } String resourceName = Utils.getValueFromIdByName(id, "orchestrators"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); } - this.delete(resourceGroupName, resourceName, context); + this.delete(resourceGroupName, resourceName, forceDelete, context); } private OrchestratorInstanceServicesClient serviceClient() { diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerDetails.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerDetails.java index ab570a3762b23..076d8ad0fa7b8 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerDetails.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerDetails.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.delegatednetwork.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; /** controller details. */ @Fluent public final class ControllerDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllerDetails.class); - /* * controller arm resource id */ diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java index 6202737e7b144..a3b7e2b275506 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java @@ -4,17 +4,13 @@ package com.azure.resourcemanager.delegatednetwork.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** Represents an instance of a resource. */ -@Immutable +@Fluent public class ControllerResource extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllerResource.class); - /** {@inheritDoc} */ @Override public ControllerResource withLocation(String location) { diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResourceUpdateParameters.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResourceUpdateParameters.java index d34df2af712ea..94b95b519f667 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResourceUpdateParameters.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResourceUpdateParameters.java @@ -5,20 +5,18 @@ package com.azure.resourcemanager.delegatednetwork.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; /** Parameters for updating a resource. */ @Fluent public final class ControllerResourceUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllerResourceUpdateParameters.class); - /* * The resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Controllers.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Controllers.java index f843a78d9b86a..ed94721e162c5 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Controllers.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Controllers.java @@ -30,7 +30,7 @@ public interface Controllers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dnc controller. + * @return details about the specified dnc controller along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String resourceName, Context context); @@ -65,7 +65,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 details about the specified dnc controller. + * @return details about the specified dnc controller along with {@link Response}. */ DelegatedController getById(String id); @@ -77,7 +77,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 details about the specified dnc controller. + * @return details about the specified dnc controller along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java index 4543837b860e6..47816ae8690c9 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java @@ -47,39 +47,11 @@ public interface DelegatedController { Map tags(); /** - * Gets the resourceGuid property: Resource guid. + * Gets the properties property: Properties of the provision operation request. * - * @return the resourceGuid value. + * @return the properties value. */ - String resourceGuid(); - - /** - * Gets the provisioningState property: The current state of dnc controller resource. - * - * @return the provisioningState value. - */ - ControllerState provisioningState(); - - /** - * Gets the dncAppId property: dnc application id should be used by customer to authenticate with dnc gateway. - * - * @return the dncAppId value. - */ - String dncAppId(); - - /** - * Gets the dncTenantId property: tenant id of dnc application id. - * - * @return the dncTenantId value. - */ - String dncTenantId(); - - /** - * Gets the dncEndpoint property: dnc endpoint url that customers can use to connect to. - * - * @return the dncEndpoint value. - */ - String dncEndpoint(); + DelegatedControllerProperties properties(); /** * Gets the region of the resource. diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllerProperties.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllerProperties.java new file mode 100644 index 0000000000000..81ce6a7b13552 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllerProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Delegated controller resource. */ +@Immutable +public final class DelegatedControllerProperties { + /* + * Resource guid. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of dnc controller resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ControllerState provisioningState; + + /* + * dnc application id should be used by customer to authenticate with dnc + * gateway. + */ + @JsonProperty(value = "dncAppId", access = JsonProperty.Access.WRITE_ONLY) + private String dncAppId; + + /* + * tenant id of dnc application id + */ + @JsonProperty(value = "dncTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String dncTenantId; + + /* + * dnc endpoint url that customers can use to connect to + */ + @JsonProperty(value = "dncEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String dncEndpoint; + + /** + * Get the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of dnc controller resource. + * + * @return the provisioningState value. + */ + public ControllerState provisioningState() { + return this.provisioningState; + } + + /** + * Get the dncAppId property: dnc application id should be used by customer to authenticate with dnc gateway. + * + * @return the dncAppId value. + */ + public String dncAppId() { + return this.dncAppId; + } + + /** + * Get the dncTenantId property: tenant id of dnc application id. + * + * @return the dncTenantId value. + */ + public String dncTenantId() { + return this.dncTenantId; + } + + /** + * Get the dncEndpoint property: dnc endpoint url that customers can use to connect to. + * + * @return the dncEndpoint value. + */ + public String dncEndpoint() { + return this.dncEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllers.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllers.java index 328c0dbc0459e..229f2cabf9f92 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllers.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllers.java @@ -7,15 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** An array of Delegated controller resources. */ @Fluent public final class DelegatedControllers { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedControllers.class); - /* * An array of Delegated controller resources. */ @@ -64,11 +61,13 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property value in model DelegatedControllers")); } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(DelegatedControllers.class); } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedNetworks.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedNetworks.java index 57c8c7452d311..c70d91ff17aec 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedNetworks.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedNetworks.java @@ -14,7 +14,7 @@ public interface DelegatedNetworks { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface DelegatedNetworks { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a subscription. + * @return all the delegatedController resources in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -36,7 +36,8 @@ public interface DelegatedNetworks { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group as paginated response with {@link + * PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -48,7 +49,8 @@ public interface DelegatedNetworks { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the delegatedController resources in a resource group. + * @return all the delegatedController resources in a resource group as paginated response with {@link + * PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java index 9fb78eb638a1a..bed936782b062 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java @@ -4,17 +4,13 @@ package com.azure.resourcemanager.delegatednetwork.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** Represents an instance of a resource. */ -@Immutable +@Fluent public class DelegatedSubnetResource extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetResource.class); - /** {@inheritDoc} */ @Override public DelegatedSubnetResource withLocation(String location) { diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetServices.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetServices.java index b8defc5b08ded..b9cfb227e1415 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetServices.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetServices.java @@ -31,7 +31,7 @@ public interface DelegatedSubnetServices { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the specified dnc DelegatedSubnet Link. + * @return details about the specified dnc DelegatedSubnet Link along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String resourceName, Context context); @@ -77,7 +77,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 all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -88,7 +88,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 all the DelegatedSubnets resources in a subscription. + * @return all the DelegatedSubnets resources in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -99,7 +99,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 all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -111,7 +111,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 all the DelegatedSubnets resources in a resource group. + * @return all the DelegatedSubnets resources in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -122,7 +122,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 details about the specified dnc DelegatedSubnet Link. + * @return details about the specified dnc DelegatedSubnet Link along with {@link Response}. */ DelegatedSubnet getById(String id); @@ -134,7 +134,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 details about the specified dnc DelegatedSubnet Link. + * @return details about the specified dnc DelegatedSubnet Link along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnets.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnets.java index afaed5e418dde..db673bb4c461f 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnets.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnets.java @@ -7,15 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** An array of DelegatedSubnet resources. */ @Fluent public final class DelegatedSubnets { - @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnets.class); - /* * An array of DelegatedSubnet resources. */ @@ -64,11 +61,13 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property value in model DelegatedSubnets")); } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(DelegatedSubnets.class); } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ErrorAdditionalInfo.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ErrorAdditionalInfo.java deleted file mode 100644 index f8c3777495079..0000000000000 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ErrorAdditionalInfo.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.delegatednetwork.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 resource management error additional info. */ -@Immutable -public final class ErrorAdditionalInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); - - /* - * The additional info type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The additional info. - */ - @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) - private Object info; - - /** - * Get the type property: The additional info type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the info property: The additional info. - * - * @return the info value. - */ - public Object info() { - return this.info; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationDisplay.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationDisplay.java index 9d30d966379dd..52d6aaf2f2a55 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationDisplay.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.delegatednetwork.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; /** Localized display information for this particular operation. */ @Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * The localized friendly form of the resource provider name, e.g. * "Microsoft Monitoring Insights" or "Microsoft Compute". diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationListResult.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationListResult.java index bb7caec64f5b1..09477fa0b9441 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationListResult.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OperationListResult.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.delegatednetwork.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.delegatednetwork.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,8 +15,6 @@ */ @Immutable public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * List of operations supported by the resource provider */ diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operations.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operations.java index 7b476c4a87e65..13fb0ba76a054 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operations.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Operations.java @@ -14,7 +14,8 @@ 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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -25,7 +26,8 @@ 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 a list of REST API operations supported by an Azure Resource Provider. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link + * PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java index 8619c781996ca..d6bdbfb56c55c 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java @@ -61,62 +61,11 @@ public interface Orchestrator { OrchestratorIdentity identity(); /** - * Gets the resourceGuid property: Resource guid. + * Gets the properties property: Properties of the provision operation request. * - * @return the resourceGuid value. + * @return the properties value. */ - String resourceGuid(); - - /** - * Gets the provisioningState property: The current state of orchestratorInstance resource. - * - * @return the provisioningState value. - */ - OrchestratorInstanceState provisioningState(); - - /** - * Gets the orchestratorAppId property: AAD ID used with apiserver. - * - * @return the orchestratorAppId value. - */ - String orchestratorAppId(); - - /** - * Gets the orchestratorTenantId property: TenantID of server App ID. - * - * @return the orchestratorTenantId value. - */ - String orchestratorTenantId(); - - /** - * Gets the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. - * - * @return the clusterRootCA value. - */ - String clusterRootCA(); - - /** - * Gets the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId - * can be specified. - * - * @return the apiServerEndpoint value. - */ - String apiServerEndpoint(); - - /** - * Gets the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * - * @return the privateLinkResourceId value. - */ - String privateLinkResourceId(); - - /** - * Gets the controllerDetails property: Properties of the controller. - * - * @return the controllerDetails value. - */ - ControllerDetails controllerDetails(); + OrchestratorResourceProperties properties(); /** * Gets the region of the resource. @@ -195,14 +144,7 @@ interface WithKind { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithOrchestratorAppId, - DefinitionStages.WithOrchestratorTenantId, - DefinitionStages.WithClusterRootCA, - DefinitionStages.WithApiServerEndpoint, - DefinitionStages.WithPrivateLinkResourceId, - DefinitionStages.WithControllerDetails { + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { /** * Executes the create request. * @@ -238,69 +180,15 @@ interface WithIdentity { */ WithCreate withIdentity(OrchestratorIdentity identity); } - /** The stage of the Orchestrator definition allowing to specify orchestratorAppId. */ - interface WithOrchestratorAppId { - /** - * Specifies the orchestratorAppId property: AAD ID used with apiserver. - * - * @param orchestratorAppId AAD ID used with apiserver. - * @return the next definition stage. - */ - WithCreate withOrchestratorAppId(String orchestratorAppId); - } - /** The stage of the Orchestrator definition allowing to specify orchestratorTenantId. */ - interface WithOrchestratorTenantId { - /** - * Specifies the orchestratorTenantId property: TenantID of server App ID. - * - * @param orchestratorTenantId TenantID of server App ID. - * @return the next definition stage. - */ - WithCreate withOrchestratorTenantId(String orchestratorTenantId); - } - /** The stage of the Orchestrator definition allowing to specify clusterRootCA. */ - interface WithClusterRootCA { - /** - * Specifies the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. - * - * @param clusterRootCA RootCA certificate of kubernetes cluster base64 encoded. - * @return the next definition stage. - */ - WithCreate withClusterRootCA(String clusterRootCA); - } - /** The stage of the Orchestrator definition allowing to specify apiServerEndpoint. */ - interface WithApiServerEndpoint { - /** - * Specifies the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * - * @param apiServerEndpoint K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId can - * be specified. - * @return the next definition stage. - */ - WithCreate withApiServerEndpoint(String apiServerEndpoint); - } - /** The stage of the Orchestrator definition allowing to specify privateLinkResourceId. */ - interface WithPrivateLinkResourceId { - /** - * Specifies the privateLinkResourceId property: private link arm resource id. Either one of - * apiServerEndpoint or privateLinkResourceId can be specified. - * - * @param privateLinkResourceId private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * @return the next definition stage. - */ - WithCreate withPrivateLinkResourceId(String privateLinkResourceId); - } - /** The stage of the Orchestrator definition allowing to specify controllerDetails. */ - interface WithControllerDetails { + /** The stage of the Orchestrator definition allowing to specify properties. */ + interface WithProperties { /** - * Specifies the controllerDetails property: Properties of the controller.. + * Specifies the properties property: Properties of the provision operation request.. * - * @param controllerDetails Properties of the controller. + * @param properties Properties of the provision operation request. * @return the next definition stage. */ - WithCreate withControllerDetails(ControllerDetails controllerDetails); + WithCreate withProperties(OrchestratorResourceProperties properties); } } /** diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorIdentity.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorIdentity.java index cc455ecf86a5f..38fc671a9bc8a 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorIdentity.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorIdentity.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.delegatednetwork.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 OrchestratorIdentity model. */ @Fluent public class OrchestratorIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorIdentity.class); - /* * The principal id of the system assigned identity which is used by * orchestrator. diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java index ff05de8c4cd15..13b7d6e3abf50 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java @@ -31,7 +31,7 @@ public interface OrchestratorInstanceServices { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details about the orchestrator instance. + * @return details about the orchestrator instance along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String resourceName, Context context); @@ -41,30 +41,44 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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 deleteByResourceGroup(String resourceGroupName, String resourceName); + void delete(String resourceGroupName, String resourceName, Boolean forceDelete); /** * Deletes the Orchestrator Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 resourceName); + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @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. */ - void delete(String resourceGroupName, String resourceName, Context context); + void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context); /** * Get all the orchestratorInstance resources in a subscription. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -75,7 +89,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 all the orchestratorInstance resources in a subscription. + * @return all the orchestratorInstance resources in a subscription as paginated response with {@link + * PagedIterable}. */ PagedIterable list(Context context); @@ -86,7 +101,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 all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group as paginated response with {@link + * PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -98,7 +114,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 all the OrchestratorInstances resources in a resource group. + * @return all the OrchestratorInstances resources in a resource group as paginated response with {@link + * PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -109,7 +126,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 details about the orchestrator instance. + * @return details about the orchestrator instance along with {@link Response}. */ Orchestrator getById(String id); @@ -121,7 +138,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 details about the orchestrator instance. + * @return details about the orchestrator instance along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -139,12 +156,13 @@ Response getByResourceGroupWithResponse( * Deletes the Orchestrator Instance. * * @param id the resource ID. + * @param forceDelete Force delete resource. * @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. */ - void deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Boolean forceDelete, Context context); /** * Begins definition for a new Orchestrator resource. diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResource.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResource.java index e47694c446d9e..6383ecbf249cf 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResource.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResource.java @@ -7,15 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of a resource. */ @Fluent public class OrchestratorResource extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorResource.class); - /* * The kind of workbook. Choices are user and shared. */ @@ -89,7 +86,7 @@ public OrchestratorResource withTags(Map tags) { */ public void validate() { if (kind() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property kind in model OrchestratorResource")); } @@ -97,4 +94,6 @@ public void validate() { identity().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(OrchestratorResource.class); } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceProperties.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceProperties.java new file mode 100644 index 0000000000000..ae8d887995301 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceProperties.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of orchestrator. */ +@Fluent +public final class OrchestratorResourceProperties { + /* + * Resource guid. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of orchestratorInstance resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private OrchestratorInstanceState provisioningState; + + /* + * AAD ID used with apiserver + */ + @JsonProperty(value = "orchestratorAppId") + private String orchestratorAppId; + + /* + * TenantID of server App ID + */ + @JsonProperty(value = "orchestratorTenantId") + private String orchestratorTenantId; + + /* + * RootCA certificate of kubernetes cluster base64 encoded + */ + @JsonProperty(value = "clusterRootCA") + private String clusterRootCA; + + /* + * K8s APIServer url. Either one of apiServerEndpoint or + * privateLinkResourceId can be specified + */ + @JsonProperty(value = "apiServerEndpoint") + private String apiServerEndpoint; + + /* + * private link arm resource id. Either one of apiServerEndpoint or + * privateLinkResourceId can be specified + */ + @JsonProperty(value = "privateLinkResourceId") + private String privateLinkResourceId; + + /* + * Properties of the controller. + */ + @JsonProperty(value = "controllerDetails", required = true) + private ControllerDetails controllerDetails; + + /** + * Get the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of orchestratorInstance resource. + * + * @return the provisioningState value. + */ + public OrchestratorInstanceState provisioningState() { + return this.provisioningState; + } + + /** + * Get the orchestratorAppId property: AAD ID used with apiserver. + * + * @return the orchestratorAppId value. + */ + public String orchestratorAppId() { + return this.orchestratorAppId; + } + + /** + * Set the orchestratorAppId property: AAD ID used with apiserver. + * + * @param orchestratorAppId the orchestratorAppId value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withOrchestratorAppId(String orchestratorAppId) { + this.orchestratorAppId = orchestratorAppId; + return this; + } + + /** + * Get the orchestratorTenantId property: TenantID of server App ID. + * + * @return the orchestratorTenantId value. + */ + public String orchestratorTenantId() { + return this.orchestratorTenantId; + } + + /** + * Set the orchestratorTenantId property: TenantID of server App ID. + * + * @param orchestratorTenantId the orchestratorTenantId value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withOrchestratorTenantId(String orchestratorTenantId) { + this.orchestratorTenantId = orchestratorTenantId; + return this; + } + + /** + * Get the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. + * + * @return the clusterRootCA value. + */ + public String clusterRootCA() { + return this.clusterRootCA; + } + + /** + * Set the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. + * + * @param clusterRootCA the clusterRootCA value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withClusterRootCA(String clusterRootCA) { + this.clusterRootCA = clusterRootCA; + return this; + } + + /** + * Get the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId + * can be specified. + * + * @return the apiServerEndpoint value. + */ + public String apiServerEndpoint() { + return this.apiServerEndpoint; + } + + /** + * Set the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId + * can be specified. + * + * @param apiServerEndpoint the apiServerEndpoint value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withApiServerEndpoint(String apiServerEndpoint) { + this.apiServerEndpoint = apiServerEndpoint; + return this; + } + + /** + * Get the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or + * privateLinkResourceId can be specified. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or + * privateLinkResourceId can be specified. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the controllerDetails property: Properties of the controller. + * + * @return the controllerDetails value. + */ + public ControllerDetails controllerDetails() { + return this.controllerDetails; + } + + /** + * Set the controllerDetails property: Properties of the controller. + * + * @param controllerDetails the controllerDetails value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withControllerDetails(ControllerDetails controllerDetails) { + this.controllerDetails = controllerDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (controllerDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property controllerDetails in model OrchestratorResourceProperties")); + } else { + controllerDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrchestratorResourceProperties.class); +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceUpdateParameters.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceUpdateParameters.java index 0c1676c65ada7..fd2e4a8aaa734 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceUpdateParameters.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceUpdateParameters.java @@ -5,20 +5,18 @@ package com.azure.resourcemanager.delegatednetwork.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; /** Parameters for updating a resource. */ @Fluent public final class OrchestratorResourceUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorResourceUpdateParameters.class); - /* * The resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrators.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrators.java index db9ac9791e79e..c107110580c9d 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrators.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrators.java @@ -7,15 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** An array of OrchestratorInstance resources. */ @Fluent public final class Orchestrators { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Orchestrators.class); - /* * An array of OrchestratorInstance resources. */ @@ -64,11 +61,13 @@ public String nextLink() { */ public void validate() { if (value() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property value in model Orchestrators")); } else { value().forEach(e -> e.validate()); } } + + private static final ClientLogger LOGGER = new ClientLogger(Orchestrators.class); } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceUpdateParameters.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceUpdateParameters.java index 8380a9642ad30..bbf1ead8f2273 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceUpdateParameters.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ResourceUpdateParameters.java @@ -5,20 +5,18 @@ package com.azure.resourcemanager.delegatednetwork.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; /** Parameters for updating a resource. */ @Fluent public final class ResourceUpdateParameters { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceUpdateParameters.class); - /* * The resource tags. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/SubnetDetails.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/SubnetDetails.java index da8e37083d1cd..71ba8e6580c2d 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/SubnetDetails.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/SubnetDetails.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.delegatednetwork.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; /** Properties of orchestrator. */ @Fluent public final class SubnetDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubnetDetails.class); - /* * subnet arm resource id */ diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerCreateSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerCreateSamples.java new file mode 100644 index 0000000000000..875129684e47d --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerCreateSamples.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.delegatednetwork.generated; + +/** Samples for Controller Create. */ +public final class ControllerCreateSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/putController.json + */ + /** + * Sample code: Create controller. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void createController(com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager + .controllers() + .define("testcontroller") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .create(); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerDeleteSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerDeleteSamples.java new file mode 100644 index 0000000000000..344fd4ab47902 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerDeleteSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Controller Delete. */ +public final class ControllerDeleteSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/deleteController.json + */ + /** + * Sample code: Delete controller. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void deleteController(com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.controllers().delete("TestRG", "testcontroller", Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerGetByResourceGroupSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..844f5eaa6e7aa --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerGetByResourceGroupSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Controller GetByResourceGroup. */ +public final class ControllerGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/getController.json + */ + /** + * Sample code: Get details of a controller. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDetailsOfAController( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.controllers().getByResourceGroupWithResponse("TestRG", "testcontroller", Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerPatchSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerPatchSamples.java new file mode 100644 index 0000000000000..a657b38d8ce84 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/ControllerPatchSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Controller Patch. */ +public final class ControllerPatchSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/patchController.json + */ + /** + * Sample code: update controller. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void updateController(com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + DelegatedController resource = + manager.controllers().getByResourceGroupWithResponse("TestRG", "testcontroller", Context.NONE).getValue(); + resource.update().withTags(mapOf("key", "value")).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/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedNetworkListByResourceGroupSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedNetworkListByResourceGroupSamples.java new file mode 100644 index 0000000000000..3ff0fd38fa9b3 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedNetworkListByResourceGroupSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DelegatedNetwork ListByResourceGroup. */ +public final class DelegatedNetworkListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/controllerListByRG.json + */ + /** + * Sample code: Get DelegatedNetwork resources by resource group. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDelegatedNetworkResourcesByResourceGroup( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedNetworks().listByResourceGroup("testRG", Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedNetworkListSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedNetworkListSamples.java new file mode 100644 index 0000000000000..5cb348b825046 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedNetworkListSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DelegatedNetwork List. */ +public final class DelegatedNetworkListSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/controllerListBySub.json + */ + /** + * Sample code: Get DelegatedController resources by subscription. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDelegatedControllerResourcesBySubscription( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedNetworks().list(Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceDeleteSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceDeleteSamples.java new file mode 100644 index 0000000000000..47e3b796d64d0 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceDeleteSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DelegatedSubnetService Delete. */ +public final class DelegatedSubnetServiceDeleteSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/deleteDelegatedSubnet.json + */ + /** + * Sample code: delete delegated subnet. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void deleteDelegatedSubnet( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedSubnetServices().delete("TestRG", "delegated1", null, Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceGetByResourceGroupSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..34043e137e255 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceGetByResourceGroupSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DelegatedSubnetService GetByResourceGroup. */ +public final class DelegatedSubnetServiceGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/getDelegatedSubnet.json + */ + /** + * Sample code: Get details of a delegated subnet. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDetailsOfADelegatedSubnet( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedSubnetServices().getByResourceGroupWithResponse("TestRG", "delegated1", Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceListByResourceGroupSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceListByResourceGroupSamples.java new file mode 100644 index 0000000000000..72f3af763c094 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceListByResourceGroupSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DelegatedSubnetService ListByResourceGroup. */ +public final class DelegatedSubnetServiceListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/delegatedSubnetListByRG.json + */ + /** + * Sample code: Get DelegatedSubnets resources by resource group. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDelegatedSubnetsResourcesByResourceGroup( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedSubnetServices().listByResourceGroup("testRG", Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceListSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceListSamples.java new file mode 100644 index 0000000000000..dfab4f2f216c2 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServiceListSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for DelegatedSubnetService List. */ +public final class DelegatedSubnetServiceListSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/delegatedSubnetListBySub.json + */ + /** + * Sample code: Get DelegatedSubnets resources by subscription. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDelegatedSubnetsResourcesBySubscription( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.delegatedSubnetServices().list(Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServicePatchDetailsSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServicePatchDetailsSamples.java new file mode 100644 index 0000000000000..8910e68674344 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServicePatchDetailsSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnet; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DelegatedSubnetService PatchDetails. */ +public final class DelegatedSubnetServicePatchDetailsSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/patchDelegatedSubnet.json + */ + /** + * Sample code: patch delegated subnet. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void patchDelegatedSubnet( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + DelegatedSubnet resource = + manager + .delegatedSubnetServices() + .getByResourceGroupWithResponse("TestRG", "delegated1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "value")).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/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServicePutDetailsSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServicePutDetailsSamples.java new file mode 100644 index 0000000000000..887af2c77d2d4 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/DelegatedSubnetServicePutDetailsSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.generated; + +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails; + +/** Samples for DelegatedSubnetService PutDetails. */ +public final class DelegatedSubnetServicePutDetailsSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/putDelegatedSubnet.json + */ + /** + * Sample code: put delegated subnet. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void putDelegatedSubnet(com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager + .delegatedSubnetServices() + .define("delegated1") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .withSubnetDetails( + new SubnetDetails() + .withId( + "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet")) + .withControllerDetails( + new ControllerDetails() + .withId( + "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.DelegatedNetwork/controller/dnctestcontroller")) + .create(); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OperationsListSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..e0f30ae465975 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OperationsListSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/delegatedNetworkOperationsList.json + */ + /** + * Sample code: Get available operations. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getAvailableOperations( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceCreateSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceCreateSamples.java new file mode 100644 index 0000000000000..80789b89355d9 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceCreateSamples.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.delegatednetwork.generated; + +import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorIdentity; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorKind; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceProperties; +import com.azure.resourcemanager.delegatednetwork.models.ResourceIdentityType; + +/** Samples for OrchestratorInstanceService Create. */ +public final class OrchestratorInstanceServiceCreateSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/putOrchestrator.json + */ + /** + * Sample code: Create orchestrator instance. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void createOrchestratorInstance( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager + .orchestratorInstanceServices() + .define("testk8s1") + .withRegion("West US") + .withExistingResourceGroup("TestRG") + .withKind(OrchestratorKind.KUBERNETES) + .withIdentity(new OrchestratorIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withProperties( + new OrchestratorResourceProperties() + .withOrchestratorAppId("546192d7-503f-477a-9cfe-4efc3ee2b6e1") + .withOrchestratorTenantId("da6192d7-503f-477a-9cfe-4efc3ee2b6c3") + .withClusterRootCA("ddsadsad344mfdsfdl") + .withApiServerEndpoint("https://testk8s.cloudapp.net") + .withPrivateLinkResourceId( + "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.Network/privateLinkServices/plresource1") + .withControllerDetails( + new ControllerDetails() + .withId( + "/subscriptions/613192d7-503f-477a-9cfe-4efc3ee2bd60/resourceGroups/TestRG/providers/Microsoft.DelegatedNetwork/controller/testcontroller"))) + .create(); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceDeleteSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceDeleteSamples.java new file mode 100644 index 0000000000000..a50974d51340d --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceDeleteSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for OrchestratorInstanceService Delete. */ +public final class OrchestratorInstanceServiceDeleteSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/deleteOrchestrator.json + */ + /** + * Sample code: Delete Orchestrator Instance. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void deleteOrchestratorInstance( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.orchestratorInstanceServices().delete("TestRG", "k8stest1", null, Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceGetByResourceGroupSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..56303d49607b2 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceGetByResourceGroupSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for OrchestratorInstanceService GetByResourceGroup. */ +public final class OrchestratorInstanceServiceGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/getOrchestrator.json + */ + /** + * Sample code: Get details of a orchestratorInstance. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getDetailsOfAOrchestratorInstance( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.orchestratorInstanceServices().getByResourceGroupWithResponse("TestRG", "testk8s1", Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceListByResourceGroupSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceListByResourceGroupSamples.java new file mode 100644 index 0000000000000..a05db66ad9c39 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceListByResourceGroupSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for OrchestratorInstanceService ListByResourceGroup. */ +public final class OrchestratorInstanceServiceListByResourceGroupSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/orchestratorInstanceListByRG.json + */ + /** + * Sample code: Get OrchestratorInstance resources by resource group. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getOrchestratorInstanceResourcesByResourceGroup( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.orchestratorInstanceServices().listByResourceGroup("testRG", Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceListSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceListSamples.java new file mode 100644 index 0000000000000..bf3a51b068346 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServiceListSamples.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.delegatednetwork.generated; + +import com.azure.core.util.Context; + +/** Samples for OrchestratorInstanceService List. */ +public final class OrchestratorInstanceServiceListSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/orchestratorInstanceListBySub.json + */ + /** + * Sample code: Get orchestratorInstance resources by subscription. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void getOrchestratorInstanceResourcesBySubscription( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + manager.orchestratorInstanceServices().list(Context.NONE); + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServicePatchSamples.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServicePatchSamples.java new file mode 100644 index 0000000000000..3a8041b33a0ae --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/samples/java/com/azure/resourcemanager/delegatednetwork/generated/OrchestratorInstanceServicePatchSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.delegatednetwork.models.Orchestrator; +import java.util.HashMap; +import java.util.Map; + +/** Samples for OrchestratorInstanceService Patch. */ +public final class OrchestratorInstanceServicePatchSamples { + /* + * x-ms-original-file: specification/dnc/resource-manager/Microsoft.DelegatedNetwork/stable/2021-03-15/examples/patchOrchestrator.json + */ + /** + * Sample code: update Orchestrator Instance. + * + * @param manager Entry point to DelegatedNetworkManager. + */ + public static void updateOrchestratorInstance( + com.azure.resourcemanager.delegatednetwork.DelegatedNetworkManager manager) { + Orchestrator resource = + manager + .orchestratorInstanceServices() + .getByResourceGroupWithResponse("TestRG", "testk8s1", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("key", "value")).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; + } +}