From 550c2d5409b123d7360d212ac469f3b6ae3eecc6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Mar 2022 14:45:51 +0000 Subject: [PATCH] CodeGen from PR 17439 in Azure/azure-rest-api-specs Merge d0b4592a57a50f571f3c074549f9f7e0c0eda617 into 3026119ab41bbce77275cfa3a1afbabf43af5aea --- .../CHANGELOG.md | 4 +- .../README.md | 4 +- .../SAMPLE.md | 194 ++- .../azure-resourcemanager-iotcentral/pom.xml | 2 +- .../iotcentral/IotCentralManager.java | 35 +- .../iotcentral/fluent/AppsClient.java | 43 +- .../iotcentral/fluent/IotCentralClient.java | 14 + .../iotcentral/fluent/OperationsClient.java | 4 +- .../PrivateEndpointConnectionsClient.java | 216 ++++ .../iotcentral/fluent/PrivateLinksClient.java | 72 ++ .../models/AppAvailabilityInfoInner.java | 4 - .../iotcentral/fluent/models/AppInner.java | 76 +- .../fluent/models/AppProperties.java | 95 +- .../fluent/models/AppTemplateInner.java | 4 - .../fluent/models/OperationInner.java | 4 - .../PrivateEndpointConnectionInner.java | 127 ++ .../PrivateEndpointConnectionProperties.java | 125 ++ .../models/PrivateLinkResourceInner.java | 98 ++ .../models/PrivateLinkResourceProperties.java | 77 ++ .../iotcentral/implementation/AppImpl.java | 99 +- .../implementation/AppsClientImpl.java | 186 +-- .../iotcentral/implementation/AppsImpl.java | 28 +- .../implementation/IotCentralClientImpl.java | 36 +- .../implementation/OperationsClientImpl.java | 23 +- .../implementation/OperationsImpl.java | 3 +- .../PrivateEndpointConnectionImpl.java | 142 +++ .../PrivateEndpointConnectionsClientImpl.java | 1090 +++++++++++++++++ .../PrivateEndpointConnectionsImpl.java | 210 ++++ .../PrivateLinkResourceImpl.java | 69 ++ .../PrivateLinksClientImpl.java | 422 +++++++ .../implementation/PrivateLinksImpl.java | 72 ++ .../iotcentral/models/App.java | 82 +- .../iotcentral/models/AppListResult.java | 4 - .../iotcentral/models/AppPatch.java | 71 +- .../iotcentral/models/AppSkuInfo.java | 7 +- .../models/AppTemplateLocations.java | 4 - .../iotcentral/models/AppTemplatesResult.java | 4 - .../iotcentral/models/Apps.java | 49 +- .../models/AppsCreateOrUpdateHeaders.java | 72 ++ .../models/AppsCreateOrUpdateResponse.java | 37 + .../iotcentral/models/AppsDeleteHeaders.java | 98 ++ .../iotcentral/models/AppsDeleteResponse.java | 26 + .../iotcentral/models/AppsUpdateHeaders.java | 98 ++ .../iotcentral/models/AppsUpdateResponse.java | 26 + .../iotcentral/models/NetworkAction.java | 34 + .../models/NetworkRuleSetIpRule.java | 72 ++ .../iotcentral/models/NetworkRuleSets.java | 134 ++ .../iotcentral/models/OperationDisplay.java | 4 - .../iotcentral/models/OperationInputs.java | 7 +- .../models/OperationListResult.java | 4 - .../iotcentral/models/Operations.java | 4 +- .../iotcentral/models/PrivateEndpoint.java | 35 + .../models/PrivateEndpointConnection.java | 159 +++ .../PrivateEndpointConnectionListResult.java | 51 + ...teEndpointConnectionProvisioningState.java | 41 + .../models/PrivateEndpointConnections.java | 147 +++ ...ivateEndpointConnectionsCreateHeaders.java | 72 ++ ...vateEndpointConnectionsCreateResponse.java | 38 + ...ivateEndpointConnectionsDeleteHeaders.java | 98 ++ ...vateEndpointConnectionsDeleteResponse.java | 31 + ...rivateEndpointServiceConnectionStatus.java | 38 + .../models/PrivateLinkResource.java | 68 + .../models/PrivateLinkResourceListResult.java | 51 + .../PrivateLinkServiceConnectionState.java | 104 ++ .../iotcentral/models/PrivateLinks.java | 65 + .../iotcentral/models/ProvisioningState.java | 46 + .../models/PublicNetworkAccess.java | 34 + .../models/SystemAssignedServiceIdentity.java | 7 +- .../AppsCheckNameAvailabilitySamples.java | 2 +- ...AppsCheckSubdomainAvailabilitySamples.java | 2 +- .../generated/AppsCreateOrUpdateSamples.java | 2 +- .../generated/AppsDeleteSamples.java | 2 +- .../AppsGetByResourceGroupSamples.java | 2 +- .../AppsListByResourceGroupSamples.java | 2 +- .../iotcentral/generated/AppsListSamples.java | 2 +- .../generated/AppsListTemplatesSamples.java | 2 +- .../generated/AppsUpdateSamples.java | 22 +- .../generated/OperationsListSamples.java | 2 +- ...ivateEndpointConnectionsCreateSamples.java | 33 + ...ivateEndpointConnectionsDeleteSamples.java | 25 + .../PrivateEndpointConnectionsGetSamples.java | 24 + ...PrivateEndpointConnectionsListSamples.java | 22 + .../generated/PrivateLinksGetSamples.java | 22 + .../generated/PrivateLinksListSamples.java | 22 + 84 files changed, 5391 insertions(+), 297 deletions(-) create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/PrivateLinksClient.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateLinkResourceProperties.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinksClientImpl.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinksImpl.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsCreateOrUpdateHeaders.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsCreateOrUpdateResponse.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsDeleteHeaders.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsDeleteResponse.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsUpdateHeaders.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsUpdateResponse.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkAction.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkRuleSetIpRule.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkRuleSets.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpoint.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnection.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionListResult.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnections.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsCreateHeaders.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsCreateResponse.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsDeleteHeaders.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsDeleteResponse.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointServiceConnectionStatus.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkResource.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkResourceListResult.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinks.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/ProvisioningState.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PublicNetworkAccess.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsCreateSamples.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsListSamples.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateLinksGetSamples.java create mode 100644 sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateLinksListSamples.java diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/CHANGELOG.md b/sdk/iotcentral/azure-resourcemanager-iotcentral/CHANGELOG.md index f77b4319217c6..e71b7ee81dae6 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/CHANGELOG.md +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2022-03-28) + +- Azure Resource Manager IotCentral client library for Java. This package contains Microsoft Azure SDK for IotCentral Management SDK. Use this API to manage IoT Central Applications in your Azure subscription. Package tag package-preview-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/README.md b/sdk/iotcentral/azure-resourcemanager-iotcentral/README.md index ce46616c213be..d9afbad71601a 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/README.md +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/README.md @@ -2,7 +2,7 @@ Azure Resource Manager IotCentral client library for Java. -This package contains Microsoft Azure SDK for IotCentral Management SDK. Use this API to manage IoT Central Applications in your Azure subscription. Package tag package-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for IotCentral Management SDK. Use this API to manage IoT Central Applications in your Azure subscription. Package tag package-preview-2021-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-iotcentral - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/SAMPLE.md b/sdk/iotcentral/azure-resourcemanager-iotcentral/SAMPLE.md index fc66b259ac18d..f7f04d9786118 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/SAMPLE.md +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/SAMPLE.md @@ -16,6 +16,18 @@ ## Operations - [List](#operations_list) + +## PrivateEndpointConnections + +- [Create](#privateendpointconnections_create) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) + +## PrivateLinks + +- [Get](#privatelinks_get) +- [List](#privatelinks_list) ### Apps_CheckNameAvailability ```java @@ -25,7 +37,7 @@ import com.azure.resourcemanager.iotcentral.models.OperationInputs; /** Samples for Apps CheckNameAvailability. */ public final class AppsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CheckNameAvailability.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CheckNameAvailability.json */ /** * Sample code: Apps_CheckNameAvailability. @@ -50,7 +62,7 @@ import com.azure.resourcemanager.iotcentral.models.OperationInputs; /** Samples for Apps CheckSubdomainAvailability. */ public final class AppsCheckSubdomainAvailabilitySamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CheckSubdomainAvailability.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CheckSubdomainAvailability.json */ /** * Sample code: Apps_SubdomainAvailability. @@ -77,7 +89,7 @@ import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentity /** Samples for Apps CreateOrUpdate. */ public final class AppsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CreateOrUpdate.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CreateOrUpdate.json */ /** * Sample code: Apps_CreateOrUpdate. @@ -109,7 +121,7 @@ import com.azure.core.util.Context; /** Samples for Apps Delete. */ public final class AppsDeleteSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Delete.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Delete.json */ /** * Sample code: Apps_Delete. @@ -130,7 +142,7 @@ import com.azure.core.util.Context; /** Samples for Apps GetByResourceGroup. */ public final class AppsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Get.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Get.json */ /** * Sample code: Apps_Get. @@ -151,7 +163,7 @@ import com.azure.core.util.Context; /** Samples for Apps List. */ public final class AppsListSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListBySubscription.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_ListBySubscription.json */ /** * Sample code: Apps_ListBySubscription. @@ -172,7 +184,7 @@ import com.azure.core.util.Context; /** Samples for Apps ListByResourceGroup. */ public final class AppsListByResourceGroupSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListByResourceGroup.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_ListByResourceGroup.json */ /** * Sample code: Apps_ListByResourceGroup. @@ -193,7 +205,7 @@ import com.azure.core.util.Context; /** Samples for Apps ListTemplates. */ public final class AppsListTemplatesSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Templates.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Templates.json */ /** * Sample code: Apps_ListTemplates. @@ -210,14 +222,14 @@ public final class AppsListTemplatesSamples { ```java import com.azure.core.util.Context; -import com.azure.resourcemanager.iotcentral.models.App; +import com.azure.resourcemanager.iotcentral.models.AppPatch; import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentity; import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentityType; /** Samples for Apps Update. */ public final class AppsUpdateSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Update.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Update.json */ /** * Sample code: Apps_Update. @@ -225,14 +237,16 @@ public final class AppsUpdateSamples { * @param manager Entry point to IotCentralManager. */ public static void appsUpdate(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { - App resource = - manager.apps().getByResourceGroupWithResponse("resRg", "myIoTCentralApp", Context.NONE).getValue(); - resource - .update() - .withIdentity( - new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) - .withDisplayName("My IoT Central App 2") - .apply(); + manager + .apps() + .update( + "resRg", + "myIoTCentralApp", + new AppPatch() + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withDisplayName("My IoT Central App 2"), + Context.NONE); } } ``` @@ -245,7 +259,7 @@ import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Operations_List.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Operations_List.json */ /** * Sample code: Operations_List. @@ -258,3 +272,145 @@ public final class OperationsListSamples { } ``` +### PrivateEndpointConnections_Create + +```java +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.iotcentral.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Create. */ +public final class PrivateEndpointConnectionsCreateSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Update.json + */ + /** + * Sample code: PrivateEndpointConnections_Update. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateEndpointConnectionsUpdate( + com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager + .privateEndpointConnections() + .define("myIoTCentralAppEndpoint") + .withExistingIotApp("resRg", "myIoTCentralApp") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-approved") + .withActionsRequired("None")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateEndpointConnectionsDelete( + com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager + .privateEndpointConnections() + .delete("resRg", "myIoTCentralApp", "myIoTCentralAppEndpoint", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: PrivateEndpointConnections_Get. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateEndpointConnectionsGet(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("resRg", "myIoTCentralApp", "myIoTCentralAppEndpoint", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_List.json + */ + /** + * Sample code: PrivateEndpointConnections_List. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateEndpointConnectionsList(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager.privateEndpointConnections().list("resRg", "myIoTCentralApp", Context.NONE); + } +} +``` + +### PrivateLinks_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinks Get. */ +public final class PrivateLinksGetSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateLinks_Get.json + */ + /** + * Sample code: PrivateLinks_Get. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateLinksGet(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager.privateLinks().getWithResponse("resRg", "myIoTCentralApp", "iotApp", Context.NONE); + } +} +``` + +### PrivateLinks_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinks List. */ +public final class PrivateLinksListSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateLinks_List.json + */ + /** + * Sample code: PrivateLinks_List. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateLinksList(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager.privateLinks().list("resRg", "myIoTCentralApp", Context.NONE); + } +} +``` + diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/pom.xml b/sdk/iotcentral/azure-resourcemanager-iotcentral/pom.xml index c17d63cb0a0ef..8953ab9116c77 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/pom.xml +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for IotCentral Management - This package contains Microsoft Azure SDK for IotCentral Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage IoT Central Applications in your Azure subscription. Package tag package-2021-06. + This package contains Microsoft Azure SDK for IotCentral Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage IoT Central Applications in your Azure subscription. Package tag package-preview-2021-11. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/IotCentralManager.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/IotCentralManager.java index 6b193f9c4572f..99e0b3ae1655d 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/IotCentralManager.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/IotCentralManager.java @@ -25,8 +25,12 @@ import com.azure.resourcemanager.iotcentral.implementation.AppsImpl; import com.azure.resourcemanager.iotcentral.implementation.IotCentralClientBuilder; import com.azure.resourcemanager.iotcentral.implementation.OperationsImpl; +import com.azure.resourcemanager.iotcentral.implementation.PrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.iotcentral.implementation.PrivateLinksImpl; import com.azure.resourcemanager.iotcentral.models.Apps; import com.azure.resourcemanager.iotcentral.models.Operations; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnections; +import com.azure.resourcemanager.iotcentral.models.PrivateLinks; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -38,6 +42,10 @@ public final class IotCentralManager { private Apps apps; + private PrivateEndpointConnections privateEndpointConnections; + + private PrivateLinks privateLinks; + private Operations operations; private final IotCentralClient clientObject; @@ -78,7 +86,7 @@ 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; @@ -152,9 +160,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; } @@ -176,7 +186,7 @@ public IotCentralManager authenticate(TokenCredential credential, AzureProfile p .append("-") .append("com.azure.resourcemanager.iotcentral") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -236,6 +246,23 @@ public Apps apps() { return apps; } + /** @return Resource collection API of PrivateEndpointConnections. */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = + new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this); + } + return privateEndpointConnections; + } + + /** @return Resource collection API of PrivateLinks. */ + public PrivateLinks privateLinks() { + if (this.privateLinks == null) { + this.privateLinks = new PrivateLinksImpl(clientObject.getPrivateLinks(), this); + } + return privateLinks; + } + /** @return Resource collection API of Operations. */ public Operations operations() { if (this.operations == null) { diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/AppsClient.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/AppsClient.java index 583a5e83cc45b..67cb3f22c350d 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/AppsClient.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/AppsClient.java @@ -41,7 +41,7 @@ public interface AppsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an IoT Central application. + * @return the metadata of an IoT Central application along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); @@ -57,7 +57,7 @@ public interface AppsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link SyncPoller} for polling of the IoT Central application. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AppInner> beginCreateOrUpdate( @@ -75,7 +75,7 @@ SyncPoller, AppInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link SyncPoller} for polling of the IoT Central application. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AppInner> beginCreateOrUpdate( @@ -123,11 +123,10 @@ SyncPoller, AppInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AppInner> beginUpdate( - String resourceGroupName, String resourceName, AppPatch appPatch); + SyncPoller, Void> beginUpdate(String resourceGroupName, String resourceName, AppPatch appPatch); /** * Update the metadata of an IoT Central application. @@ -139,10 +138,10 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AppInner> beginUpdate( + SyncPoller, Void> beginUpdate( String resourceGroupName, String resourceName, AppPatch appPatch, Context context); /** @@ -154,10 +153,9 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. */ @ServiceMethod(returns = ReturnType.SINGLE) - AppInner update(String resourceGroupName, String resourceName, AppPatch appPatch); + void update(String resourceGroupName, String resourceName, AppPatch appPatch); /** * Update the metadata of an IoT Central application. @@ -169,10 +167,9 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. */ @ServiceMethod(returns = ReturnType.SINGLE) - AppInner update(String resourceGroupName, String resourceName, AppPatch appPatch, Context context); + void update(String resourceGroupName, String resourceName, AppPatch appPatch, Context context); /** * Delete an IoT Central application. @@ -182,7 +179,7 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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); @@ -196,7 +193,7 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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, Context context); @@ -231,7 +228,7 @@ SyncPoller, AppInner> beginUpdate( * * @throws com.azure.core.management.exception.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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -243,7 +240,7 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -255,7 +252,7 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -268,7 +265,7 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -295,7 +292,8 @@ SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkNameAvailabilityWithResponse( @@ -323,7 +321,8 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkSubdomainAvailabilityWithResponse( @@ -334,7 +333,7 @@ Response checkSubdomainAvailabilityWithResponse( * * @throws com.azure.core.management.exception.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 available application templates. + * @return all available application templates as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listTemplates(); @@ -346,7 +345,7 @@ Response checkSubdomainAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 available application templates. + * @return all available application templates as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listTemplates(Context context); diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/IotCentralClient.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/IotCentralClient.java index 0322c1a334f15..d0d470a3cd12d 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/IotCentralClient.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/IotCentralClient.java @@ -51,6 +51,20 @@ public interface IotCentralClient { */ AppsClient getApps(); + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinksClient object to access its operations. + * + * @return the PrivateLinksClient object. + */ + PrivateLinksClient getPrivateLinks(); + /** * Gets the OperationsClient object to access its operations. * diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/OperationsClient.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/OperationsClient.java index fb19acfbc3dc7..def1fc5c9c359 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/OperationsClient.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/PrivateEndpointConnectionsClient.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/PrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..265311da784dc --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public interface PrivateEndpointConnectionsClient { + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection); + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @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 private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner create( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context); + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 private endpoint connections of a IoT Central Application as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private endpoint connections of a IoT Central Application as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/PrivateLinksClient.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/PrivateLinksClient.java new file mode 100644 index 0000000000000..688dbefd23281 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/PrivateLinksClient.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in PrivateLinksClient. */ +public interface PrivateLinksClient { + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateLinkResourceInner get(String resourceGroupName, String resourceName, String groupId); + + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String resourceName, String groupId, Context context); + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 private link resources of a IoT Central Application as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private link resources of a IoT Central Application as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppAvailabilityInfoInner.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppAvailabilityInfoInner.java index 75942e55dd4a8..ee681b4b2e5c3 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppAvailabilityInfoInner.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppAvailabilityInfoInner.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.iotcentral.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties indicating whether a given IoT Central application name or subdomain is available. */ @Immutable public final class AppAvailabilityInfoInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppAvailabilityInfoInner.class); - /* * The value which indicates whether the provided name is available. */ diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppInner.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppInner.java index f9d25554703a0..d95849f2e73d6 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppInner.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppInner.java @@ -9,16 +9,17 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.iotcentral.models.AppSkuInfo; import com.azure.resourcemanager.iotcentral.models.AppState; +import com.azure.resourcemanager.iotcentral.models.NetworkRuleSets; +import com.azure.resourcemanager.iotcentral.models.ProvisioningState; +import com.azure.resourcemanager.iotcentral.models.PublicNetworkAccess; import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentity; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** The IoT Central application. */ @Fluent public final class AppInner extends Resource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppInner.class); - /* * The common properties of an IoT Central application. */ @@ -100,6 +101,15 @@ public AppInner withTags(Map tags) { return this; } + /** + * Get the provisioningState property: The provisioning state of the application. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + /** * Get the applicationId property: The ID of the application. * @@ -191,6 +201,62 @@ public AppState state() { return this.innerProperties() == null ? null : this.innerProperties().state(); } + /** + * Get the publicNetworkAccess property: Whether requests from the public network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Whether requests from the public network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the AppInner object itself. + */ + public AppInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new AppProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the networkRuleSets property: Network Rule Set Properties of this IoT Central application. + * + * @return the networkRuleSets value. + */ + public NetworkRuleSets networkRuleSets() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSets(); + } + + /** + * Set the networkRuleSets property: Network Rule Set Properties of this IoT Central application. + * + * @param networkRuleSets the networkRuleSets value to set. + * @return the AppInner object itself. + */ + public AppInner withNetworkRuleSets(NetworkRuleSets networkRuleSets) { + if (this.innerProperties() == null) { + this.innerProperties = new AppProperties(); + } + this.innerProperties().withNetworkRuleSets(networkRuleSets); + return this; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections created on this IoT Central + * application. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + /** * Validates the instance. * @@ -201,7 +267,7 @@ public void validate() { innerProperties().validate(); } if (sku() == null) { - throw logger + throw LOGGER .logExceptionAsError(new IllegalArgumentException("Missing required property sku in model AppInner")); } else { sku().validate(); @@ -210,4 +276,6 @@ public void validate() { identity().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(AppInner.class); } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppProperties.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppProperties.java index 5b29ec381f692..8b4dad20fdc3c 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppProperties.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppProperties.java @@ -5,15 +5,21 @@ package com.azure.resourcemanager.iotcentral.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.iotcentral.models.AppState; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.iotcentral.models.NetworkRuleSets; +import com.azure.resourcemanager.iotcentral.models.ProvisioningState; +import com.azure.resourcemanager.iotcentral.models.PublicNetworkAccess; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** The properties of an IoT Central application. */ @Fluent public final class AppProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppProperties.class); + /* + * The provisioning state of the application. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; /* * The ID of the application. @@ -48,6 +54,33 @@ public final class AppProperties { @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) private AppState state; + /* + * Whether requests from the public network are allowed. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /* + * Network Rule Set Properties of this IoT Central application. + */ + @JsonProperty(value = "networkRuleSets") + private NetworkRuleSets networkRuleSets; + + /* + * Private endpoint connections created on this IoT Central application. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the provisioningState property: The provisioning state of the application. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + /** * Get the applicationId property: The ID of the application. * @@ -130,11 +163,67 @@ public AppState state() { return this.state; } + /** + * Get the publicNetworkAccess property: Whether requests from the public network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Whether requests from the public network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the AppProperties object itself. + */ + public AppProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Get the networkRuleSets property: Network Rule Set Properties of this IoT Central application. + * + * @return the networkRuleSets value. + */ + public NetworkRuleSets networkRuleSets() { + return this.networkRuleSets; + } + + /** + * Set the networkRuleSets property: Network Rule Set Properties of this IoT Central application. + * + * @param networkRuleSets the networkRuleSets value to set. + * @return the AppProperties object itself. + */ + public AppProperties withNetworkRuleSets(NetworkRuleSets networkRuleSets) { + this.networkRuleSets = networkRuleSets; + return this; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections created on this IoT Central + * application. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (networkRuleSets() != null) { + networkRuleSets().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppTemplateInner.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppTemplateInner.java index ea1efef2f0c90..be50ae9bd5d3a 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppTemplateInner.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/AppTemplateInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.iotcentral.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.iotcentral.models.AppTemplateLocations; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** IoT Central Application Template. */ @Immutable public final class AppTemplateInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppTemplateInner.class); - /* * The ID of the template. */ diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/OperationInner.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/OperationInner.java index b0bbba75e45c7..8ec5ab6ce593c 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/OperationInner.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/OperationInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.iotcentral.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.iotcentral.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** IoT Central REST API operation. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * Operation name: {provider}/{resource}/{read | write | action | delete} */ diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateEndpointConnectionInner.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..1c404359694e3 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpoint; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.iotcentral.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The private endpoint connection resource. */ +@Fluent +public final class PrivateEndpointConnectionInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.innerProperties() == null ? null : this.innerProperties().groupIds(); + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 0000000000000..b301001cfc92e --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpoint; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.iotcentral.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of the private endpoint connection. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + /* + * The group ids for the private endpoint resource. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + + /* + * The private endpoint resource. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + + /** + * Get the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The private endpoint resource. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateLinkResourceInner.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..27427400772aa --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A private link resource. */ +@Fluent +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Resource properties. + */ + @JsonProperty(value = "properties") + private PrivateLinkResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. + */ + private PrivateLinkResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.innerProperties() == null ? null : this.innerProperties().groupId(); + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.innerProperties() == null ? null : this.innerProperties().requiredMembers(); + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.innerProperties() == null ? null : this.innerProperties().requiredZoneNames(); + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + if (this.innerProperties() == null) { + this.innerProperties = new PrivateLinkResourceProperties(); + } + this.innerProperties().withRequiredZoneNames(requiredZoneNames); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateLinkResourceProperties.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateLinkResourceProperties.java new file mode 100644 index 0000000000000..3ad6c8c3d87ac --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/fluent/models/PrivateLinkResourceProperties.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Properties of a private link resource. */ +@Fluent +public final class PrivateLinkResourceProperties { + /* + * The private link resource group id. + */ + @JsonProperty(value = "groupId", access = JsonProperty.Access.WRITE_ONLY) + private String groupId; + + /* + * The private link resource required member names. + */ + @JsonProperty(value = "requiredMembers", access = JsonProperty.Access.WRITE_ONLY) + private List requiredMembers; + + /* + * The private link resource private link DNS zone name. + */ + @JsonProperty(value = "requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Get the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Get the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceProperties object itself. + */ + public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppImpl.java index 74eaa77cea05d..5f629f2bd2636 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppImpl.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppImpl.java @@ -7,13 +7,19 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.iotcentral.fluent.models.AppInner; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.iotcentral.models.App; -import com.azure.resourcemanager.iotcentral.models.AppPatch; import com.azure.resourcemanager.iotcentral.models.AppSkuInfo; import com.azure.resourcemanager.iotcentral.models.AppState; +import com.azure.resourcemanager.iotcentral.models.NetworkRuleSets; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnection; +import com.azure.resourcemanager.iotcentral.models.ProvisioningState; +import com.azure.resourcemanager.iotcentral.models.PublicNetworkAccess; import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentity; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class AppImpl implements App, App.Definition, App.Update { private AppInner innerObject; @@ -53,6 +59,10 @@ public SystemAssignedServiceIdentity identity() { return this.innerModel().identity(); } + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + public String applicationId() { return this.innerModel().applicationId(); } @@ -73,6 +83,28 @@ public AppState state() { return this.innerModel().state(); } + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + + public NetworkRuleSets networkRuleSets() { + return this.innerModel().networkRuleSets(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + public Region region() { return Region.fromName(this.regionName()); } @@ -93,8 +125,6 @@ private com.azure.resourcemanager.iotcentral.IotCentralManager manager() { private String resourceName; - private AppPatch updateAppPatch; - public AppImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; return this; @@ -125,7 +155,6 @@ public App create(Context context) { } public AppImpl update() { - this.updateAppPatch = new AppPatch(); return this; } @@ -134,13 +163,16 @@ public App apply() { serviceManager .serviceClient() .getApps() - .update(resourceGroupName, resourceName, updateAppPatch, Context.NONE); + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), Context.NONE); return this; } public App apply(Context context) { this.innerObject = - serviceManager.serviceClient().getApps().update(resourceGroupName, resourceName, updateAppPatch, context); + serviceManager + .serviceClient() + .getApps() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), context); return this; } @@ -182,53 +214,28 @@ public AppImpl withRegion(String location) { } public AppImpl withSku(AppSkuInfo sku) { - if (isInCreateMode()) { - this.innerModel().withSku(sku); - return this; - } else { - this.updateAppPatch.withSku(sku); - return this; - } + this.innerModel().withSku(sku); + return this; } public AppImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateAppPatch.withTags(tags); - return this; - } + this.innerModel().withTags(tags); + return this; } public AppImpl withIdentity(SystemAssignedServiceIdentity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateAppPatch.withIdentity(identity); - return this; - } + this.innerModel().withIdentity(identity); + return this; } public AppImpl withDisplayName(String displayName) { - if (isInCreateMode()) { - this.innerModel().withDisplayName(displayName); - return this; - } else { - this.updateAppPatch.withDisplayName(displayName); - return this; - } + this.innerModel().withDisplayName(displayName); + return this; } public AppImpl withSubdomain(String subdomain) { - if (isInCreateMode()) { - this.innerModel().withSubdomain(subdomain); - return this; - } else { - this.updateAppPatch.withSubdomain(subdomain); - return this; - } + this.innerModel().withSubdomain(subdomain); + return this; } public AppImpl withTemplate(String template) { @@ -236,7 +243,13 @@ public AppImpl withTemplate(String template) { return this; } - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public AppImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + public AppImpl withNetworkRuleSets(NetworkRuleSets networkRuleSets) { + this.innerModel().withNetworkRuleSets(networkRuleSets); + return this; } } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppsClientImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppsClientImpl.java index ccd794e425e27..36aaf41fa919d 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppsClientImpl.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppsClientImpl.java @@ -31,7 +31,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.iotcentral.fluent.AppsClient; @@ -48,8 +47,6 @@ /** An instance of this class provides access to all the operations defined in AppsClient. */ public final class AppsClientImpl implements AppsClient { - private final ClientLogger logger = new ClientLogger(AppsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final AppsService service; @@ -92,7 +89,7 @@ Mono> getByResourceGroup( @Put( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + "/{resourceName}") - @ExpectedResponses({200, 201, 202}) + @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( @HostParam("$host") String endpoint, @@ -108,7 +105,7 @@ Mono>> createOrUpdate( @Patch( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + "/{resourceName}") - @ExpectedResponses({200, 202}) + @ExpectedResponses({202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @HostParam("$host") String endpoint, @@ -124,7 +121,7 @@ Mono>> update( @Delete( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + "/{resourceName}") - @ExpectedResponses({200, 202, 204}) + @ExpectedResponses({202, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete( @HostParam("$host") String endpoint, @@ -233,7 +230,8 @@ Mono> listTemplatesNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an IoT Central application. + * @return the metadata of an IoT Central application along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -282,7 +280,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 the metadata of an IoT Central application. + * @return the metadata of an IoT Central application along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -327,7 +326,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 the metadata of an IoT Central application. + * @return the metadata of an IoT Central application on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { @@ -366,7 +365,7 @@ public AppInner getByResourceGroup(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 metadata of an IoT Central application. + * @return the metadata of an IoT Central application along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -385,7 +384,7 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the IoT Central application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -443,7 +442,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the IoT Central application along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -497,7 +496,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link PollerFlux} for polling of the IoT Central application. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AppInner> beginCreateOrUpdateAsync( @@ -506,7 +505,7 @@ private PollerFlux, AppInner> beginCreateOrUpdateAsync( return this .client .getLroResult( - mono, this.client.getHttpPipeline(), AppInner.class, AppInner.class, Context.NONE); + mono, this.client.getHttpPipeline(), AppInner.class, AppInner.class, this.client.getContext()); } /** @@ -521,7 +520,7 @@ private PollerFlux, AppInner> beginCreateOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link PollerFlux} for polling of the IoT Central application. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AppInner> beginCreateOrUpdateAsync( @@ -546,7 +545,7 @@ private PollerFlux, AppInner> beginCreateOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link SyncPoller} for polling of the IoT Central application. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AppInner> beginCreateOrUpdate( @@ -566,7 +565,7 @@ public SyncPoller, AppInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link SyncPoller} for polling of the IoT Central application. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AppInner> beginCreateOrUpdate( @@ -585,7 +584,7 @@ public SyncPoller, AppInner> beginCreateOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the IoT Central application on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String resourceName, AppInner app) { @@ -606,7 +605,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, 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 the IoT Central application. + * @return the IoT Central application on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -662,7 +661,7 @@ public AppInner createOrUpdate(String resourceGroupName, String resourceName, Ap * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -718,7 +717,7 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -770,16 +769,16 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AppInner> beginUpdateAsync( + private PollerFlux, Void> beginUpdateAsync( String resourceGroupName, String resourceName, AppPatch appPatch) { Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, appPatch); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), AppInner.class, AppInner.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -792,18 +791,17 @@ private PollerFlux, AppInner> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, AppInner> beginUpdateAsync( + private PollerFlux, Void> beginUpdateAsync( String resourceGroupName, String resourceName, AppPatch appPatch, Context context) { context = this.client.mergeContext(context); Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, appPatch, context); return this .client - .getLroResult( - mono, this.client.getHttpPipeline(), AppInner.class, AppInner.class, context); + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** @@ -815,10 +813,10 @@ private PollerFlux, AppInner> beginUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AppInner> beginUpdate( + public SyncPoller, Void> beginUpdate( String resourceGroupName, String resourceName, AppPatch appPatch) { return beginUpdateAsync(resourceGroupName, resourceName, appPatch).getSyncPoller(); } @@ -833,10 +831,10 @@ public SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AppInner> beginUpdate( + public SyncPoller, Void> beginUpdate( String resourceGroupName, String resourceName, AppPatch appPatch, Context context) { return beginUpdateAsync(resourceGroupName, resourceName, appPatch, context).getSyncPoller(); } @@ -850,10 +848,10 @@ public SyncPoller, AppInner> beginUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) { + private Mono updateAsync(String resourceGroupName, String resourceName, AppPatch appPatch) { return beginUpdateAsync(resourceGroupName, resourceName, appPatch) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -869,11 +867,10 @@ private Mono updateAsync(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 IoT Central application. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String resourceName, AppPatch appPatch, Context context) { + private Mono updateAsync(String resourceGroupName, String resourceName, AppPatch appPatch, Context context) { return beginUpdateAsync(resourceGroupName, resourceName, appPatch, context) .last() .flatMap(this.client::getLroFinalResultOrError); @@ -888,11 +885,10 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AppInner update(String resourceGroupName, String resourceName, AppPatch appPatch) { - return updateAsync(resourceGroupName, resourceName, appPatch).block(); + public void update(String resourceGroupName, String resourceName, AppPatch appPatch) { + updateAsync(resourceGroupName, resourceName, appPatch).block(); } /** @@ -905,11 +901,10 @@ public AppInner update(String resourceGroupName, String resourceName, AppPatch a * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the IoT Central application. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AppInner update(String resourceGroupName, String resourceName, AppPatch appPatch, Context context) { - return updateAsync(resourceGroupName, resourceName, appPatch, context).block(); + public void update(String resourceGroupName, String resourceName, AppPatch appPatch, Context context) { + updateAsync(resourceGroupName, resourceName, appPatch, context).block(); } /** @@ -920,7 +915,7 @@ public AppInner update(String resourceGroupName, String resourceName, AppPatch a * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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) { @@ -968,7 +963,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( @@ -1013,14 +1008,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.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()); } /** @@ -1032,7 +1028,7 @@ 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.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( @@ -1052,7 +1048,7 @@ 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.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { @@ -1068,7 +1064,7 @@ 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.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( @@ -1084,7 +1080,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) { @@ -1100,7 +1096,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) { @@ -1143,7 +1139,8 @@ public void delete(String resourceGroupName, String resourceName, Context 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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1189,7 +1186,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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1230,7 +1228,7 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1245,7 +1243,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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1258,7 +1256,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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1272,7 +1270,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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1286,7 +1284,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 IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -1338,7 +1337,8 @@ private Mono> listByResourceGroupSinglePageAsync(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 all the IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1387,7 +1387,7 @@ private Mono> listByResourceGroupSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1404,7 +1404,7 @@ private PagedFlux listByResourceGroupAsync(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 all the IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -1420,7 +1420,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupName, C * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1435,7 +1435,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1450,7 +1450,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName, Con * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1497,7 +1498,8 @@ private Mono> checkNameAvailabilityWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1540,7 +1542,8 @@ private Mono> checkNameAvailabilityWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync(OperationInputs operationInputs) { @@ -1579,7 +1582,8 @@ public AppAvailabilityInfoInner checkNameAvailability(OperationInputs operationI * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse( @@ -1595,7 +1599,8 @@ public Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkSubdomainAvailabilityWithResponseAsync( @@ -1642,7 +1647,8 @@ private Mono> checkSubdomainAvailabilityWithR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkSubdomainAvailabilityWithResponseAsync( @@ -1685,7 +1691,8 @@ private Mono> checkSubdomainAvailabilityWithR * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkSubdomainAvailabilityAsync(OperationInputs operationInputs) { @@ -1724,7 +1731,8 @@ public AppAvailabilityInfoInner checkSubdomainAvailability(OperationInputs opera * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkSubdomainAvailabilityWithResponse( @@ -1737,7 +1745,8 @@ public Response checkSubdomainAvailabilityWithResponse * * @throws 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 available application templates. + * @return all available application templates along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listTemplatesSinglePageAsync() { @@ -1783,7 +1792,8 @@ private Mono> listTemplatesSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 available application templates. + * @return all available application templates along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listTemplatesSinglePageAsync(Context context) { @@ -1824,7 +1834,7 @@ private Mono> listTemplatesSinglePageAsync(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 available application templates. + * @return all available application templates as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listTemplatesAsync() { @@ -1839,7 +1849,7 @@ private PagedFlux listTemplatesAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 available application templates. + * @return all available application templates as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listTemplatesAsync(Context context) { @@ -1853,7 +1863,7 @@ private PagedFlux listTemplatesAsync(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 available application templates. + * @return all available application templates as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listTemplates() { @@ -1867,7 +1877,7 @@ public PagedIterable listTemplates() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 available application templates. + * @return all available application templates as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listTemplates(Context context) { @@ -1881,7 +1891,8 @@ public PagedIterable listTemplates(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 IoT Central Applications with a next link. + * @return a list of IoT Central Applications with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1918,7 +1929,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 IoT Central Applications with a next link. + * @return a list of IoT Central Applications with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -1953,7 +1965,8 @@ private Mono> listBySubscriptionNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 IoT Central Applications with a next link. + * @return a list of IoT Central Applications with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1990,7 +2003,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(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 a list of IoT Central Applications with a next link. + * @return a list of IoT Central Applications with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -2025,7 +2039,8 @@ private Mono> listByResourceGroupNextSinglePageAsync(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 a list of IoT Central Application Templates with a next link. + * @return a list of IoT Central Application Templates with a next link along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listTemplatesNextSinglePageAsync(String nextLink) { @@ -2061,7 +2076,8 @@ private Mono> listTemplatesNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central Application Templates with a next link. + * @return a list of IoT Central Application Templates with a next link along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listTemplatesNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppsImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppsImpl.java index 5a52afca51106..97e8dc1db7872 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppsImpl.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/AppsImpl.java @@ -15,13 +15,13 @@ import com.azure.resourcemanager.iotcentral.fluent.models.AppTemplateInner; import com.azure.resourcemanager.iotcentral.models.App; import com.azure.resourcemanager.iotcentral.models.AppAvailabilityInfo; +import com.azure.resourcemanager.iotcentral.models.AppPatch; import com.azure.resourcemanager.iotcentral.models.AppTemplate; import com.azure.resourcemanager.iotcentral.models.Apps; import com.azure.resourcemanager.iotcentral.models.OperationInputs; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class AppsImpl implements Apps { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(AppsImpl.class); private final AppsClient innerClient; @@ -56,6 +56,14 @@ public Response getByResourceGroupWithResponse( } } + public void update(String resourceGroupName, String resourceName, AppPatch appPatch) { + this.serviceClient().update(resourceGroupName, resourceName, appPatch); + } + + public void update(String resourceGroupName, String resourceName, AppPatch appPatch, Context context) { + this.serviceClient().update(resourceGroupName, resourceName, appPatch, context); + } + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { this.serviceClient().delete(resourceGroupName, resourceName); } @@ -145,7 +153,7 @@ public PagedIterable listTemplates(Context context) { public App getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -153,7 +161,7 @@ public App getById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "iotApps"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'iotApps'.", id))); @@ -164,7 +172,7 @@ public App 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 @@ -172,7 +180,7 @@ public Response getByIdWithResponse(String id, Context context) { } String resourceName = Utils.getValueFromIdByName(id, "iotApps"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'iotApps'.", id))); @@ -183,7 +191,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 @@ -191,7 +199,7 @@ public void deleteById(String id) { } String resourceName = Utils.getValueFromIdByName(id, "iotApps"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'iotApps'.", id))); @@ -202,7 +210,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 @@ -210,7 +218,7 @@ public void deleteByIdWithResponse(String id, Context context) { } String resourceName = Utils.getValueFromIdByName(id, "iotApps"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'iotApps'.", id))); diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/IotCentralClientImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/IotCentralClientImpl.java index 28294e8e2e3eb..ae604556b866f 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/IotCentralClientImpl.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/IotCentralClientImpl.java @@ -24,6 +24,8 @@ import com.azure.resourcemanager.iotcentral.fluent.AppsClient; import com.azure.resourcemanager.iotcentral.fluent.IotCentralClient; import com.azure.resourcemanager.iotcentral.fluent.OperationsClient; +import com.azure.resourcemanager.iotcentral.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.iotcentral.fluent.PrivateLinksClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -37,8 +39,6 @@ /** Initializes a new instance of the IotCentralClientImpl type. */ @ServiceClient(builder = IotCentralClientBuilder.class) public final class IotCentralClientImpl implements IotCentralClient { - private final ClientLogger logger = new ClientLogger(IotCentralClientImpl.class); - /** The subscription identifier. */ private final String subscriptionId; @@ -123,6 +123,30 @@ public AppsClient getApps() { return this.apps; } + /** The PrivateEndpointConnectionsClient object to access its operations. */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** The PrivateLinksClient object to access its operations. */ + private final PrivateLinksClient privateLinks; + + /** + * Gets the PrivateLinksClient object to access its operations. + * + * @return the PrivateLinksClient object. + */ + public PrivateLinksClient getPrivateLinks() { + return this.privateLinks; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -157,8 +181,10 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-06-01"; + this.apiVersion = "2021-11-01-preview"; this.apps = new AppsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinks = new PrivateLinksClientImpl(this); this.operations = new OperationsClientImpl(this); } @@ -245,7 +271,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -304,4 +330,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(IotCentralClientImpl.class); } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/OperationsClientImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/OperationsClientImpl.java index 9b34a05ad0a69..f40fc4ddf1efb 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/OperationsClientImpl.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/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.iotcentral.fluent.OperationsClient; import com.azure.resourcemanager.iotcentral.fluent.models.OperationInner; import com.azure.resourcemanager.iotcentral.models.OperationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,8 @@ Mono> listNext( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +116,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +147,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +161,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +174,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +188,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +202,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +239,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/OperationsImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/OperationsImpl.java index 03f136e3b2b79..305c0c34e17b9 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/OperationsImpl.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.iotcentral.fluent.models.OperationInner; import com.azure.resourcemanager.iotcentral.models.Operation; import com.azure.resourcemanager.iotcentral.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/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..e0efe2693920d --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpoint; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnection; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.iotcentral.models.PrivateLinkServiceConnectionState; +import java.util.Collections; +import java.util.List; + +public final class PrivateEndpointConnectionImpl + implements PrivateEndpointConnection, PrivateEndpointConnection.Definition { + private PrivateEndpointConnectionInner innerObject; + + private final com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager; + + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public List groupIds() { + List inner = this.innerModel().groupIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.iotcentral.IotCentralManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String privateEndpointConnectionName; + + public PrivateEndpointConnectionImpl withExistingIotApp(String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public PrivateEndpointConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create( + resourceGroupName, resourceName, privateEndpointConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public PrivateEndpointConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .create(resourceGroupName, resourceName, privateEndpointConnectionName, this.innerModel(), context); + return this; + } + + PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager) { + this.innerObject = new PrivateEndpointConnectionInner(); + this.serviceManager = serviceManager; + this.privateEndpointConnectionName = name; + } + + public PrivateEndpointConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + return this; + } + + public PrivateEndpointConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getPrivateEndpointConnections() + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context) + .getValue(); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.innerModel().withPrivateEndpoint(privateEndpoint); + return this; + } + + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.innerModel().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..848ba8b95a5f8 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1090 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.iotcentral.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnectionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ +public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient { + /** The proxy service used to perform REST calls. */ + private final PrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final IotCentralClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(IotCentralClientImpl client) { + this.service = + RestProxy + .create( + PrivateEndpointConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for IotCentralClientPrivateEndpointConnections to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "IotCentralClientPriv") + private interface PrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + + "/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + + "/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @BodyParam("application/json") PrivateEndpointConnectionInner privateEndpointConnection, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + + "/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + + "/{resourceName}/privateEndpointConnections") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getAsync(resourceGroupName, resourceName, privateEndpointConnectionName).block(); + } + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context).block(); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + privateEndpointConnection, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @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 private endpoint connection resource along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (privateEndpointConnection == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnection is required and cannot be null.")); + } else { + privateEndpointConnection.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + privateEndpointConnection, + accept, + context); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + Mono>> mono = + createWithResponseAsync( + resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + this.client.getContext()); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PrivateEndpointConnectionInner> beginCreateAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createWithResponseAsync( + resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + PrivateEndpointConnectionInner.class, + PrivateEndpointConnectionInner.class, + context); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateAsync( + resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection) + .getSyncPoller(); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PrivateEndpointConnectionInner> beginCreate( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginCreateAsync( + resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, context) + .getSyncPoller(); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateAsync( + resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @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 private endpoint connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return beginCreateAsync( + resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection) { + return createAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection) + .block(); + } + + /** + * Update a private endpoint connection. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param privateEndpointConnection The private endpoint connection metadata. + * @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 private endpoint connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner create( + String resourceGroupName, + String resourceName, + String privateEndpointConnectionName, + PrivateEndpointConnectionInner privateEndpointConnection, + Context context) { + return createAsync( + resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, context) + .block(); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + privateEndpointConnectionName, + accept, + context); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).getSyncPoller(); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) + .getSyncPoller(); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + deleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).block(); + } + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + deleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context).block(); + } + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private endpoint connections of a IoT Central Application along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private endpoint connections of a IoT Central Application along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private endpoint connections of a IoT Central Application as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName)); + } + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private endpoint connections of a IoT Central Application as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String resourceName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context)); + } + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private endpoint connections of a IoT Central Application as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); + } + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private endpoint connections of a IoT Central Application as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionsImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..920027dac29cf --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.iotcentral.fluent.PrivateEndpointConnectionsClient; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnection; +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointConnections; + +public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { + private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class); + + private final PrivateEndpointConnectionsClient innerClient; + + private final com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager; + + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnection get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, resourceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName); + } + + public void delete( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, resourceName); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PagedIterable list( + String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, resourceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + } + + public PrivateEndpointConnection getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "iotApps"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotApps'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "iotApps"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotApps'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "iotApps"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotApps'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "iotApps"); + if (resourceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'iotApps'.", id))); + } + String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections"); + if (privateEndpointConnectionName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", + id))); + } + this.delete(resourceGroupName, resourceName, privateEndpointConnectionName, context); + } + + private PrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.iotcentral.IotCentralManager manager() { + return this.serviceManager; + } + + public PrivateEndpointConnectionImpl define(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinkResourceImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..1fcb5c85eaf1d --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.iotcentral.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager; + + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.iotcentral.IotCentralManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinksClientImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinksClientImpl.java new file mode 100644 index 0000000000000..f7016e922464a --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinksClientImpl.java @@ -0,0 +1,422 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.iotcentral.fluent.PrivateLinksClient; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.iotcentral.models.PrivateLinkResourceListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in PrivateLinksClient. */ +public final class PrivateLinksClientImpl implements PrivateLinksClient { + /** The proxy service used to perform REST calls. */ + private final PrivateLinksService service; + + /** The service client containing this operation class. */ + private final IotCentralClientImpl client; + + /** + * Initializes an instance of PrivateLinksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateLinksClientImpl(IotCentralClientImpl client) { + this.service = + RestProxy.create(PrivateLinksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for IotCentralClientPrivateLinks to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "IotCentralClientPriv") + private interface PrivateLinksService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + + "/{resourceName}/privateLinkResources/{groupId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("groupId") String groupId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps" + + "/{resourceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String groupId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + groupId, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String groupId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (groupId == null) { + return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + groupId, + accept, + context); + } + + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String resourceName, String groupId) { + return getWithResponseAsync(resourceGroupName, resourceName, groupId) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String resourceName, String groupId) { + return getAsync(resourceGroupName, resourceName, groupId).block(); + } + + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String resourceName, String groupId, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, groupId, context).block(); + } + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resources of a IoT Central Application along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private link resources of a IoT Central Application along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resources of a IoT Central Application as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName)); + } + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private link resources of a IoT Central Application as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String resourceName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, resourceName, context)); + } + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 private link resources of a IoT Central Application as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); + } + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private link resources of a IoT Central Application as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinksImpl.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinksImpl.java new file mode 100644 index 0000000000000..290a629d87ad3 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/implementation/PrivateLinksImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.iotcentral.fluent.PrivateLinksClient; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.iotcentral.models.PrivateLinkResource; +import com.azure.resourcemanager.iotcentral.models.PrivateLinks; + +public final class PrivateLinksImpl implements PrivateLinks { + private static final ClientLogger LOGGER = new ClientLogger(PrivateLinksImpl.class); + + private final PrivateLinksClient innerClient; + + private final com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager; + + public PrivateLinksImpl( + PrivateLinksClient innerClient, com.azure.resourcemanager.iotcentral.IotCentralManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateLinkResource get(String resourceGroupName, String resourceName, String groupId) { + PrivateLinkResourceInner inner = this.serviceClient().get(resourceGroupName, resourceName, groupId); + if (inner != null) { + return new PrivateLinkResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String resourceName, String groupId, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, resourceName, groupId, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateLinkResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, resourceName, context); + return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + private PrivateLinksClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.iotcentral.IotCentralManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/App.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/App.java index ae3884f769f89..48278967e764a 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/App.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/App.java @@ -7,6 +7,7 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.iotcentral.fluent.models.AppInner; +import java.util.List; import java.util.Map; /** An immutable client-side representation of App. */ @@ -60,6 +61,13 @@ public interface App { */ SystemAssignedServiceIdentity identity(); + /** + * Gets the provisioningState property: The provisioning state of the application. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + /** * Gets the applicationId property: The ID of the application. * @@ -97,6 +105,28 @@ public interface App { */ AppState state(); + /** + * Gets the publicNetworkAccess property: Whether requests from the public network are allowed. + * + * @return the publicNetworkAccess value. + */ + PublicNetworkAccess publicNetworkAccess(); + + /** + * Gets the networkRuleSets property: Network Rule Set Properties of this IoT Central application. + * + * @return the networkRuleSets value. + */ + NetworkRuleSets networkRuleSets(); + + /** + * Gets the privateEndpointConnections property: Private endpoint connections created on this IoT Central + * application. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + /** * Gets the region of the resource. * @@ -178,7 +208,9 @@ interface WithCreate DefinitionStages.WithIdentity, DefinitionStages.WithDisplayName, DefinitionStages.WithSubdomain, - DefinitionStages.WithTemplate { + DefinitionStages.WithTemplate, + DefinitionStages.WithPublicNetworkAccess, + DefinitionStages.WithNetworkRuleSets { /** * Executes the create request. * @@ -248,6 +280,26 @@ interface WithTemplate { */ WithCreate withTemplate(String template); } + /** The stage of the App definition allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether requests from the public network are allowed.. + * + * @param publicNetworkAccess Whether requests from the public network are allowed. + * @return the next definition stage. + */ + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the App definition allowing to specify networkRuleSets. */ + interface WithNetworkRuleSets { + /** + * Specifies the networkRuleSets property: Network Rule Set Properties of this IoT Central application.. + * + * @param networkRuleSets Network Rule Set Properties of this IoT Central application. + * @return the next definition stage. + */ + WithCreate withNetworkRuleSets(NetworkRuleSets networkRuleSets); + } } /** * Begins update for the App resource. @@ -262,7 +314,9 @@ interface Update UpdateStages.WithSku, UpdateStages.WithIdentity, UpdateStages.WithDisplayName, - UpdateStages.WithSubdomain { + UpdateStages.WithSubdomain, + UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithNetworkRuleSets { /** * Executes the update request. * @@ -283,9 +337,9 @@ interface UpdateStages { /** The stage of the App update allowing to specify tags. */ interface WithTags { /** - * Specifies the tags property: Instance tags. + * Specifies the tags property: Resource tags.. * - * @param tags Instance tags. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); @@ -330,6 +384,26 @@ interface WithSubdomain { */ Update withSubdomain(String subdomain); } + /** The stage of the App update allowing to specify publicNetworkAccess. */ + interface WithPublicNetworkAccess { + /** + * Specifies the publicNetworkAccess property: Whether requests from the public network are allowed.. + * + * @param publicNetworkAccess Whether requests from the public network are allowed. + * @return the next definition stage. + */ + Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); + } + /** The stage of the App update allowing to specify networkRuleSets. */ + interface WithNetworkRuleSets { + /** + * Specifies the networkRuleSets property: Network Rule Set Properties of this IoT Central application.. + * + * @param networkRuleSets Network Rule Set Properties of this IoT Central application. + * @return the next definition stage. + */ + Update withNetworkRuleSets(NetworkRuleSets networkRuleSets); + } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppListResult.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppListResult.java index bcdabe9f44c42..aaff594136f68 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppListResult.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.iotcentral.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.iotcentral.fluent.models.AppInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A list of IoT Central Applications with a next link. */ @Fluent public final class AppListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppListResult.class); - /* * The link used to get the next page of IoT Central Applications. */ diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppPatch.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppPatch.java index 7e24be92770d3..ad63004c99ae7 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppPatch.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppPatch.java @@ -5,18 +5,16 @@ package com.azure.resourcemanager.iotcentral.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.iotcentral.fluent.models.AppProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import java.util.Map; /** The description of the IoT Central application. */ @Fluent public final class AppPatch { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppPatch.class); - /* * Instance tags */ @@ -111,6 +109,15 @@ public AppPatch withIdentity(SystemAssignedServiceIdentity identity) { return this; } + /** + * Get the provisioningState property: The provisioning state of the application. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + /** * Get the applicationId property: The ID of the application. * @@ -202,6 +209,62 @@ public AppState state() { return this.innerProperties() == null ? null : this.innerProperties().state(); } + /** + * Get the publicNetworkAccess property: Whether requests from the public network are allowed. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); + } + + /** + * Set the publicNetworkAccess property: Whether requests from the public network are allowed. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the AppPatch object itself. + */ + public AppPatch withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + if (this.innerProperties() == null) { + this.innerProperties = new AppProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); + return this; + } + + /** + * Get the networkRuleSets property: Network Rule Set Properties of this IoT Central application. + * + * @return the networkRuleSets value. + */ + public NetworkRuleSets networkRuleSets() { + return this.innerProperties() == null ? null : this.innerProperties().networkRuleSets(); + } + + /** + * Set the networkRuleSets property: Network Rule Set Properties of this IoT Central application. + * + * @param networkRuleSets the networkRuleSets value to set. + * @return the AppPatch object itself. + */ + public AppPatch withNetworkRuleSets(NetworkRuleSets networkRuleSets) { + if (this.innerProperties() == null) { + this.innerProperties = new AppProperties(); + } + this.innerProperties().withNetworkRuleSets(networkRuleSets); + return this; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections created on this IoT Central + * application. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); + } + /** * Validates the instance. * diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppSkuInfo.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppSkuInfo.java index a928a2581a9be..9480ed1cc48b1 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppSkuInfo.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppSkuInfo.java @@ -6,14 +6,11 @@ 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; /** Information about the SKU of the IoT Central application. */ @Fluent public final class AppSkuInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppSkuInfo.class); - /* * The name of the SKU. */ @@ -47,9 +44,11 @@ public AppSkuInfo withName(AppSku name) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model AppSkuInfo")); } } + + private static final ClientLogger LOGGER = new ClientLogger(AppSkuInfo.class); } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppTemplateLocations.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppTemplateLocations.java index d16e986f82f66..5f9053ef10eb2 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppTemplateLocations.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppTemplateLocations.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.iotcentral.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; /** IoT Central Application Template Locations. */ @Immutable public final class AppTemplateLocations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppTemplateLocations.class); - /* * The ID of the location. */ diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppTemplatesResult.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppTemplatesResult.java index 8823986122119..e2625e6bee2d1 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppTemplatesResult.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppTemplatesResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.iotcentral.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.iotcentral.fluent.models.AppTemplateInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A list of IoT Central Application Templates with a next link. */ @Fluent public final class AppTemplatesResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AppTemplatesResult.class); - /* * The link used to get the next page of IoT Central application templates. */ diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/Apps.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/Apps.java index 7683857c7fc24..319c40bfdde6a 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/Apps.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/Apps.java @@ -31,10 +31,35 @@ public interface Apps { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an IoT Central application. + * @return the metadata of an IoT Central application along with {@link Response}. */ Response getByResourceGroupWithResponse(String resourceGroupName, String resourceName, Context context); + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.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 update(String resourceGroupName, String resourceName, AppPatch appPatch); + + /** + * Update the metadata of an IoT Central application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param appPatch The IoT Central application metadata and security metadata. + * @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 update(String resourceGroupName, String resourceName, AppPatch appPatch, Context context); + /** * Delete an IoT Central application. * @@ -63,7 +88,7 @@ public interface Apps { * * @throws com.azure.core.management.exception.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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -74,7 +99,7 @@ public interface Apps { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 IoT Central Applications in a subscription. + * @return all IoT Central Applications in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -85,7 +110,7 @@ public interface Apps { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -97,7 +122,7 @@ public interface Apps { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 IoT Central Applications in a resource group. + * @return all the IoT Central Applications in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -122,7 +147,8 @@ public interface Apps { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response}. */ Response checkNameAvailabilityWithResponse(OperationInputs operationInputs, Context context); @@ -147,7 +173,8 @@ public interface Apps { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT Central application name or subdomain is available. + * @return the properties indicating whether a given IoT Central application name or subdomain is available along + * with {@link Response}. */ Response checkSubdomainAvailabilityWithResponse( OperationInputs operationInputs, Context context); @@ -157,7 +184,7 @@ Response checkSubdomainAvailabilityWithResponse( * * @throws com.azure.core.management.exception.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 available application templates. + * @return all available application templates as paginated response with {@link PagedIterable}. */ PagedIterable listTemplates(); @@ -168,7 +195,7 @@ Response checkSubdomainAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 available application templates. + * @return all available application templates as paginated response with {@link PagedIterable}. */ PagedIterable listTemplates(Context context); @@ -179,7 +206,7 @@ Response checkSubdomainAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an IoT Central application. + * @return the metadata of an IoT Central application along with {@link Response}. */ App getById(String id); @@ -191,7 +218,7 @@ Response checkSubdomainAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of an IoT Central application. + * @return the metadata of an IoT Central application along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsCreateOrUpdateHeaders.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsCreateOrUpdateHeaders.java new file mode 100644 index 0000000000000..6ba3f5fb66aab --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsCreateOrUpdateHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AppsCreateOrUpdateHeaders model. */ +@Fluent +public final class AppsCreateOrUpdateHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the AppsCreateOrUpdateHeaders object itself. + */ + public AppsCreateOrUpdateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the AppsCreateOrUpdateHeaders object itself. + */ + public AppsCreateOrUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsCreateOrUpdateResponse.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsCreateOrUpdateResponse.java new file mode 100644 index 0000000000000..aed93c9bbe40d --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsCreateOrUpdateResponse.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.iotcentral.fluent.models.AppInner; + +/** Contains all response data for the createOrUpdate operation. */ +public final class AppsCreateOrUpdateResponse extends ResponseBase { + /** + * Creates an instance of AppsCreateOrUpdateResponse. + * + * @param request the request which resulted in this AppsCreateOrUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AppsCreateOrUpdateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + AppInner value, + AppsCreateOrUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public AppInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsDeleteHeaders.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsDeleteHeaders.java new file mode 100644 index 0000000000000..bd116e2bbb6f3 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsDeleteHeaders.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AppsDeleteHeaders model. */ +@Fluent +public final class AppsDeleteHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the AppsDeleteHeaders object itself. + */ + public AppsDeleteHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the AppsDeleteHeaders object itself. + */ + public AppsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the AppsDeleteHeaders object itself. + */ + public AppsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsDeleteResponse.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsDeleteResponse.java new file mode 100644 index 0000000000000..cfc4de95e5d57 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsDeleteResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class AppsDeleteResponse extends ResponseBase { + /** + * Creates an instance of AppsDeleteResponse. + * + * @param request the request which resulted in this AppsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AppsDeleteResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, AppsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsUpdateHeaders.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsUpdateHeaders.java new file mode 100644 index 0000000000000..b71cd6b5efe15 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsUpdateHeaders.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The AppsUpdateHeaders model. */ +@Fluent +public final class AppsUpdateHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the AppsUpdateHeaders object itself. + */ + public AppsUpdateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the AppsUpdateHeaders object itself. + */ + public AppsUpdateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the AppsUpdateHeaders object itself. + */ + public AppsUpdateHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsUpdateResponse.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsUpdateResponse.java new file mode 100644 index 0000000000000..f6e63faddafe2 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/AppsUpdateResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the update operation. */ +public final class AppsUpdateResponse extends ResponseBase { + /** + * Creates an instance of AppsUpdateResponse. + * + * @param request the request which resulted in this AppsUpdateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public AppsUpdateResponse( + HttpRequest request, int statusCode, HttpHeaders rawHeaders, Void value, AppsUpdateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkAction.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkAction.java new file mode 100644 index 0000000000000..13ca4f6f36788 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkAction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for NetworkAction. */ +public final class NetworkAction extends ExpandableStringEnum { + /** Static value Allow for NetworkAction. */ + public static final NetworkAction ALLOW = fromString("Allow"); + + /** Static value Deny for NetworkAction. */ + public static final NetworkAction DENY = fromString("Deny"); + + /** + * Creates or finds a NetworkAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkAction. + */ + @JsonCreator + public static NetworkAction fromString(String name) { + return fromString(name, NetworkAction.class); + } + + /** @return known NetworkAction values. */ + public static Collection values() { + return values(NetworkAction.class); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkRuleSetIpRule.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkRuleSetIpRule.java new file mode 100644 index 0000000000000..fb0075591fea0 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkRuleSetIpRule.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An object for an IP range that will be allowed access. */ +@Fluent +public final class NetworkRuleSetIpRule { + /* + * The readable name of the IP rule. + */ + @JsonProperty(value = "filterName") + private String filterName; + + /* + * The CIDR block defining the IP range. + */ + @JsonProperty(value = "ipMask") + private String ipMask; + + /** + * Get the filterName property: The readable name of the IP rule. + * + * @return the filterName value. + */ + public String filterName() { + return this.filterName; + } + + /** + * Set the filterName property: The readable name of the IP rule. + * + * @param filterName the filterName value to set. + * @return the NetworkRuleSetIpRule object itself. + */ + public NetworkRuleSetIpRule withFilterName(String filterName) { + this.filterName = filterName; + return this; + } + + /** + * Get the ipMask property: The CIDR block defining the IP range. + * + * @return the ipMask value. + */ + public String ipMask() { + return this.ipMask; + } + + /** + * Set the ipMask property: The CIDR block defining the IP range. + * + * @param ipMask the ipMask value to set. + * @return the NetworkRuleSetIpRule object itself. + */ + public NetworkRuleSetIpRule withIpMask(String ipMask) { + this.ipMask = ipMask; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkRuleSets.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkRuleSets.java new file mode 100644 index 0000000000000..5fd45a03ca620 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/NetworkRuleSets.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network Rule Set Properties of this IoT Central application. */ +@Fluent +public final class NetworkRuleSets { + /* + * Whether these rules apply for device connectivity to IoT Hub and Device + * Provisioning service associated with this application. + */ + @JsonProperty(value = "applyToDevices") + private Boolean applyToDevices; + + /* + * Whether these rules apply for connectivity via IoT Central web portal + * and APIs. + */ + @JsonProperty(value = "applyToIoTCentral") + private Boolean applyToIoTCentral; + + /* + * The default network action to apply. + */ + @JsonProperty(value = "defaultAction") + private NetworkAction defaultAction; + + /* + * List of IP rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * Get the applyToDevices property: Whether these rules apply for device connectivity to IoT Hub and Device + * Provisioning service associated with this application. + * + * @return the applyToDevices value. + */ + public Boolean applyToDevices() { + return this.applyToDevices; + } + + /** + * Set the applyToDevices property: Whether these rules apply for device connectivity to IoT Hub and Device + * Provisioning service associated with this application. + * + * @param applyToDevices the applyToDevices value to set. + * @return the NetworkRuleSets object itself. + */ + public NetworkRuleSets withApplyToDevices(Boolean applyToDevices) { + this.applyToDevices = applyToDevices; + return this; + } + + /** + * Get the applyToIoTCentral property: Whether these rules apply for connectivity via IoT Central web portal and + * APIs. + * + * @return the applyToIoTCentral value. + */ + public Boolean applyToIoTCentral() { + return this.applyToIoTCentral; + } + + /** + * Set the applyToIoTCentral property: Whether these rules apply for connectivity via IoT Central web portal and + * APIs. + * + * @param applyToIoTCentral the applyToIoTCentral value to set. + * @return the NetworkRuleSets object itself. + */ + public NetworkRuleSets withApplyToIoTCentral(Boolean applyToIoTCentral) { + this.applyToIoTCentral = applyToIoTCentral; + return this; + } + + /** + * Get the defaultAction property: The default network action to apply. + * + * @return the defaultAction value. + */ + public NetworkAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: The default network action to apply. + * + * @param defaultAction the defaultAction value to set. + * @return the NetworkRuleSets object itself. + */ + public NetworkRuleSets withDefaultAction(NetworkAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the ipRules property: List of IP rules. + * + * @return the ipRules value. + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the ipRules property: List of IP rules. + * + * @param ipRules the ipRules value to set. + * @return the NetworkRuleSets object itself. + */ + public NetworkRuleSets withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipRules() != null) { + ipRules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationDisplay.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationDisplay.java index 00feacd57fdda..52bec7d332af9 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationDisplay.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.iotcentral.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 object that represents the operation. */ @Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * Service provider: Microsoft IoT Central */ diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationInputs.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationInputs.java index 1c8126d3ce6ee..65c1a5dd6ded8 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationInputs.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationInputs.java @@ -6,14 +6,11 @@ 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; /** Input values. */ @Fluent public final class OperationInputs { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInputs.class); - /* * The name of the IoT Central application instance to check. */ @@ -73,9 +70,11 @@ public OperationInputs withType(String type) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model OperationInputs")); } } + + private static final ClientLogger LOGGER = new ClientLogger(OperationInputs.class); } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationListResult.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationListResult.java index 6b4ba5a6c00e2..6fdd64db00073 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationListResult.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/OperationListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.iotcentral.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.iotcentral.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A list of IoT Central operations. It contains a list of operations and a URL link to get the next set of results. */ @Fluent public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * The link used to get the next page of IoT Central description objects. */ diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/Operations.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/Operations.java index 3ff9abc07d906..579d9c3ed1c71 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/Operations.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of IoT Central operations. + * @return a list of IoT Central operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpoint.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..dbec01b4f4299 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpoint.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The private endpoint resource. */ +@Immutable +public final class PrivateEndpoint { + /* + * The ARM identifier for private endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get the id property: The ARM identifier for private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnection.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..f812f46b162fa --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnection.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; +import java.util.List; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupIds property: The group ids for the private endpoint resource. + * + * @return the groupIds value. + */ + List groupIds(); + + /** + * Gets the privateEndpoint property: The private endpoint resource. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: A collection of information about the state of the + * connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + PrivateEndpointConnectionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); + + /** The entirety of the PrivateEndpointConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The PrivateEndpointConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the PrivateEndpointConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the PrivateEndpointConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @return the next definition stage. + */ + WithCreate withExistingIotApp(String resourceGroupName, String resourceName); + } + /** + * The stage of the PrivateEndpointConnection definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate + extends DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + /** + * Executes the create request. + * + * @return the created resource. + */ + PrivateEndpointConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PrivateEndpointConnection create(Context context); + } + /** The stage of the PrivateEndpointConnection definition allowing to specify privateEndpoint. */ + interface WithPrivateEndpoint { + /** + * Specifies the privateEndpoint property: The private endpoint resource.. + * + * @param privateEndpoint The private endpoint resource. + * @return the next definition stage. + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + /** + * The stage of the PrivateEndpointConnection definition allowing to specify privateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies the privateLinkServiceConnectionState property: A collection of information about the state of + * the connection between service consumer and provider.. + * + * @param privateLinkServiceConnectionState A collection of information about the state of the connection + * between service consumer and provider. + * @return the next definition stage. + */ + WithCreate withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PrivateEndpointConnection refresh(Context context); +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionListResult.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionListResult.java new file mode 100644 index 0000000000000..d3177150908db --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionListResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** List of private endpoint connections associated with the specified resource. */ +@Fluent +public final class PrivateEndpointConnectionListResult { + /* + * Array of private endpoint connections. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private endpoint connections. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private endpoint connections. + * + * @param value the value value to set. + * @return the PrivateEndpointConnectionListResult object itself. + */ + public PrivateEndpointConnectionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionProvisioningState.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionProvisioningState.java new file mode 100644 index 0000000000000..ad6e6155696f0 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointConnectionProvisioningState. */ +public final class PrivateEndpointConnectionProvisioningState + extends ExpandableStringEnum { + /** Static value Succeeded for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Creating for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); + + /** Static value Failed for PrivateEndpointConnectionProvisioningState. */ + public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); + + /** + * Creates or finds a PrivateEndpointConnectionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointConnectionProvisioningState. + */ + @JsonCreator + public static PrivateEndpointConnectionProvisioningState fromString(String name) { + return fromString(name, PrivateEndpointConnectionProvisioningState.class); + } + + /** @return known PrivateEndpointConnectionProvisioningState values. */ + public static Collection values() { + return values(PrivateEndpointConnectionProvisioningState.class); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnections.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnections.java new file mode 100644 index 0000000000000..8dd1ae4b10779 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnections.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateEndpointConnections. */ +public interface PrivateEndpointConnections { + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application. + */ + PrivateEndpointConnection get(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application along with {@link + * Response}. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param privateEndpointConnectionName The private endpoint connection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 private endpoint connections of a IoT Central Application as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Get all private endpoint connections of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private endpoint connections of a IoT Central Application as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application along with {@link + * Response}. + */ + PrivateEndpointConnection getById(String id); + + /** + * Get the metadata of a private endpoint connection for the IoT Central Application. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the metadata of a private endpoint connection for the IoT Central Application along with {@link + * Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes a private endpoint connection from the IoT Central Application. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PrivateEndpointConnection resource. + * + * @param name resource name. + * @return the first stage of the new PrivateEndpointConnection definition. + */ + PrivateEndpointConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsCreateHeaders.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsCreateHeaders.java new file mode 100644 index 0000000000000..536fc8e6f317a --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsCreateHeaders.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsCreateHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsCreateHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the PrivateEndpointConnectionsCreateHeaders object itself. + */ + public PrivateEndpointConnectionsCreateHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PrivateEndpointConnectionsCreateHeaders object itself. + */ + public PrivateEndpointConnectionsCreateHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsCreateResponse.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsCreateResponse.java new file mode 100644 index 0000000000000..f7d8a560dabdd --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsCreateResponse.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.iotcentral.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateEndpointConnectionInner; + +/** Contains all response data for the create operation. */ +public final class PrivateEndpointConnectionsCreateResponse + extends ResponseBase { + /** + * Creates an instance of PrivateEndpointConnectionsCreateResponse. + * + * @param request the request which resulted in this PrivateEndpointConnectionsCreateResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PrivateEndpointConnectionsCreateResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + PrivateEndpointConnectionInner value, + PrivateEndpointConnectionsCreateHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** @return the deserialized response body. */ + @Override + public PrivateEndpointConnectionInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsDeleteHeaders.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsDeleteHeaders.java new file mode 100644 index 0000000000000..fabfcff14208e --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsDeleteHeaders.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The PrivateEndpointConnectionsDeleteHeaders model. */ +@Fluent +public final class PrivateEndpointConnectionsDeleteHeaders { + /* + * The Retry-After property. + */ + @JsonProperty(value = "Retry-After") + private String retryAfter; + + /* + * The Azure-AsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /* + * The Location property. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public String retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withRetryAfter(String retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @return the azureAsyncOperation value. + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation property: The Azure-AsyncOperation property. + * + * @param azureAsyncOperation the azureAsyncOperation value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the PrivateEndpointConnectionsDeleteHeaders object itself. + */ + public PrivateEndpointConnectionsDeleteHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsDeleteResponse.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsDeleteResponse.java new file mode 100644 index 0000000000000..b030267d694cf --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointConnectionsDeleteResponse.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; + +/** Contains all response data for the delete operation. */ +public final class PrivateEndpointConnectionsDeleteResponse + extends ResponseBase { + /** + * Creates an instance of PrivateEndpointConnectionsDeleteResponse. + * + * @param request the request which resulted in this PrivateEndpointConnectionsDeleteResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public PrivateEndpointConnectionsDeleteResponse( + HttpRequest request, + int statusCode, + HttpHeaders rawHeaders, + Void value, + PrivateEndpointConnectionsDeleteHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointServiceConnectionStatus.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointServiceConnectionStatus.java new file mode 100644 index 0000000000000..7f51345f3cbae --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateEndpointServiceConnectionStatus.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.iotcentral.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateEndpointServiceConnectionStatus. */ +public final class PrivateEndpointServiceConnectionStatus + extends ExpandableStringEnum { + /** Static value Pending for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateEndpointServiceConnectionStatus. */ + public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** + * Creates or finds a PrivateEndpointServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateEndpointServiceConnectionStatus. + */ + @JsonCreator + public static PrivateEndpointServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateEndpointServiceConnectionStatus.class); + } + + /** @return known PrivateEndpointServiceConnectionStatus values. */ + public static Collection values() { + return values(PrivateEndpointServiceConnectionStatus.class); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkResource.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..afaab1be5405d --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkResource.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** An immutable client-side representation of PrivateLinkResource. */ +public interface PrivateLinkResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the groupId property: The private link resource group id. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: The private link resource required member names. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: The private link resource private link DNS zone name. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.iotcentral.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkResourceListResult.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkResourceListResult.java new file mode 100644 index 0000000000000..fdb00d59a2e6e --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkResourceListResult.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.iotcentral.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list of private link resources. */ +@Fluent +public final class PrivateLinkResourceListResult { + /* + * Array of private link resources + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value property: Array of private link resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of private link resources. + * + * @param value the value value to set. + * @return the PrivateLinkResourceListResult object itself. + */ + public PrivateLinkResourceListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkServiceConnectionState.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..e4e45903e86f1 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A collection of information about the state of the connection between service consumer and provider. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateEndpointServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateEndpointServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateEndpointServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinks.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinks.java new file mode 100644 index 0000000000000..a4d30091a8079 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PrivateLinks.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of PrivateLinks. */ +public interface PrivateLinks { + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application. + */ + PrivateLinkResource get(String resourceGroupName, String resourceName, String groupId); + + /** + * Get a private link resource of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @param groupId The private link resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a private link resource of a IoT Central Application along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, String groupId, Context context); + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 private link resources of a IoT Central Application as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Get all private link resources of a IoT Central Application. + * + * @param resourceGroupName The name of the resource group that contains the IoT Central application. + * @param resourceName The ARM resource name of the IoT Central application. + * @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 all private link resources of a IoT Central Application as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/ProvisioningState.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/ProvisioningState.java new file mode 100644 index 0000000000000..802feb5e1e789 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/ProvisioningState.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.iotcentral.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PublicNetworkAccess.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..176548fcd2308 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/PublicNetworkAccess.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PublicNetworkAccess. */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccess. */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** @return known PublicNetworkAccess values. */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/SystemAssignedServiceIdentity.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/SystemAssignedServiceIdentity.java index 89341d07b0986..d8a4ff049d749 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/SystemAssignedServiceIdentity.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/main/java/com/azure/resourcemanager/iotcentral/models/SystemAssignedServiceIdentity.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.UUID; /** Managed service identity (either system assigned, or none). */ @Fluent public class SystemAssignedServiceIdentity { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemAssignedServiceIdentity.class); - /* * The service principal ID of the system assigned identity. This property * will only be provided for a system assigned identity. @@ -82,10 +79,12 @@ public SystemAssignedServiceIdentity withType(SystemAssignedServiceIdentityType */ public void validate() { if (type() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property type in model SystemAssignedServiceIdentity")); } } + + private static final ClientLogger LOGGER = new ClientLogger(SystemAssignedServiceIdentity.class); } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCheckNameAvailabilitySamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCheckNameAvailabilitySamples.java index dd6585427867c..f3fcd813e09c5 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCheckNameAvailabilitySamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCheckNameAvailabilitySamples.java @@ -10,7 +10,7 @@ /** Samples for Apps CheckNameAvailability. */ public final class AppsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CheckNameAvailability.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CheckNameAvailability.json */ /** * Sample code: Apps_CheckNameAvailability. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCheckSubdomainAvailabilitySamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCheckSubdomainAvailabilitySamples.java index e508d74a53bf7..a36b554aa1720 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCheckSubdomainAvailabilitySamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCheckSubdomainAvailabilitySamples.java @@ -10,7 +10,7 @@ /** Samples for Apps CheckSubdomainAvailability. */ public final class AppsCheckSubdomainAvailabilitySamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CheckSubdomainAvailability.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CheckSubdomainAvailability.json */ /** * Sample code: Apps_SubdomainAvailability. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCreateOrUpdateSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCreateOrUpdateSamples.java index 52a25f77ed12b..ccdb30a8a0992 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCreateOrUpdateSamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ /** Samples for Apps CreateOrUpdate. */ public final class AppsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CreateOrUpdate.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CreateOrUpdate.json */ /** * Sample code: Apps_CreateOrUpdate. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsDeleteSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsDeleteSamples.java index 98bf4780276b2..ff97697a96431 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsDeleteSamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsDeleteSamples.java @@ -9,7 +9,7 @@ /** Samples for Apps Delete. */ public final class AppsDeleteSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Delete.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Delete.json */ /** * Sample code: Apps_Delete. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsGetByResourceGroupSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsGetByResourceGroupSamples.java index f446d0e4db690..c063091843adf 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsGetByResourceGroupSamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Apps GetByResourceGroup. */ public final class AppsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Get.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Get.json */ /** * Sample code: Apps_Get. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListByResourceGroupSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListByResourceGroupSamples.java index 858188f06aa1c..ccc848cb265f6 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListByResourceGroupSamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for Apps ListByResourceGroup. */ public final class AppsListByResourceGroupSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListByResourceGroup.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_ListByResourceGroup.json */ /** * Sample code: Apps_ListByResourceGroup. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListSamples.java index f406fe95a57d4..b280a932e7a60 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListSamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Apps List. */ public final class AppsListSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListBySubscription.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_ListBySubscription.json */ /** * Sample code: Apps_ListBySubscription. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListTemplatesSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListTemplatesSamples.java index e85776f9f0ab3..d24b05a61ef7b 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListTemplatesSamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsListTemplatesSamples.java @@ -9,7 +9,7 @@ /** Samples for Apps ListTemplates. */ public final class AppsListTemplatesSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Templates.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Templates.json */ /** * Sample code: Apps_ListTemplates. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsUpdateSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsUpdateSamples.java index 83069eab00bff..1b30034277377 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsUpdateSamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/AppsUpdateSamples.java @@ -5,14 +5,14 @@ package com.azure.resourcemanager.iotcentral.generated; import com.azure.core.util.Context; -import com.azure.resourcemanager.iotcentral.models.App; +import com.azure.resourcemanager.iotcentral.models.AppPatch; import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentity; import com.azure.resourcemanager.iotcentral.models.SystemAssignedServiceIdentityType; /** Samples for Apps Update. */ public final class AppsUpdateSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Update.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Update.json */ /** * Sample code: Apps_Update. @@ -20,13 +20,15 @@ public final class AppsUpdateSamples { * @param manager Entry point to IotCentralManager. */ public static void appsUpdate(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { - App resource = - manager.apps().getByResourceGroupWithResponse("resRg", "myIoTCentralApp", Context.NONE).getValue(); - resource - .update() - .withIdentity( - new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) - .withDisplayName("My IoT Central App 2") - .apply(); + manager + .apps() + .update( + "resRg", + "myIoTCentralApp", + new AppPatch() + .withIdentity( + new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) + .withDisplayName("My IoT Central App 2"), + Context.NONE); } } diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/OperationsListSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/OperationsListSamples.java index 04585900c8937..c30a22174b53a 100644 --- a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/OperationsListSamples.java +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Operations_List.json + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsCreateSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsCreateSamples.java new file mode 100644 index 0000000000000..23b4d0e460545 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsCreateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.generated; + +import com.azure.resourcemanager.iotcentral.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.iotcentral.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Create. */ +public final class PrivateEndpointConnectionsCreateSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Update.json + */ + /** + * Sample code: PrivateEndpointConnections_Update. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateEndpointConnectionsUpdate( + com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager + .privateEndpointConnections() + .define("myIoTCentralAppEndpoint") + .withExistingIotApp("resRg", "myIoTCentralApp") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-approved") + .withActionsRequired("None")) + .create(); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 0000000000000..f80225fcb8e00 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsDeleteSamples.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.iotcentral.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: PrivateEndpointConnections_Delete. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateEndpointConnectionsDelete( + com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager + .privateEndpointConnections() + .delete("resRg", "myIoTCentralApp", "myIoTCentralAppEndpoint", Context.NONE); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 0000000000000..913bf52692b6e --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iotcentral.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: PrivateEndpointConnections_Get. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateEndpointConnectionsGet(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("resRg", "myIoTCentralApp", "myIoTCentralAppEndpoint", Context.NONE); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsListSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 0000000000000..9780f0b77e38f --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateEndpointConnectionsListSamples.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.iotcentral.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_List.json + */ + /** + * Sample code: PrivateEndpointConnections_List. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateEndpointConnectionsList(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager.privateEndpointConnections().list("resRg", "myIoTCentralApp", Context.NONE); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateLinksGetSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateLinksGetSamples.java new file mode 100644 index 0000000000000..3599f5736c814 --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateLinksGetSamples.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.iotcentral.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinks Get. */ +public final class PrivateLinksGetSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateLinks_Get.json + */ + /** + * Sample code: PrivateLinks_Get. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateLinksGet(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager.privateLinks().getWithResponse("resRg", "myIoTCentralApp", "iotApp", Context.NONE); + } +} diff --git a/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateLinksListSamples.java b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateLinksListSamples.java new file mode 100644 index 0000000000000..7d2733bc3c38c --- /dev/null +++ b/sdk/iotcentral/azure-resourcemanager-iotcentral/src/samples/java/com/azure/resourcemanager/iotcentral/generated/PrivateLinksListSamples.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.iotcentral.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinks List. */ +public final class PrivateLinksListSamples { + /* + * x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateLinks_List.json + */ + /** + * Sample code: PrivateLinks_List. + * + * @param manager Entry point to IotCentralManager. + */ + public static void privateLinksList(com.azure.resourcemanager.iotcentral.IotCentralManager manager) { + manager.privateLinks().list("resRg", "myIoTCentralApp", Context.NONE); + } +}