From 321ac787d2d8931b3d3937c7cd3f6317354dad25 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 15 Feb 2022 04:36:56 +0000 Subject: [PATCH] [Automation] Generate Fluent Lite from digitaltwins#package-2021-06-30-preview --- .../CHANGELOG.md | 74 +- .../README.md | 7 +- .../SAMPLE.md | 785 +++++++++++ .../pom.xml | 146 +- .../AzureDigitalTwinsManager.java | 51 +- .../AzureDigitalTwinsManagementClient.java | 7 + .../fluent/DigitalTwinsClient.java | 36 +- .../fluent/DigitalTwinsEndpointsClient.java | 22 +- .../digitaltwins/fluent/OperationsClient.java | 4 +- .../PrivateEndpointConnectionsClient.java | 20 +- .../fluent/PrivateLinkResourcesClient.java | 4 +- .../TimeSeriesDatabaseConnectionsClient.java | 220 +++ .../models/DigitalTwinsDescriptionInner.java | 111 +- .../fluent/models/DigitalTwinsProperties.java | 144 ++ .../models/GroupIdInformationInner.java | 6 +- .../fluent/models/OperationInner.java | 18 + .../PrivateEndpointConnectionInner.java | 24 +- .../TimeSeriesDatabaseConnectionInner.java | 57 + ...AzureDigitalTwinsManagementClientImpl.java | 16 +- .../implementation/CheckNameResultImpl.java | 9 +- .../DigitalTwinsClientImpl.java | 160 ++- .../DigitalTwinsDescriptionImpl.java | 17 +- .../DigitalTwinsEndpointResourceImpl.java | 16 +- .../DigitalTwinsEndpointsClientImpl.java | 92 +- .../DigitalTwinsEndpointsImpl.java | 9 +- .../implementation/DigitalTwinsImpl.java | 9 +- .../GroupIdInformationImpl.java | 9 +- .../GroupIdInformationResponseImpl.java | 8 +- .../implementation/OperationImpl.java | 19 +- .../implementation/OperationsClientImpl.java | 24 +- .../implementation/OperationsImpl.java | 8 +- .../PrivateEndpointConnectionImpl.java | 17 +- .../PrivateEndpointConnectionsClientImpl.java | 84 +- .../PrivateEndpointConnectionsImpl.java | 8 +- ...rivateEndpointConnectionsResponseImpl.java | 8 +- .../PrivateLinkResourcesClientImpl.java | 24 +- .../PrivateLinkResourcesImpl.java | 9 +- .../TimeSeriesDatabaseConnectionImpl.java | 148 ++ ...meSeriesDatabaseConnectionsClientImpl.java | 1241 +++++++++++++++++ .../TimeSeriesDatabaseConnectionsImpl.java | 240 ++++ .../digitaltwins/implementation/Utils.java | 57 +- ...AzureDataExplorerConnectionProperties.java | 285 ++++ .../digitaltwins/models/CheckNameRequest.java | 2 +- .../models/ConnectionProperties.java | 20 +- .../ConnectionPropertiesPrivateEndpoint.java | 25 - ...tiesPrivateLinkServiceConnectionState.java | 6 +- .../digitaltwins/models/ConnectionType.java | 31 + .../digitaltwins/models/DigitalTwins.java | 16 +- .../models/DigitalTwinsDescription.java | 14 +- .../models/DigitalTwinsEndpointResource.java | 8 + ...igitalTwinsEndpointResourceProperties.java | 9 +- .../models/DigitalTwinsEndpoints.java | 10 +- .../models/DigitalTwinsPatchDescription.java | 2 + .../models/DigitalTwinsResource.java | 17 + .../digitaltwins/models/EventGrid.java | 2 +- .../digitaltwins/models/EventHub.java | 6 +- .../digitaltwins/models/ExternalResource.java | 17 + .../models/GroupIdInformation.java | 2 +- .../models/GroupIdInformationProperties.java | 4 +- .../digitaltwins/models/Operation.java | 8 + .../digitaltwins/models/OperationDisplay.java | 10 +- .../digitaltwins/models/Operations.java | 4 +- .../digitaltwins/models/PrivateEndpoint.java | 2 +- .../models/PrivateEndpointConnection.java | 19 +- .../PrivateEndpointConnectionProperties.java | 48 - .../models/PrivateEndpointConnections.java | 8 +- .../models/PrivateLinkResources.java | 4 +- .../digitaltwins/models/ServiceBus.java | 8 +- .../models/TimeSeriesDatabaseConnection.java | 157 +++ ...imeSeriesDatabaseConnectionListResult.java | 81 ++ ...imeSeriesDatabaseConnectionProperties.java | 49 + .../TimeSeriesDatabaseConnectionState.java | 61 + .../models/TimeSeriesDatabaseConnections.java | 151 ++ ...italTwinsCheckNameAvailabilitySamples.java | 26 + .../DigitalTwinsCreateOrUpdateSamples.java | 68 + .../generated/DigitalTwinsDeleteSamples.java | 36 + ...talTwinsEndpointCreateOrUpdateSamples.java | 57 + .../DigitalTwinsEndpointDeleteSamples.java | 36 + .../DigitalTwinsEndpointGetSamples.java | 36 + .../DigitalTwinsEndpointListSamples.java | 36 + ...DigitalTwinsGetByResourceGroupSamples.java | 49 + ...igitalTwinsListByResourceGroupSamples.java | 23 + .../generated/DigitalTwinsListSamples.java | 23 + .../generated/DigitalTwinsUpdateSamples.java | 85 ++ .../generated/OperationsListSamples.java | 22 + ...pointConnectionsCreateOrUpdateSamples.java | 40 + ...ivateEndpointConnectionsDeleteSamples.java | 25 + .../PrivateEndpointConnectionsGetSamples.java | 25 + ...PrivateEndpointConnectionsListSamples.java | 23 + .../PrivateLinkResourcesGetSamples.java | 23 + .../PrivateLinkResourcesListSamples.java | 23 + ...abaseConnectionsCreateOrUpdateSamples.java | 38 + ...eriesDatabaseConnectionsDeleteSamples.java | 23 + ...meSeriesDatabaseConnectionsGetSamples.java | 25 + ...eSeriesDatabaseConnectionsListSamples.java | 23 + 95 files changed, 5237 insertions(+), 582 deletions(-) create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/SAMPLE.md create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/TimeSeriesDatabaseConnectionsClient.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/DigitalTwinsProperties.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/TimeSeriesDatabaseConnectionInner.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionImpl.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionsClientImpl.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionsImpl.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/AzureDataExplorerConnectionProperties.java delete mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionPropertiesPrivateEndpoint.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionType.java delete mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnection.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionListResult.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionProperties.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionState.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnections.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsCheckNameAvailabilitySamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsCreateOrUpdateSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsDeleteSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointCreateOrUpdateSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointDeleteSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointGetSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointListSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsGetByResourceGroupSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsListByResourceGroupSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsListSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsUpdateSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/OperationsListSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsListSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateLinkResourcesGetSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateLinkResourcesListSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsCreateOrUpdateSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsDeleteSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsGetSamples.java create mode 100644 sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsListSamples.java diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/CHANGELOG.md b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/CHANGELOG.md index af87dd1c3163..f31b80b8206c 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/CHANGELOG.md +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/CHANGELOG.md @@ -1,7 +1,79 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2022-02-15) +- Azure Resource Manager AzureDigitalTwins client library for Java. This package contains Microsoft Azure SDK for AzureDigitalTwins Management SDK. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2021-06-30-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +* `models.PrivateEndpointConnectionProperties` was removed + +* `models.ConnectionPropertiesPrivateEndpoint` was removed + +#### `models.ConnectionProperties` was modified + +* `withPrivateLinkServiceConnectionState(models.ConnectionState)` was removed +* `models.ConnectionState privateLinkServiceConnectionState()` -> `models.ConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState()` + +### Features Added + +* `models.TimeSeriesDatabaseConnections` was added + +* `models.TimeSeriesDatabaseConnection$DefinitionStages` was added + +* `models.TimeSeriesDatabaseConnectionListResult` was added + +* `models.TimeSeriesDatabaseConnection` was added + +* `models.ConnectionType` was added + +* `models.TimeSeriesDatabaseConnectionProperties` was added + +* `models.TimeSeriesDatabaseConnection$Definition` was added + +* `models.AzureDataExplorerConnectionProperties` was added + +* `models.TimeSeriesDatabaseConnection$Update` was added + +* `models.TimeSeriesDatabaseConnectionState` was added + +* `models.TimeSeriesDatabaseConnection$UpdateStages` was added + +#### `models.DigitalTwinsDescription` was modified + +* `systemData()` was added + +#### `models.ConnectionProperties` was modified + +* `withPrivateLinkServiceConnectionState(models.ConnectionPropertiesPrivateLinkServiceConnectionState)` was added + +#### `models.ExternalResource` was modified + +* `systemData()` was added + +#### `models.DigitalTwinsResource` was modified + +* `systemData()` was added + +#### `AzureDigitalTwinsManager` was modified + +* `timeSeriesDatabaseConnections()` was added + +#### `models.DigitalTwinsEndpointResource` was modified + +* `systemData()` was added + +#### `models.PrivateEndpointConnection` was modified + +* `systemData()` was added + +#### `AzureDigitalTwinsManager$Configurable` was modified + +* `withScope(java.lang.String)` was added + +#### `models.Operation` was modified + +* `properties()` was added ## 1.0.0-beta.1 (2021-03-02) diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md index 08f075b05d67..146d6e087701 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureDigitalTwins client library for Java. -This package contains Microsoft Azure SDK for AzureDigitalTwins Management SDK. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2020-12. 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 AzureDigitalTwins Management SDK. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2021-06-30-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-digitaltwins - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/digitaltwins/azure-resourcemanager-digitaltwins/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/SAMPLE.md b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/SAMPLE.md new file mode 100644 index 000000000000..c57ffe1b3c1e --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/SAMPLE.md @@ -0,0 +1,785 @@ +# Code snippets and samples + + +## DigitalTwins + +- [CheckNameAvailability](#digitaltwins_checknameavailability) +- [CreateOrUpdate](#digitaltwins_createorupdate) +- [Delete](#digitaltwins_delete) +- [GetByResourceGroup](#digitaltwins_getbyresourcegroup) +- [List](#digitaltwins_list) +- [ListByResourceGroup](#digitaltwins_listbyresourcegroup) +- [Update](#digitaltwins_update) + +## DigitalTwinsEndpoint + +- [CreateOrUpdate](#digitaltwinsendpoint_createorupdate) +- [Delete](#digitaltwinsendpoint_delete) +- [Get](#digitaltwinsendpoint_get) +- [List](#digitaltwinsendpoint_list) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [CreateOrUpdate](#privateendpointconnections_createorupdate) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) + +## PrivateLinkResources + +- [Get](#privatelinkresources_get) +- [List](#privatelinkresources_list) + +## TimeSeriesDatabaseConnections + +- [CreateOrUpdate](#timeseriesdatabaseconnections_createorupdate) +- [Delete](#timeseriesdatabaseconnections_delete) +- [Get](#timeseriesdatabaseconnections_get) +- [List](#timeseriesdatabaseconnections_list) +### DigitalTwins_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.digitaltwins.models.CheckNameRequest; + +/** Samples for DigitalTwins CheckNameAvailability. */ +public final class DigitalTwinsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsCheckNameAvailability_example.json + */ + /** + * Sample code: Check name Availability. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void checkNameAvailability(com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwins() + .checkNameAvailabilityWithResponse( + "WestUS2", new CheckNameRequest().withName("myadtinstance"), Context.NONE); + } +} +``` + +### DigitalTwins_CreateOrUpdate + +```java +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentity; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentityType; +import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess; + +/** Samples for DigitalTwins CreateOrUpdate. */ +public final class DigitalTwinsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPut_example.json + */ + /** + * Sample code: Put a DigitalTwinsInstance resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsInstanceResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwins() + .define("myDigitalTwinsService") + .withRegion("WestUS2") + .withExistingResourceGroup("resRg") + .create(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPut_WithPublicNetworkAccess.json + */ + /** + * Sample code: Put a DigitalTwinsInstance resource with publicNetworkAccess property. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwins() + .define("myDigitalTwinsService") + .withRegion("WestUS2") + .withExistingResourceGroup("resRg") + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .create(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPut_WithIdentity_example.json + */ + /** + * Sample code: Put a DigitalTwinsInstance resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsInstanceResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwins() + .define("myDigitalTwinsService") + .withRegion("WestUS2") + .withExistingResourceGroup("resRg") + .withIdentity(new DigitalTwinsIdentity().withType(DigitalTwinsIdentityType.SYSTEM_ASSIGNED)) + .create(); + } +} +``` + +### DigitalTwins_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DigitalTwins Delete. */ +public final class DigitalTwinsDeleteSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsDelete_example.json + */ + /** + * Sample code: Delete a DigitalTwinsInstance resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteADigitalTwinsInstanceResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().delete("resRg", "myDigitalTwinsService", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsDelete_WithIdentity_example.json + */ + /** + * Sample code: Delete a DigitalTwinsInstance resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteADigitalTwinsInstanceResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().delete("resRg", "myDigitalTwinsService", Context.NONE); + } +} +``` + +### DigitalTwins_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DigitalTwins GetByResourceGroup. */ +public final class DigitalTwinsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsGet_WithIdentity_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsGet_WithPrivateEndpointConnection_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance resource with a private endpoint connection. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceResourceWithAPrivateEndpointConnection( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsGet_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } +} +``` + +### DigitalTwins_List + +```java +import com.azure.core.util.Context; + +/** Samples for DigitalTwins List. */ +public final class DigitalTwinsListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsList_example.json + */ + /** + * Sample code: Get DigitalTwinsInstance resources by subscription. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getDigitalTwinsInstanceResourcesBySubscription( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().list(Context.NONE); + } +} +``` + +### DigitalTwins_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for DigitalTwins ListByResourceGroup. */ +public final class DigitalTwinsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsListByResourceGroup_example.json + */ + /** + * Sample code: Get DigitalTwinsInstance resources by resource group. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getDigitalTwinsInstanceResourcesByResourceGroup( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().listByResourceGroup("resRg", Context.NONE); + } +} +``` + +### DigitalTwins_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsDescription; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentity; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentityType; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsPatchProperties; +import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DigitalTwins Update. */ +public final class DigitalTwinsUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPatch_example.json + */ + /** + * Sample code: Patch a DigitalTwinsInstance resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void patchADigitalTwinsInstanceResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + DigitalTwinsDescription resource = + manager + .digitalTwins() + .getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("purpose", "dev")).apply(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPatch_WithPublicNetworkAccess.json + */ + /** + * Sample code: Patch a DigitalTwinsInstance resource with publicNetworkAccess property. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void patchADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + DigitalTwinsDescription resource = + manager + .digitalTwins() + .getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE) + .getValue(); + resource + .update() + .withProperties(new DigitalTwinsPatchProperties().withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) + .apply(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPatch_WithIdentity_example.json + */ + /** + * Sample code: Patch a DigitalTwinsInstance resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void patchADigitalTwinsInstanceResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + DigitalTwinsDescription resource = + manager + .digitalTwins() + .getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE) + .getValue(); + resource.update().withIdentity(new DigitalTwinsIdentity().withType(DigitalTwinsIdentityType.NONE)).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### DigitalTwinsEndpoint_CreateOrUpdate + +```java +import com.azure.resourcemanager.digitaltwins.models.AuthenticationType; +import com.azure.resourcemanager.digitaltwins.models.ServiceBus; + +/** Samples for DigitalTwinsEndpoint CreateOrUpdate. */ +public final class DigitalTwinsEndpointCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointPut_example.json + */ + /** + * Sample code: Put a DigitalTwinsEndpoint resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsEndpointResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwinsEndpoints() + .define("myServiceBus") + .withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService") + .withProperties( + new ServiceBus() + .withAuthenticationType(AuthenticationType.KEY_BASED) + .withPrimaryConnectionString( + "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc") + .withSecondaryConnectionString( + "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc")) + .create(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointPut_WithIdentity_example.json + */ + /** + * Sample code: Put a DigitalTwinsEndpoint resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsEndpointResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwinsEndpoints() + .define("myServiceBus") + .withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService") + .withProperties( + new ServiceBus() + .withAuthenticationType(AuthenticationType.IDENTITY_BASED) + .withEndpointUri("sb://mysb.servicebus.windows.net/") + .withEntityPath("mysbtopic")) + .create(); + } +} +``` + +### DigitalTwinsEndpoint_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DigitalTwinsEndpoint Delete. */ +public final class DigitalTwinsEndpointDeleteSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointDelete_example.json + */ + /** + * Sample code: Delete a DigitalTwinsInstance endpoint. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteADigitalTwinsInstanceEndpoint( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().delete("resRg", "myDigitalTwinsService", "myendpoint", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointDelete_WithIdentity_example.json + */ + /** + * Sample code: Delete a DigitalTwinsInstance endpoint with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteADigitalTwinsInstanceEndpointWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().delete("resRg", "myDigitalTwinsService", "myendpoint", Context.NONE); + } +} +``` + +### DigitalTwinsEndpoint_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DigitalTwinsEndpoint Get. */ +public final class DigitalTwinsEndpointGetSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointGet_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance endpoint. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceEndpoint( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().getWithResponse("resRg", "myDigitalTwinsService", "myServiceBus", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointGet_WithIdentity_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance endpoint with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceEndpointWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().getWithResponse("resRg", "myDigitalTwinsService", "myServiceBus", Context.NONE); + } +} +``` + +### DigitalTwinsEndpoint_List + +```java +import com.azure.core.util.Context; + +/** Samples for DigitalTwinsEndpoint List. */ +public final class DigitalTwinsEndpointListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointsGet_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance endpoints. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceEndpoints( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().list("resRg", "myDigitalTwinsService", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointsGet_WithIdentity_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance endpoints with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceEndpointsWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().list("resRg", "myDigitalTwinsService", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsOperationsList_example.json + */ + /** + * Sample code: Get available operations. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getAvailableOperations(com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_CreateOrUpdate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.digitaltwins.models.ConnectionProperties; +import com.azure.resourcemanager.digitaltwins.models.ConnectionPropertiesPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.digitaltwins.models.PrivateEndpointConnection; +import com.azure.resourcemanager.digitaltwins.models.PrivateLinkServiceConnectionStatus; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateEndpointConnectionPut_example.json + */ + /** + * Sample code: Update the status of a private endpoint connection with the given name. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void updateTheStatusOfAPrivateEndpointConnectionWithTheGivenName( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + PrivateEndpointConnection resource = + manager + .privateEndpointConnections() + .getWithResponse("resRg", "myDigitalTwinsService", "myPrivateConnection", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new ConnectionProperties() + .withPrivateLinkServiceConnectionState( + new ConnectionPropertiesPrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@company.com."))) + .apply(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateEndpointConnectionDelete_example.json + */ + /** + * Sample code: Delete private endpoint connection with the specified name. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deletePrivateEndpointConnectionWithTheSpecifiedName( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .privateEndpointConnections() + .delete("resRg", "myDigitalTwinsService", "myPrivateConnection", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateEndpointConnectionByConnectionName_example.json + */ + /** + * Sample code: Get private endpoint connection properties for the given private endpoint. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getPrivateEndpointConnectionPropertiesForTheGivenPrivateEndpoint( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("resRg", "myDigitalTwinsService", "myPrivateConnection", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateEndpointConnectionsList_example.json + */ + /** + * Sample code: List private endpoint connection properties. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void listPrivateEndpointConnectionProperties( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.privateEndpointConnections().listWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } +} +``` + +### PrivateLinkResources_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateLinkResourcesByGroupId_example.json + */ + /** + * Sample code: Get the specified private link resource for the given Digital Twin. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getTheSpecifiedPrivateLinkResourceForTheGivenDigitalTwin( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.privateLinkResources().getWithResponse("resRg", "myDigitalTwinsService", "subResource", Context.NONE); + } +} +``` + +### PrivateLinkResources_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources List. */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateLinkResourcesList_example.json + */ + /** + * Sample code: List private link resources for given Digital Twin. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void listPrivateLinkResourcesForGivenDigitalTwin( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.privateLinkResources().listWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } +} +``` + +### TimeSeriesDatabaseConnections_CreateOrUpdate + +```java +import com.azure.resourcemanager.digitaltwins.models.AzureDataExplorerConnectionProperties; + +/** Samples for TimeSeriesDatabaseConnections CreateOrUpdate. */ +public final class TimeSeriesDatabaseConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/TimeSeriesDatabaseConnectionsPut_example.json + */ + /** + * Sample code: Create or replace a time series database connection for a DigitalTwins instance. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void createOrReplaceATimeSeriesDatabaseConnectionForADigitalTwinsInstance( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .timeSeriesDatabaseConnections() + .define("myConnection") + .withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService") + .withProperties( + new AzureDataExplorerConnectionProperties() + .withAdxResourceId( + "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster") + .withAdxEndpointUri("https://mycluster.kusto.windows.net") + .withAdxDatabaseName("myDatabase") + .withAdxTableName("myTable") + .withEventHubEndpointUri("sb://myeh.servicebus.windows.net/") + .withEventHubEntityPath("myeh") + .withEventHubNamespaceResourceId( + "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh")) + .create(); + } +} +``` + +### TimeSeriesDatabaseConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for TimeSeriesDatabaseConnections Delete. */ +public final class TimeSeriesDatabaseConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/TimeSeriesDatabaseConnectionsDelete_example.json + */ + /** + * Sample code: Delete a time series database connection for a DigitalTwins instance. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteATimeSeriesDatabaseConnectionForADigitalTwinsInstance( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.timeSeriesDatabaseConnections().delete("resRg", "myDigitalTwinsService", "myConnection", Context.NONE); + } +} +``` + +### TimeSeriesDatabaseConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for TimeSeriesDatabaseConnections Get. */ +public final class TimeSeriesDatabaseConnectionsGetSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/TimeSeriesDatabaseConnectionsGet_example.json + */ + /** + * Sample code: Get time series database connection for a DigitalTwins instance. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getTimeSeriesDatabaseConnectionForADigitalTwinsInstance( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .timeSeriesDatabaseConnections() + .getWithResponse("resRg", "myDigitalTwinsService", "myConnection", Context.NONE); + } +} +``` + +### TimeSeriesDatabaseConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for TimeSeriesDatabaseConnections List. */ +public final class TimeSeriesDatabaseConnectionsListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/TimeSeriesDatabaseConnectionsList_example.json + */ + /** + * Sample code: List time series database connections for a DigitalTwins instance. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void listTimeSeriesDatabaseConnectionsForADigitalTwinsInstance( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.timeSeriesDatabaseConnections().list("resRg", "myDigitalTwinsService", Context.NONE); + } +} +``` + diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/pom.xml b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/pom.xml index 18ed27202860..13dbf5817f37 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/pom.xml +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/pom.xml @@ -1,79 +1,79 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-digitaltwins - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-digitaltwins + 1.0.0-beta.2 + jar - Microsoft Azure SDK for AzureDigitalTwins Management - This package contains Microsoft Azure SDK for AzureDigitalTwins Management SDK. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2020-12. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for AzureDigitalTwins Management + This package contains Microsoft Azure SDK for AzureDigitalTwins Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Digital Twins Client for managing DigitalTwinsInstance. Package tag package-2021-06-30-preview. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.25.0 - - - com.azure - azure-core-management - 1.5.2 - - - com.azure - azure-identity - 1.4.4 - test - - - com.azure.resourcemanager - azure-resourcemanager-resources - 2.11.0 - test - - - com.azure - azure-core-test - 1.7.8 - test - - - org.slf4j - slf4j-simple - 1.7.32 - test - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-management + 1.5.2 + + + com.azure + azure-identity + 1.4.4 + test + + + com.azure.resourcemanager + azure-resourcemanager-resources + 2.11.0 + test + + + com.azure + azure-core-test + 1.7.8 + test + + + org.slf4j + slf4j-simple + 1.7.32 + test + + diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/AzureDigitalTwinsManager.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/AzureDigitalTwinsManager.java index 97d246104348..9f339f17f37b 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/AzureDigitalTwinsManager.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/AzureDigitalTwinsManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -27,16 +28,19 @@ import com.azure.resourcemanager.digitaltwins.implementation.OperationsImpl; import com.azure.resourcemanager.digitaltwins.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.digitaltwins.implementation.PrivateLinkResourcesImpl; +import com.azure.resourcemanager.digitaltwins.implementation.TimeSeriesDatabaseConnectionsImpl; import com.azure.resourcemanager.digitaltwins.models.DigitalTwins; import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsEndpoints; import com.azure.resourcemanager.digitaltwins.models.Operations; import com.azure.resourcemanager.digitaltwins.models.PrivateEndpointConnections; import com.azure.resourcemanager.digitaltwins.models.PrivateLinkResources; +import com.azure.resourcemanager.digitaltwins.models.TimeSeriesDatabaseConnections; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to AzureDigitalTwinsManager. Azure Digital Twins Client for managing DigitalTwinsInstance. */ public final class AzureDigitalTwinsManager { @@ -50,6 +54,8 @@ public final class AzureDigitalTwinsManager { private PrivateEndpointConnections privateEndpointConnections; + private TimeSeriesDatabaseConnections timeSeriesDatabaseConnections; + private final AzureDigitalTwinsManagementClient clientObject; private AzureDigitalTwinsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -93,6 +99,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -132,6 +139,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -174,7 +192,7 @@ public AzureDigitalTwinsManager authenticate(TokenCredential credential, AzurePr .append("-") .append("com.azure.resourcemanager.digitaltwins") .append("/") - .append("1.0.0-beta.1"); + .append("1.0.0-beta.2"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -188,19 +206,33 @@ public AzureDigitalTwinsManager authenticate(TokenCredential credential, AzurePr userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = @@ -253,6 +285,15 @@ public PrivateEndpointConnections privateEndpointConnections() { return privateEndpointConnections; } + /** @return Resource collection API of TimeSeriesDatabaseConnections. */ + public TimeSeriesDatabaseConnections timeSeriesDatabaseConnections() { + if (this.timeSeriesDatabaseConnections == null) { + this.timeSeriesDatabaseConnections = + new TimeSeriesDatabaseConnectionsImpl(clientObject.getTimeSeriesDatabaseConnections(), this); + } + return timeSeriesDatabaseConnections; + } + /** * @return Wrapped service client AzureDigitalTwinsManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/AzureDigitalTwinsManagementClient.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/AzureDigitalTwinsManagementClient.java index ca03c122ca38..a4c8eb830070 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/AzureDigitalTwinsManagementClient.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/AzureDigitalTwinsManagementClient.java @@ -78,4 +78,11 @@ public interface AzureDigitalTwinsManagementClient { * @return the PrivateEndpointConnectionsClient object. */ PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the TimeSeriesDatabaseConnectionsClient object to access its operations. + * + * @return the TimeSeriesDatabaseConnectionsClient object. + */ + TimeSeriesDatabaseConnectionsClient getTimeSeriesDatabaseConnections(); } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/DigitalTwinsClient.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/DigitalTwinsClient.java index a140b4d27b1a..db875c7309c6 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/DigitalTwinsClient.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/DigitalTwinsClient.java @@ -40,7 +40,7 @@ public interface DigitalTwinsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances resource. + * @return digitalTwinsInstances resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -57,9 +57,9 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate); @@ -75,9 +75,9 @@ SyncPoller, DigitalTwinsDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -131,9 +131,9 @@ DigitalTwinsDescriptionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription); @@ -147,9 +147,9 @@ SyncPoller, DigitalTwinsDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -198,9 +198,9 @@ DigitalTwinsDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsDescriptionInner> beginDelete( String resourceGroupName, String resourceName); @@ -213,9 +213,9 @@ SyncPoller, DigitalTwinsDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsDescriptionInner> beginDelete( String resourceGroupName, String resourceName, Context context); @@ -251,7 +251,7 @@ SyncPoller, DigitalTwinsDescriptionInne * * @throws com.azure.core.management.exception.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 DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -263,7 +263,7 @@ SyncPoller, DigitalTwinsDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -275,7 +275,7 @@ SyncPoller, DigitalTwinsDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -288,7 +288,7 @@ SyncPoller, DigitalTwinsDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -317,7 +317,7 @@ SyncPoller, DigitalTwinsDescriptionInne * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. + * @return the result returned from a check name availability request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkNameAvailabilityWithResponse( diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/DigitalTwinsEndpointsClient.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/DigitalTwinsEndpointsClient.java index 82562c153353..018e20322772 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/DigitalTwinsEndpointsClient.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/DigitalTwinsEndpointsClient.java @@ -23,7 +23,7 @@ public interface DigitalTwinsEndpointsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String resourceName); @@ -37,7 +37,7 @@ public interface DigitalTwinsEndpointsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -67,7 +67,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances Endpoint. + * @return digitalTwinsInstances Endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -83,9 +83,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return the {@link SyncPoller} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsEndpointResourceInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -103,9 +103,9 @@ SyncPoller, DigitalTwinsEndpointRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return the {@link SyncPoller} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsEndpointResourceInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -162,9 +162,9 @@ DigitalTwinsEndpointResourceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return the {@link SyncPoller} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsEndpointResourceInner> beginDelete( String resourceGroupName, String resourceName, String endpointName); @@ -178,9 +178,9 @@ SyncPoller, DigitalTwinsEndpointRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return the {@link SyncPoller} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, DigitalTwinsEndpointResourceInner> beginDelete( String resourceGroupName, String resourceName, String endpointName, Context context); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/OperationsClient.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/OperationsClient.java index b2becef60114..c1010e38e6e4 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/OperationsClient.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/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 DigitalTwins service operations. + * @return a list of DigitalTwins service 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 DigitalTwins service operations. + * @return a list of DigitalTwins service operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/PrivateEndpointConnectionsClient.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/PrivateEndpointConnectionsClient.java index a64b17e56a4a..6634025fdf4b 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/PrivateEndpointConnectionsClient.java @@ -37,7 +37,7 @@ public interface PrivateEndpointConnectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link connections for a Digital Twin. + * @return the available private link connections for a Digital Twin along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse( @@ -68,7 +68,7 @@ PrivateEndpointConnectionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties for the given private endpoint. + * @return private endpoint connection properties for the given private endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -83,9 +83,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName); @@ -99,9 +99,9 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); @@ -142,9 +142,9 @@ SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of a Digital Twin. + * @return the {@link SyncPoller} for polling of the private endpoint connection of a Digital Twin. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -162,9 +162,9 @@ SyncPoller, PrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 of a Digital Twin. + * @return the {@link SyncPoller} for polling of the private endpoint connection of a Digital Twin. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/PrivateLinkResourcesClient.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/PrivateLinkResourcesClient.java index 49e6a0ff1c37..602728389447 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/PrivateLinkResourcesClient.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/PrivateLinkResourcesClient.java @@ -35,7 +35,7 @@ public interface PrivateLinkResourcesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for a Digital Twin. + * @return the available private link resources for a Digital Twin along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse( @@ -65,7 +65,7 @@ Response listWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given Digital Twin. + * @return the specified private link resource for the given Digital Twin along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/TimeSeriesDatabaseConnectionsClient.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/TimeSeriesDatabaseConnectionsClient.java new file mode 100644 index 000000000000..6b01cba85115 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/TimeSeriesDatabaseConnectionsClient.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.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.digitaltwins.fluent.models.TimeSeriesDatabaseConnectionInner; + +/** An instance of this class provides access to all the operations defined in TimeSeriesDatabaseConnectionsClient. */ +public interface TimeSeriesDatabaseConnectionsClient { + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 existing time series database connections for this DigitalTwins instance as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @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 existing time series database connections for this DigitalTwins instance as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list( + String resourceGroupName, String resourceName, Context context); + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of an existing time series database connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TimeSeriesDatabaseConnectionInner get( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName); + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 description of an existing time series database connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context); + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TimeSeriesDatabaseConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription); + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TimeSeriesDatabaseConnectionInner> beginCreateOrUpdate( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription, + Context context); + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TimeSeriesDatabaseConnectionInner createOrUpdate( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription); + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TimeSeriesDatabaseConnectionInner createOrUpdate( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription, + Context context); + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException 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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TimeSeriesDatabaseConnectionInner> beginDelete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName); + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TimeSeriesDatabaseConnectionInner> beginDelete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context); + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TimeSeriesDatabaseConnectionInner delete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName); + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TimeSeriesDatabaseConnectionInner delete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context); +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/DigitalTwinsDescriptionInner.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/DigitalTwinsDescriptionInner.java index ca6e348287f7..a26542f3ab6b 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/DigitalTwinsDescriptionInner.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/DigitalTwinsDescriptionInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.digitaltwins.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentity; import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsResource; @@ -18,46 +17,45 @@ import java.util.Map; /** The description of the DigitalTwins service. */ -@JsonFlatten @Fluent -public class DigitalTwinsDescriptionInner extends DigitalTwinsResource { +public final class DigitalTwinsDescriptionInner extends DigitalTwinsResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DigitalTwinsDescriptionInner.class); /* - * Time when DigitalTwinsInstance was created. + * DigitalTwins instance properties. */ - @JsonProperty(value = "properties.createdTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdTime; + @JsonProperty(value = "properties") + private DigitalTwinsProperties innerProperties; - /* - * Time when DigitalTwinsInstance was updated. - */ - @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastUpdatedTime; - - /* - * The provisioning state. + /** + * Get the innerProperties property: DigitalTwins instance properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisioningState provisioningState; + private DigitalTwinsProperties innerProperties() { + return this.innerProperties; + } - /* - * Api endpoint to work with DigitalTwinsInstance. - */ - @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) - private String hostname; + /** {@inheritDoc} */ + @Override + public DigitalTwinsDescriptionInner withIdentity(DigitalTwinsIdentity identity) { + super.withIdentity(identity); + return this; + } - /* - * The privateEndpointConnections property. - */ - @JsonProperty(value = "properties.privateEndpointConnections") - private List privateEndpointConnections; + /** {@inheritDoc} */ + @Override + public DigitalTwinsDescriptionInner withLocation(String location) { + super.withLocation(location); + return this; + } - /* - * Public network access for the DigitalTwinsInstance. - */ - @JsonProperty(value = "properties.publicNetworkAccess") - private PublicNetworkAccess publicNetworkAccess; + /** {@inheritDoc} */ + @Override + public DigitalTwinsDescriptionInner withTags(Map tags) { + super.withTags(tags); + return this; + } /** * Get the createdTime property: Time when DigitalTwinsInstance was created. @@ -65,7 +63,7 @@ public class DigitalTwinsDescriptionInner extends DigitalTwinsResource { * @return the createdTime value. */ public OffsetDateTime createdTime() { - return this.createdTime; + return this.innerProperties() == null ? null : this.innerProperties().createdTime(); } /** @@ -74,7 +72,7 @@ public OffsetDateTime createdTime() { * @return the lastUpdatedTime value. */ public OffsetDateTime lastUpdatedTime() { - return this.lastUpdatedTime; + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedTime(); } /** @@ -83,7 +81,7 @@ public OffsetDateTime lastUpdatedTime() { * @return the provisioningState value. */ public ProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -92,27 +90,30 @@ public ProvisioningState provisioningState() { * @return the hostname value. */ public String hostname() { - return this.hostname; + return this.innerProperties() == null ? null : this.innerProperties().hostname(); } /** - * Get the privateEndpointConnections property: The privateEndpointConnections property. + * Get the privateEndpointConnections property: The private endpoint connections. * * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { - return this.privateEndpointConnections; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } /** - * Set the privateEndpointConnections property: The privateEndpointConnections property. + * Set the privateEndpointConnections property: The private endpoint connections. * * @param privateEndpointConnections the privateEndpointConnections value to set. * @return the DigitalTwinsDescriptionInner object itself. */ public DigitalTwinsDescriptionInner withPrivateEndpointConnections( List privateEndpointConnections) { - this.privateEndpointConnections = privateEndpointConnections; + if (this.innerProperties() == null) { + this.innerProperties = new DigitalTwinsProperties(); + } + this.innerProperties().withPrivateEndpointConnections(privateEndpointConnections); return this; } @@ -122,7 +123,7 @@ public DigitalTwinsDescriptionInner withPrivateEndpointConnections( * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { - return this.publicNetworkAccess; + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); } /** @@ -132,28 +133,10 @@ public PublicNetworkAccess publicNetworkAccess() { * @return the DigitalTwinsDescriptionInner object itself. */ public DigitalTwinsDescriptionInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { - this.publicNetworkAccess = publicNetworkAccess; - return this; - } - - /** {@inheritDoc} */ - @Override - public DigitalTwinsDescriptionInner withIdentity(DigitalTwinsIdentity identity) { - super.withIdentity(identity); - return this; - } - - /** {@inheritDoc} */ - @Override - public DigitalTwinsDescriptionInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public DigitalTwinsDescriptionInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new DigitalTwinsProperties(); + } + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); return this; } @@ -165,8 +148,8 @@ public DigitalTwinsDescriptionInner withTags(Map tags) { @Override public void validate() { super.validate(); - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/DigitalTwinsProperties.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/DigitalTwinsProperties.java new file mode 100644 index 000000000000..63c8ad1e27ed --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/DigitalTwinsProperties.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.digitaltwins.models.ProvisioningState; +import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of a DigitalTwinsInstance. */ +@Fluent +public final class DigitalTwinsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DigitalTwinsProperties.class); + + /* + * Time when DigitalTwinsInstance was created. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * Time when DigitalTwinsInstance was updated. + */ + @JsonProperty(value = "lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUpdatedTime; + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Api endpoint to work with DigitalTwinsInstance. + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The private endpoint connections. + */ + @JsonProperty(value = "privateEndpointConnections") + private List privateEndpointConnections; + + /* + * Public network access for the DigitalTwinsInstance. + */ + @JsonProperty(value = "publicNetworkAccess") + private PublicNetworkAccess publicNetworkAccess; + + /** + * Get the createdTime property: Time when DigitalTwinsInstance was created. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the lastUpdatedTime property: Time when DigitalTwinsInstance was updated. + * + * @return the lastUpdatedTime value. + */ + public OffsetDateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the hostname property: Api endpoint to work with DigitalTwinsInstance. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the privateEndpointConnections property: The private endpoint connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Set the privateEndpointConnections property: The private endpoint connections. + * + * @param privateEndpointConnections the privateEndpointConnections value to set. + * @return the DigitalTwinsProperties object itself. + */ + public DigitalTwinsProperties withPrivateEndpointConnections( + List privateEndpointConnections) { + this.privateEndpointConnections = privateEndpointConnections; + return this; + } + + /** + * Get the publicNetworkAccess property: Public network access for the DigitalTwinsInstance. + * + * @return the publicNetworkAccess value. + */ + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; + } + + /** + * Set the publicNetworkAccess property: Public network access for the DigitalTwinsInstance. + * + * @param publicNetworkAccess the publicNetworkAccess value to set. + * @return the DigitalTwinsProperties object itself. + */ + public DigitalTwinsProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.publicNetworkAccess = publicNetworkAccess; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/GroupIdInformationInner.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/GroupIdInformationInner.java index 6db04ec52cba..84affdcc2203 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/GroupIdInformationInner.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/GroupIdInformationInner.java @@ -16,7 +16,7 @@ public final class GroupIdInformationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupIdInformationInner.class); /* - * The properties for a group information object. + * The group information properties. */ @JsonProperty(value = "properties", required = true) private GroupIdInformationProperties properties; @@ -40,7 +40,7 @@ public final class GroupIdInformationInner { private String type; /** - * Get the properties property: The properties for a group information object. + * Get the properties property: The group information properties. * * @return the properties value. */ @@ -49,7 +49,7 @@ public GroupIdInformationProperties properties() { } /** - * Set the properties property: The properties for a group information object. + * Set the properties property: The group information properties. * * @param properties the properties value to set. * @return the GroupIdInformationInner object itself. diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/OperationInner.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/OperationInner.java index b653f956b0c1..ac94705bc2c0 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/OperationInner.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/OperationInner.java @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.digitaltwins.models.OperationDisplay; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** DigitalTwins service REST API operation. */ @Fluent @@ -39,6 +41,13 @@ public final class OperationInner { @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; + /* + * Operation properties. + */ + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map properties; + /** * Get the name property: Operation name: {provider}/{resource}/{read | write | action | delete}. * @@ -86,6 +95,15 @@ public Boolean isDataAction() { return this.isDataAction; } + /** + * Get the properties property: Operation properties. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + /** * Validates the instance. * diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/PrivateEndpointConnectionInner.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/PrivateEndpointConnectionInner.java index 4f634cdc1341..e5fe11340a51 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/PrivateEndpointConnectionInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.digitaltwins.models.ConnectionProperties; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -17,13 +18,20 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); /* - * The properties of a private endpoint connection. + * The connection properties. */ @JsonProperty(value = "properties", required = true) private ConnectionProperties properties; + /* + * Metadata pertaining to creation and last modification of the private + * endpoint connection. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** - * Get the properties property: The properties of a private endpoint connection. + * Get the properties property: The connection properties. * * @return the properties value. */ @@ -32,7 +40,7 @@ public ConnectionProperties properties() { } /** - * Set the properties property: The properties of a private endpoint connection. + * Set the properties property: The connection properties. * * @param properties the properties value to set. * @return the PrivateEndpointConnectionInner object itself. @@ -42,6 +50,16 @@ public PrivateEndpointConnectionInner withProperties(ConnectionProperties proper return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the private endpoint + * connection. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Validates the instance. * diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/TimeSeriesDatabaseConnectionInner.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/TimeSeriesDatabaseConnectionInner.java new file mode 100644 index 000000000000..6d326a53799d --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/fluent/models/TimeSeriesDatabaseConnectionInner.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.digitaltwins.models.ExternalResource; +import com.azure.resourcemanager.digitaltwins.models.TimeSeriesDatabaseConnectionProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a time series database connection resource. */ +@Fluent +public final class TimeSeriesDatabaseConnectionInner extends ExternalResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSeriesDatabaseConnectionInner.class); + + /* + * Properties of a specific time series database connection. + */ + @JsonProperty(value = "properties") + private TimeSeriesDatabaseConnectionProperties properties; + + /** + * Get the properties property: Properties of a specific time series database connection. + * + * @return the properties value. + */ + public TimeSeriesDatabaseConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a specific time series database connection. + * + * @param properties the properties value to set. + * @return the TimeSeriesDatabaseConnectionInner object itself. + */ + public TimeSeriesDatabaseConnectionInner withProperties(TimeSeriesDatabaseConnectionProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/AzureDigitalTwinsManagementClientImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/AzureDigitalTwinsManagementClientImpl.java index d50a4ff4639e..444eb570c2fc 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/AzureDigitalTwinsManagementClientImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/AzureDigitalTwinsManagementClientImpl.java @@ -27,6 +27,7 @@ import com.azure.resourcemanager.digitaltwins.fluent.OperationsClient; import com.azure.resourcemanager.digitaltwins.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.digitaltwins.fluent.PrivateLinkResourcesClient; +import com.azure.resourcemanager.digitaltwins.fluent.TimeSeriesDatabaseConnectionsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -174,6 +175,18 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { return this.privateEndpointConnections; } + /** The TimeSeriesDatabaseConnectionsClient object to access its operations. */ + private final TimeSeriesDatabaseConnectionsClient timeSeriesDatabaseConnections; + + /** + * Gets the TimeSeriesDatabaseConnectionsClient object to access its operations. + * + * @return the TimeSeriesDatabaseConnectionsClient object. + */ + public TimeSeriesDatabaseConnectionsClient getTimeSeriesDatabaseConnections() { + return this.timeSeriesDatabaseConnections; + } + /** * Initializes an instance of AzureDigitalTwinsManagementClient client. * @@ -196,12 +209,13 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-12-01"; + this.apiVersion = "2021-06-30-preview"; this.digitalTwins = new DigitalTwinsClientImpl(this); this.digitalTwinsEndpoints = new DigitalTwinsEndpointsClientImpl(this); this.operations = new OperationsClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.timeSeriesDatabaseConnections = new TimeSeriesDatabaseConnectionsClientImpl(this); } /** diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/CheckNameResultImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/CheckNameResultImpl.java index f353ff6c4c55..4dfb86b9b1b3 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/CheckNameResultImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/CheckNameResultImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.digitaltwins.implementation; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.models.CheckNameResultInner; import com.azure.resourcemanager.digitaltwins.models.CheckNameResult; import com.azure.resourcemanager.digitaltwins.models.Reason; @@ -12,9 +11,11 @@ public final class CheckNameResultImpl implements CheckNameResult { private CheckNameResultInner innerObject; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; - CheckNameResultImpl(CheckNameResultInner innerObject, AzureDigitalTwinsManager serviceManager) { + CheckNameResultImpl( + CheckNameResultInner innerObject, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -35,7 +36,7 @@ public CheckNameResultInner innerModel() { return this.innerObject; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsClientImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsClientImpl.java index d208510051d9..8605a67406e1 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsClientImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsClientImpl.java @@ -203,7 +203,7 @@ Mono> listByResourceGroupNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances resource. + * @return digitalTwinsInstances resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -240,7 +240,7 @@ private Mono> getByResourceGroupWithRespo resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -252,7 +252,7 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances resource. + * @return digitalTwinsInstances resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -297,7 +297,7 @@ private Mono> getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances resource. + * @return digitalTwinsInstances resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { @@ -336,7 +336,7 @@ public DigitalTwinsDescriptionInner getByResourceGroup(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 digitalTwinsInstances resource. + * @return digitalTwinsInstances resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -355,7 +355,8 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -399,7 +400,7 @@ private Mono>> createOrUpdateWithResponseAsync( digitalTwinsCreate, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -414,7 +415,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -472,9 +474,9 @@ 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 description of the DigitalTwins service. + * @return the {@link PollerFlux} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate) { Mono>> mono = @@ -486,7 +488,7 @@ private PollerFlux, DigitalTwinsDescrip this.client.getHttpPipeline(), DigitalTwinsDescriptionInner.class, DigitalTwinsDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -501,9 +503,9 @@ private PollerFlux, DigitalTwinsDescrip * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link PollerFlux} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, String resourceName, @@ -533,9 +535,9 @@ private PollerFlux, DigitalTwinsDescrip * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate) { return beginCreateOrUpdateAsync(resourceGroupName, resourceName, digitalTwinsCreate).getSyncPoller(); @@ -553,9 +555,9 @@ public SyncPoller, DigitalTwinsDescript * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -575,7 +577,7 @@ public SyncPoller, DigitalTwinsDescript * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -597,7 +599,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -661,7 +663,8 @@ public DigitalTwinsDescriptionInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -707,7 +710,7 @@ private Mono>> updateWithResponseAsync( digitalTwinsPatchDescription, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -720,7 +723,8 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -778,9 +782,9 @@ 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 description of the DigitalTwins service. + * @return the {@link PollerFlux} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsDescriptionInner> beginUpdateAsync( String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription) { Mono>> mono = @@ -792,7 +796,7 @@ private PollerFlux, DigitalTwinsDescrip this.client.getHttpPipeline(), DigitalTwinsDescriptionInner.class, DigitalTwinsDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -805,9 +809,9 @@ private PollerFlux, DigitalTwinsDescrip * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link PollerFlux} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsDescriptionInner> beginUpdateAsync( String resourceGroupName, String resourceName, @@ -835,9 +839,9 @@ private PollerFlux, DigitalTwinsDescrip * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription) { return beginUpdateAsync(resourceGroupName, resourceName, digitalTwinsPatchDescription).getSyncPoller(); @@ -853,9 +857,9 @@ public SyncPoller, DigitalTwinsDescript * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -873,7 +877,7 @@ public SyncPoller, DigitalTwinsDescript * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -893,7 +897,7 @@ 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 description of the DigitalTwins service. + * @return the description of the DigitalTwins service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -952,7 +956,8 @@ public DigitalTwinsDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { @@ -988,7 +993,7 @@ private Mono>> deleteWithResponseAsync(String resource resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1000,7 +1005,8 @@ 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 description of the DigitalTwins service. + * @return the description of the DigitalTwins service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -1045,9 +1051,9 @@ 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 description of the DigitalTwins service. + * @return the {@link PollerFlux} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsDescriptionInner> beginDeleteAsync( String resourceGroupName, String resourceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); @@ -1058,7 +1064,7 @@ private PollerFlux, DigitalTwinsDescrip this.client.getHttpPipeline(), DigitalTwinsDescriptionInner.class, DigitalTwinsDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1070,9 +1076,9 @@ private PollerFlux, DigitalTwinsDescrip * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link PollerFlux} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsDescriptionInner> beginDeleteAsync( String resourceGroupName, String resourceName, Context context) { context = this.client.mergeContext(context); @@ -1095,9 +1101,9 @@ private PollerFlux, DigitalTwinsDescrip * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsDescriptionInner> beginDelete( String resourceGroupName, String resourceName) { return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); @@ -1112,9 +1118,9 @@ public SyncPoller, DigitalTwinsDescript * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the {@link SyncPoller} for polling of the description of the DigitalTwins service. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsDescriptionInner> beginDelete( String resourceGroupName, String resourceName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); @@ -1128,7 +1134,7 @@ public SyncPoller, DigitalTwinsDescript * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the DigitalTwins service. + * @return the description of the DigitalTwins service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String resourceName) { @@ -1144,7 +1150,7 @@ private Mono deleteAsync(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 description of the DigitalTwins service. + * @return the description of the DigitalTwins service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1190,7 +1196,8 @@ public DigitalTwinsDescriptionInner delete(String resourceGroupName, String reso * * @throws 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 DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1226,7 +1233,7 @@ private Mono> listSinglePageAsync() res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1236,7 +1243,8 @@ private Mono> listSinglePageAsync() * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1277,7 +1285,7 @@ private Mono> listSinglePageAsync(Co * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1291,7 +1299,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1304,7 +1312,7 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1318,7 +1326,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1332,7 +1340,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 DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1374,7 +1383,7 @@ private Mono> listByResourceGroupSin res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1385,7 +1394,8 @@ private Mono> listByResourceGroupSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1434,7 +1444,7 @@ private Mono> listByResourceGroupSin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1451,7 +1461,7 @@ private PagedFlux listByResourceGroupAsync(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 DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( @@ -1468,7 +1478,7 @@ private PagedFlux listByResourceGroupAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1483,7 +1493,7 @@ public PagedIterable listByResourceGroup(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1499,7 +1509,8 @@ public PagedIterable listByResourceGroup(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. + * @return the result returned from a check name availability request along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1540,7 +1551,7 @@ private Mono> checkNameAvailabilityWithResponseAs digitalTwinsInstanceCheckName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1553,7 +1564,8 @@ private Mono> checkNameAvailabilityWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. + * @return the result returned from a check name availability request along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -1603,7 +1615,7 @@ private Mono> checkNameAvailabilityWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. + * @return the result returned from a check name availability request on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( @@ -1645,7 +1657,7 @@ public CheckNameResultInner checkNameAvailability(String location, CheckNameRequ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. + * @return the result returned from a check name availability request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse( @@ -1660,7 +1672,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 a list of DigitalTwins description objects with a next link. + * @return a list of DigitalTwins description objects with a next link along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1685,7 +1698,7 @@ private Mono> listNextSinglePageAsyn res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1696,7 +1709,8 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwins description objects with a next link. + * @return a list of DigitalTwins description objects with a next link along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( @@ -1732,7 +1746,8 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwins description objects with a next link. + * @return a list of DigitalTwins description objects with a next link along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1758,7 +1773,7 @@ private Mono> listByResourceGroupNex res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1769,7 +1784,8 @@ private Mono> listByResourceGroupNex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwins description objects with a next link. + * @return a list of DigitalTwins description objects with a next link along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsDescriptionImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsDescriptionImpl.java index f2ea083b97c0..bf7adeaac10c 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsDescriptionImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsDescriptionImpl.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.digitaltwins.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.models.DigitalTwinsDescriptionInner; import com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsDescription; @@ -26,7 +26,7 @@ public final class DigitalTwinsDescriptionImpl implements DigitalTwinsDescription, DigitalTwinsDescription.Definition, DigitalTwinsDescription.Update { private DigitalTwinsDescriptionInner innerObject; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; public String id() { return this.innerModel().id(); @@ -57,6 +57,10 @@ public DigitalTwinsIdentity identity() { return this.innerModel().identity(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public OffsetDateTime createdTime() { return this.innerModel().createdTime(); } @@ -103,7 +107,7 @@ public DigitalTwinsDescriptionInner innerModel() { return this.innerObject; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } @@ -136,7 +140,8 @@ public DigitalTwinsDescription create(Context context) { return this; } - DigitalTwinsDescriptionImpl(String name, AzureDigitalTwinsManager serviceManager) { + DigitalTwinsDescriptionImpl( + String name, com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = new DigitalTwinsDescriptionInner(); this.serviceManager = serviceManager; this.resourceName = name; @@ -165,7 +170,9 @@ public DigitalTwinsDescription apply(Context context) { return this; } - DigitalTwinsDescriptionImpl(DigitalTwinsDescriptionInner innerObject, AzureDigitalTwinsManager serviceManager) { + DigitalTwinsDescriptionImpl( + DigitalTwinsDescriptionInner innerObject, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointResourceImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointResourceImpl.java index d48210617c3b..a7d9aeab314d 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointResourceImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointResourceImpl.java @@ -4,8 +4,8 @@ package com.azure.resourcemanager.digitaltwins.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.models.DigitalTwinsEndpointResourceInner; import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsEndpointResource; import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsEndpointResourceProperties; @@ -16,7 +16,7 @@ public final class DigitalTwinsEndpointResourceImpl DigitalTwinsEndpointResource.Update { private DigitalTwinsEndpointResourceInner innerObject; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; public String id() { return this.innerModel().id(); @@ -30,6 +30,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public DigitalTwinsEndpointResourceProperties properties() { return this.innerModel().properties(); } @@ -38,7 +42,7 @@ public DigitalTwinsEndpointResourceInner innerModel() { return this.innerObject; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } @@ -73,7 +77,8 @@ public DigitalTwinsEndpointResource create(Context context) { return this; } - DigitalTwinsEndpointResourceImpl(String name, AzureDigitalTwinsManager serviceManager) { + DigitalTwinsEndpointResourceImpl( + String name, com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = new DigitalTwinsEndpointResourceInner(); this.serviceManager = serviceManager; this.endpointName = name; @@ -102,7 +107,8 @@ public DigitalTwinsEndpointResource apply(Context context) { } DigitalTwinsEndpointResourceImpl( - DigitalTwinsEndpointResourceInner innerObject, AzureDigitalTwinsManager serviceManager) { + DigitalTwinsEndpointResourceInner innerObject, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointsClientImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointsClientImpl.java index 299947372e56..6340b6fa9cc6 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointsClientImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointsClientImpl.java @@ -151,7 +151,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -197,7 +197,7 @@ private Mono> listSinglePageAsy res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -209,7 +209,7 @@ private Mono> listSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -263,7 +263,7 @@ private Mono> listSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String resourceGroupName, String resourceName) { @@ -280,7 +280,7 @@ private PagedFlux listAsync(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -298,7 +298,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 digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String resourceName) { @@ -314,7 +314,7 @@ public PagedIterable list(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -331,7 +331,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 digitalTwinsInstances Endpoint. + * @return digitalTwinsInstances Endpoint along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -372,7 +372,7 @@ private Mono> getWithResponseAsync( endpointName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -385,7 +385,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances Endpoint. + * @return digitalTwinsInstances Endpoint along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -435,7 +435,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances Endpoint. + * @return digitalTwinsInstances Endpoint on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -477,7 +477,7 @@ public DigitalTwinsEndpointResourceInner get(String resourceGroupName, String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances Endpoint. + * @return digitalTwinsInstances Endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -495,7 +495,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return digitalTwinsInstance endpoint resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -546,7 +547,7 @@ private Mono>> createOrUpdateWithResponseAsync( endpointDescription, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -560,7 +561,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return digitalTwinsInstance endpoint resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -622,9 +624,9 @@ 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 digitalTwinsInstance endpoint resource. + * @return the {@link PollerFlux} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsEndpointResourceInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -640,7 +642,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getHttpPipeline(), DigitalTwinsEndpointResourceInner.class, DigitalTwinsEndpointResourceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -654,9 +656,9 @@ 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 digitalTwinsInstance endpoint resource. + * @return the {@link PollerFlux} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsEndpointResourceInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -688,9 +690,9 @@ 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 digitalTwinsInstance endpoint resource. + * @return the {@link SyncPoller} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsEndpointResourceInner> beginCreateOrUpdate( String resourceGroupName, @@ -712,9 +714,9 @@ 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 digitalTwinsInstance endpoint resource. + * @return the {@link SyncPoller} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsEndpointResourceInner> beginCreateOrUpdate( String resourceGroupName, @@ -736,7 +738,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 digitalTwinsInstance endpoint resource. + * @return digitalTwinsInstance endpoint resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -760,7 +762,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return digitalTwinsInstance endpoint resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -827,7 +829,8 @@ public DigitalTwinsEndpointResourceInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return digitalTwinsInstance endpoint resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -868,7 +871,7 @@ private Mono>> deleteWithResponseAsync( endpointName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -881,7 +884,8 @@ 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 digitalTwinsInstance endpoint resource. + * @return digitalTwinsInstance endpoint resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -931,9 +935,9 @@ 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 digitalTwinsInstance endpoint resource. + * @return the {@link PollerFlux} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsEndpointResourceInner> beginDeleteAsync(String resourceGroupName, String resourceName, String endpointName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, endpointName); @@ -944,7 +948,7 @@ private Mono>> deleteWithResponseAsync( this.client.getHttpPipeline(), DigitalTwinsEndpointResourceInner.class, DigitalTwinsEndpointResourceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -957,9 +961,9 @@ 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 digitalTwinsInstance endpoint resource. + * @return the {@link PollerFlux} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DigitalTwinsEndpointResourceInner> beginDeleteAsync(String resourceGroupName, String resourceName, String endpointName, Context context) { context = this.client.mergeContext(context); @@ -984,9 +988,9 @@ 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 digitalTwinsInstance endpoint resource. + * @return the {@link SyncPoller} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsEndpointResourceInner> beginDelete( String resourceGroupName, String resourceName, String endpointName) { return beginDeleteAsync(resourceGroupName, resourceName, endpointName).getSyncPoller(); @@ -1002,9 +1006,9 @@ public SyncPoller, DigitalTwinsEnd * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return the {@link SyncPoller} for polling of digitalTwinsInstance endpoint resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, DigitalTwinsEndpointResourceInner> beginDelete( String resourceGroupName, String resourceName, String endpointName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, endpointName, context).getSyncPoller(); @@ -1019,7 +1023,7 @@ public SyncPoller, DigitalTwinsEnd * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return digitalTwinsInstance endpoint resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1039,7 +1043,7 @@ private Mono deleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance endpoint resource. + * @return digitalTwinsInstance endpoint resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -1091,7 +1095,8 @@ public DigitalTwinsEndpointResourceInner delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwinsInstance Endpoints with a next link. + * @return a list of DigitalTwinsInstance Endpoints with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1116,7 +1121,7 @@ private Mono> listNextSinglePag res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1127,7 +1132,8 @@ private Mono> listNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 DigitalTwinsInstance Endpoints with a next link. + * @return a list of DigitalTwinsInstance Endpoints with a next link along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointsImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointsImpl.java index b10c3413772d..bf997c9d25dc 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointsImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsEndpointsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.DigitalTwinsEndpointsClient; import com.azure.resourcemanager.digitaltwins.fluent.models.DigitalTwinsEndpointResourceInner; import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsEndpointResource; @@ -21,9 +20,11 @@ public final class DigitalTwinsEndpointsImpl implements DigitalTwinsEndpoints { private final DigitalTwinsEndpointsClient innerClient; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; - public DigitalTwinsEndpointsImpl(DigitalTwinsEndpointsClient innerClient, AzureDigitalTwinsManager serviceManager) { + public DigitalTwinsEndpointsImpl( + DigitalTwinsEndpointsClient innerClient, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -207,7 +208,7 @@ private DigitalTwinsEndpointsClient serviceClient() { return this.innerClient; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsImpl.java index 33e3ebc04012..46156d72416e 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/DigitalTwinsImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.DigitalTwinsClient; import com.azure.resourcemanager.digitaltwins.fluent.models.CheckNameResultInner; import com.azure.resourcemanager.digitaltwins.fluent.models.DigitalTwinsDescriptionInner; @@ -24,9 +23,11 @@ public final class DigitalTwinsImpl implements DigitalTwins { private final DigitalTwinsClient innerClient; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; - public DigitalTwinsImpl(DigitalTwinsClient innerClient, AzureDigitalTwinsManager serviceManager) { + public DigitalTwinsImpl( + DigitalTwinsClient innerClient, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -211,7 +212,7 @@ private DigitalTwinsClient serviceClient() { return this.innerClient; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/GroupIdInformationImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/GroupIdInformationImpl.java index 0078089e381f..08bbff8ff003 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/GroupIdInformationImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/GroupIdInformationImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.digitaltwins.implementation; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.models.GroupIdInformationInner; import com.azure.resourcemanager.digitaltwins.models.GroupIdInformation; import com.azure.resourcemanager.digitaltwins.models.GroupIdInformationProperties; @@ -12,9 +11,11 @@ public final class GroupIdInformationImpl implements GroupIdInformation { private GroupIdInformationInner innerObject; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; - GroupIdInformationImpl(GroupIdInformationInner innerObject, AzureDigitalTwinsManager serviceManager) { + GroupIdInformationImpl( + GroupIdInformationInner innerObject, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,7 +40,7 @@ public GroupIdInformationInner innerModel() { return this.innerObject; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/GroupIdInformationResponseImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/GroupIdInformationResponseImpl.java index f43ef6f61d5d..f262fca7d0d4 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/GroupIdInformationResponseImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/GroupIdInformationResponseImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.digitaltwins.implementation; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.models.GroupIdInformationInner; import com.azure.resourcemanager.digitaltwins.fluent.models.GroupIdInformationResponseInner; import com.azure.resourcemanager.digitaltwins.models.GroupIdInformation; @@ -16,10 +15,11 @@ public final class GroupIdInformationResponseImpl implements GroupIdInformationResponse { private GroupIdInformationResponseInner innerObject; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; GroupIdInformationResponseImpl( - GroupIdInformationResponseInner innerObject, AzureDigitalTwinsManager serviceManager) { + GroupIdInformationResponseInner innerObject, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -42,7 +42,7 @@ public GroupIdInformationResponseInner innerModel() { return this.innerObject; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationImpl.java index b193db513382..b2697fb9c3be 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationImpl.java @@ -4,17 +4,19 @@ package com.azure.resourcemanager.digitaltwins.implementation; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.models.OperationInner; import com.azure.resourcemanager.digitaltwins.models.Operation; import com.azure.resourcemanager.digitaltwins.models.OperationDisplay; +import java.util.Collections; +import java.util.Map; public final class OperationImpl implements Operation { private OperationInner innerObject; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; - OperationImpl(OperationInner innerObject, AzureDigitalTwinsManager serviceManager) { + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -35,11 +37,20 @@ public Boolean isDataAction() { return this.innerModel().isDataAction(); } + public Map properties() { + Map inner = this.innerModel().properties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public OperationInner innerModel() { return this.innerObject; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationsClientImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationsClientImpl.java index f9c1dbe8fb44..68e5440667c7 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationsClientImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationsClientImpl.java @@ -85,7 +85,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 DigitalTwins service operations. + * @return a list of DigitalTwins service operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -108,7 +109,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -118,7 +119,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 DigitalTwins service operations. + * @return a list of DigitalTwins service operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +150,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 DigitalTwins service operations. + * @return a list of DigitalTwins service operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +164,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 DigitalTwins service operations. + * @return a list of DigitalTwins service operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +177,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 DigitalTwins service operations. + * @return a list of DigitalTwins service operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +191,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 DigitalTwins service operations. + * @return a list of DigitalTwins service operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +205,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of DigitalTwins service operations. + * @return a list of DigitalTwins service operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -228,7 +231,7 @@ private Mono> listNextSinglePageAsync(String nextL res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -239,7 +242,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of DigitalTwins service operations. + * @return a list of DigitalTwins service 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/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationsImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationsImpl.java index 9b0c2f4c671f..24212674fce5 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationsImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/OperationsImpl.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.OperationsClient; import com.azure.resourcemanager.digitaltwins.fluent.models.OperationInner; import com.azure.resourcemanager.digitaltwins.models.Operation; @@ -19,9 +18,10 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; - public OperationsImpl(OperationsClient innerClient, AzureDigitalTwinsManager serviceManager) { + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -40,7 +40,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionImpl.java index 513fb62cdd44..cbc32113785b 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionImpl.java @@ -4,8 +4,8 @@ package com.azure.resourcemanager.digitaltwins.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.digitaltwins.models.ConnectionProperties; import com.azure.resourcemanager.digitaltwins.models.PrivateEndpointConnection; @@ -14,7 +14,7 @@ public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { private PrivateEndpointConnectionInner innerObject; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; public String id() { return this.innerModel().id(); @@ -32,11 +32,15 @@ public ConnectionProperties properties() { return this.innerModel().properties(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public PrivateEndpointConnectionInner innerModel() { return this.innerObject; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } @@ -73,7 +77,8 @@ public PrivateEndpointConnection create(Context context) { return this; } - PrivateEndpointConnectionImpl(String name, AzureDigitalTwinsManager serviceManager) { + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = new PrivateEndpointConnectionInner(); this.serviceManager = serviceManager; this.privateEndpointConnectionName = name; @@ -103,7 +108,9 @@ public PrivateEndpointConnection apply(Context context) { return this; } - PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, AzureDigitalTwinsManager serviceManager) { + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsClientImpl.java index 84c7e607c16f..32c879358541 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsClientImpl.java @@ -138,7 +138,8 @@ Mono>> createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link connections for a Digital Twin. + * @return the available private link connections for a Digital Twin along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync( @@ -175,7 +176,7 @@ private Mono> listWithResponse resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -187,7 +188,8 @@ private Mono> listWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link connections for a Digital Twin. + * @return the available private link connections for a Digital Twin along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync( @@ -232,7 +234,7 @@ private Mono> listWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link connections for a Digital Twin. + * @return the available private link connections for a Digital Twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync(String resourceGroupName, String resourceName) { @@ -271,7 +273,7 @@ public PrivateEndpointConnectionsResponseInner list(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link connections for a Digital Twin. + * @return the available private link connections for a Digital Twin along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse( @@ -288,7 +290,8 @@ public Response listWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties for the given private endpoint. + * @return private endpoint connection properties for the given private endpoint along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -332,7 +335,7 @@ private Mono> getWithResponseAsync( privateEndpointConnectionName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -345,7 +348,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties for the given private endpoint. + * @return private endpoint connection properties for the given private endpoint along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -398,7 +402,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties for the given private endpoint. + * @return private endpoint connection properties for the given private endpoint on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -441,7 +446,7 @@ public PrivateEndpointConnectionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties for the given private endpoint. + * @return private endpoint connection properties for the given private endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -458,7 +463,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -502,7 +507,7 @@ private Mono>> deleteWithResponseAsync( privateEndpointConnectionName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -515,7 +520,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( @@ -568,16 +573,17 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName); 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()); } /** @@ -590,9 +596,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); @@ -612,9 +618,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).getSyncPoller(); @@ -630,9 +636,9 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) @@ -648,7 +654,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( @@ -668,7 +674,7 @@ private Mono deleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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( @@ -720,7 +726,8 @@ public void delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a Digital Twin. + * @return the private endpoint connection of a Digital Twin along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -776,7 +783,7 @@ private Mono>> createOrUpdateWithResponseAsync( privateEndpointConnection, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -790,7 +797,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connection of a Digital Twin. + * @return the private endpoint connection of a Digital Twin along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -857,9 +865,9 @@ 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 private endpoint connection of a Digital Twin. + * @return the {@link PollerFlux} for polling of the private endpoint connection of a Digital Twin. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -876,7 +884,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -890,9 +898,9 @@ 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 private endpoint connection of a Digital Twin. + * @return the {@link PollerFlux} for polling of the private endpoint connection of a Digital Twin. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -924,9 +932,9 @@ 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 private endpoint connection of a Digital Twin. + * @return the {@link SyncPoller} for polling of the private endpoint connection of a Digital Twin. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -948,9 +956,9 @@ public SyncPoller, PrivateEndpointCon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a Digital Twin. + * @return the {@link SyncPoller} for polling of the private endpoint connection of a Digital Twin. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -972,7 +980,7 @@ public SyncPoller, PrivateEndpointCon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a Digital Twin. + * @return the private endpoint connection of a Digital Twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -997,7 +1005,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 of a Digital Twin. + * @return the private endpoint connection of a Digital Twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsImpl.java index 1b1c604262da..f51514e912b4 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionsResponseInner; @@ -22,10 +21,11 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final PrivateEndpointConnectionsClient innerClient; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; public PrivateEndpointConnectionsImpl( - PrivateEndpointConnectionsClient innerClient, AzureDigitalTwinsManager serviceManager) { + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -225,7 +225,7 @@ private PrivateEndpointConnectionsClient serviceClient() { return this.innerClient; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsResponseImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsResponseImpl.java index 5652bbf880d5..da0d86788c26 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsResponseImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateEndpointConnectionsResponseImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.digitaltwins.implementation; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionsResponseInner; import com.azure.resourcemanager.digitaltwins.models.PrivateEndpointConnection; @@ -16,10 +15,11 @@ public final class PrivateEndpointConnectionsResponseImpl implements PrivateEndpointConnectionsResponse { private PrivateEndpointConnectionsResponseInner innerObject; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; PrivateEndpointConnectionsResponseImpl( - PrivateEndpointConnectionsResponseInner innerObject, AzureDigitalTwinsManager serviceManager) { + PrivateEndpointConnectionsResponseInner innerObject, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -42,7 +42,7 @@ public PrivateEndpointConnectionsResponseInner innerModel() { return this.innerObject; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateLinkResourcesClientImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateLinkResourcesClientImpl.java index 25dcb163a2f5..94a22ed469f8 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateLinkResourcesClientImpl.java @@ -96,7 +96,8 @@ Mono> get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for a Digital Twin. + * @return the available private link resources for a Digital Twin along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync( @@ -133,7 +134,7 @@ private Mono> listWithResponseAsync( resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -145,7 +146,8 @@ private Mono> listWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for a Digital Twin. + * @return the available private link resources for a Digital Twin along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync( @@ -190,7 +192,7 @@ private Mono> listWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for a Digital Twin. + * @return the available private link resources for a Digital Twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync(String resourceGroupName, String resourceName) { @@ -229,7 +231,7 @@ public GroupIdInformationResponseInner list(String resourceGroupName, String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for a Digital Twin. + * @return the available private link resources for a Digital Twin along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse( @@ -246,7 +248,8 @@ public Response listWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given Digital Twin. + * @return the specified private link resource for the given Digital Twin along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -287,7 +290,7 @@ private Mono> getWithResponseAsync( resourceId, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -300,7 +303,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given Digital Twin. + * @return the specified private link resource for the given Digital Twin along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -350,7 +354,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given Digital Twin. + * @return the specified private link resource for the given Digital Twin on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceGroupName, String resourceName, String resourceId) { @@ -391,7 +395,7 @@ public GroupIdInformationInner get(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 specified private link resource for the given Digital Twin. + * @return the specified private link resource for the given Digital Twin along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateLinkResourcesImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateLinkResourcesImpl.java index f5823d045743..89605bd86496 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/PrivateLinkResourcesImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager; import com.azure.resourcemanager.digitaltwins.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.digitaltwins.fluent.models.GroupIdInformationInner; import com.azure.resourcemanager.digitaltwins.fluent.models.GroupIdInformationResponseInner; @@ -22,9 +21,11 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private final PrivateLinkResourcesClient innerClient; - private final AzureDigitalTwinsManager serviceManager; + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; - public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, AzureDigitalTwinsManager serviceManager) { + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -81,7 +82,7 @@ private PrivateLinkResourcesClient serviceClient() { return this.innerClient; } - private AzureDigitalTwinsManager manager() { + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { return this.serviceManager; } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionImpl.java new file mode 100644 index 000000000000..13d7f87b8690 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.digitaltwins.fluent.models.TimeSeriesDatabaseConnectionInner; +import com.azure.resourcemanager.digitaltwins.models.TimeSeriesDatabaseConnection; +import com.azure.resourcemanager.digitaltwins.models.TimeSeriesDatabaseConnectionProperties; + +public final class TimeSeriesDatabaseConnectionImpl + implements TimeSeriesDatabaseConnection, + TimeSeriesDatabaseConnection.Definition, + TimeSeriesDatabaseConnection.Update { + private TimeSeriesDatabaseConnectionInner innerObject; + + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager 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 TimeSeriesDatabaseConnectionProperties properties() { + return this.innerModel().properties(); + } + + public TimeSeriesDatabaseConnectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + private String timeSeriesDatabaseConnectionName; + + public TimeSeriesDatabaseConnectionImpl withExistingDigitalTwinsInstance( + String resourceGroupName, String resourceName) { + this.resourceGroupName = resourceGroupName; + this.resourceName = resourceName; + return this; + } + + public TimeSeriesDatabaseConnection create() { + this.innerObject = + serviceManager + .serviceClient() + .getTimeSeriesDatabaseConnections() + .createOrUpdate( + resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public TimeSeriesDatabaseConnection create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTimeSeriesDatabaseConnections() + .createOrUpdate( + resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, this.innerModel(), context); + return this; + } + + TimeSeriesDatabaseConnectionImpl( + String name, com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { + this.innerObject = new TimeSeriesDatabaseConnectionInner(); + this.serviceManager = serviceManager; + this.timeSeriesDatabaseConnectionName = name; + } + + public TimeSeriesDatabaseConnectionImpl update() { + return this; + } + + public TimeSeriesDatabaseConnection apply() { + this.innerObject = + serviceManager + .serviceClient() + .getTimeSeriesDatabaseConnections() + .createOrUpdate( + resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, this.innerModel(), Context.NONE); + return this; + } + + public TimeSeriesDatabaseConnection apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTimeSeriesDatabaseConnections() + .createOrUpdate( + resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, this.innerModel(), context); + return this; + } + + TimeSeriesDatabaseConnectionImpl( + TimeSeriesDatabaseConnectionInner innerObject, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "digitalTwinsInstances"); + this.timeSeriesDatabaseConnectionName = + Utils.getValueFromIdByName(innerObject.id(), "timeSeriesDatabaseConnections"); + } + + public TimeSeriesDatabaseConnection refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getTimeSeriesDatabaseConnections() + .getWithResponse(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, Context.NONE) + .getValue(); + return this; + } + + public TimeSeriesDatabaseConnection refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getTimeSeriesDatabaseConnections() + .getWithResponse(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context) + .getValue(); + return this; + } + + public TimeSeriesDatabaseConnectionImpl withProperties(TimeSeriesDatabaseConnectionProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionsClientImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionsClientImpl.java new file mode 100644 index 000000000000..b5496c20b65c --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionsClientImpl.java @@ -0,0 +1,1241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.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.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.digitaltwins.fluent.TimeSeriesDatabaseConnectionsClient; +import com.azure.resourcemanager.digitaltwins.fluent.models.TimeSeriesDatabaseConnectionInner; +import com.azure.resourcemanager.digitaltwins.models.TimeSeriesDatabaseConnectionListResult; +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 TimeSeriesDatabaseConnectionsClient. */ +public final class TimeSeriesDatabaseConnectionsClientImpl implements TimeSeriesDatabaseConnectionsClient { + private final ClientLogger logger = new ClientLogger(TimeSeriesDatabaseConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final TimeSeriesDatabaseConnectionsService service; + + /** The service client containing this operation class. */ + private final AzureDigitalTwinsManagementClientImpl client; + + /** + * Initializes an instance of TimeSeriesDatabaseConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TimeSeriesDatabaseConnectionsClientImpl(AzureDigitalTwinsManagementClientImpl client) { + this.service = + RestProxy + .create( + TimeSeriesDatabaseConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for AzureDigitalTwinsManagementClientTimeSeriesDatabaseConnections to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "AzureDigitalTwinsMan") + private interface TimeSeriesDatabaseConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins" + + "/digitalTwinsInstances/{resourceName}/timeSeriesDatabaseConnections") + @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); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins" + + "/digitalTwinsInstances/{resourceName}/timeSeriesDatabaseConnections" + + "/{timeSeriesDatabaseConnectionName}") + @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("timeSeriesDatabaseConnectionName") String timeSeriesDatabaseConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins" + + "/digitalTwinsInstances/{resourceName}/timeSeriesDatabaseConnections" + + "/{timeSeriesDatabaseConnectionName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @PathParam("timeSeriesDatabaseConnectionName") String timeSeriesDatabaseConnectionName, + @BodyParam("application/json") TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins" + + "/digitalTwinsInstances/{resourceName}/timeSeriesDatabaseConnections" + + "/{timeSeriesDatabaseConnectionName}") + @ExpectedResponses({200, 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("timeSeriesDatabaseConnectionName") String timeSeriesDatabaseConnectionName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 existing time series database connections for this DigitalTwins instance 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(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @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 existing time series database connections for this DigitalTwins instance 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(), + res.getValue().nextLink(), + null)); + } + + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 existing time series database connections for this DigitalTwins instance as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, resourceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @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 existing time series database connections for this DigitalTwins instance 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), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 existing time series database connections for this DigitalTwins instance 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 existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @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 existing time series database connections for this DigitalTwins instance 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)); + } + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of an existing time series database connection along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + 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 (timeSeriesDatabaseConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter timeSeriesDatabaseConnectionName 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, + timeSeriesDatabaseConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 description of an existing time series database connection along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, 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 (timeSeriesDatabaseConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter timeSeriesDatabaseConnectionName 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, + timeSeriesDatabaseConnectionName, + accept, + context); + } + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of an existing time series database connection on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + return getWithResponseAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of an existing time series database connection. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TimeSeriesDatabaseConnectionInner get( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + return getAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName).block(); + } + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 description of an existing time series database connection along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context).block(); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription) { + 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 (timeSeriesDatabaseConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter timeSeriesDatabaseConnectionName is required and cannot be null.")); + } + if (timeSeriesDatabaseConnectionDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter timeSeriesDatabaseConnectionDescription is required and cannot be null.")); + } else { + timeSeriesDatabaseConnectionDescription.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @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 describes a time series database connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription, + 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 (timeSeriesDatabaseConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter timeSeriesDatabaseConnectionName is required and cannot be null.")); + } + if (timeSeriesDatabaseConnectionDescription == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter timeSeriesDatabaseConnectionDescription is required and cannot be null.")); + } else { + timeSeriesDatabaseConnectionDescription.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription, + accept, + context); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TimeSeriesDatabaseConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription) { + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TimeSeriesDatabaseConnectionInner.class, + TimeSeriesDatabaseConnectionInner.class, + this.client.getContext()); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TimeSeriesDatabaseConnectionInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync( + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription, + context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TimeSeriesDatabaseConnectionInner.class, + TimeSeriesDatabaseConnectionInner.class, + context); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TimeSeriesDatabaseConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription) { + return beginCreateOrUpdateAsync( + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription) + .getSyncPoller(); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TimeSeriesDatabaseConnectionInner> + beginCreateOrUpdate( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription, + context) + .getSyncPoller(); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription) { + return beginCreateOrUpdateAsync( + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @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 describes a time series database connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription, + Context context) { + return beginCreateOrUpdateAsync( + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription, + context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TimeSeriesDatabaseConnectionInner createOrUpdate( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription) { + return createOrUpdateAsync( + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription) + .block(); + } + + /** + * Create or update a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @param timeSeriesDatabaseConnectionDescription The time series database connection description. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TimeSeriesDatabaseConnectionInner createOrUpdate( + String resourceGroupName, + String resourceName, + String timeSeriesDatabaseConnectionName, + TimeSeriesDatabaseConnectionInner timeSeriesDatabaseConnectionDescription, + Context context) { + return createOrUpdateAsync( + resourceGroupName, + resourceName, + timeSeriesDatabaseConnectionName, + timeSeriesDatabaseConnectionDescription, + context) + .block(); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + 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 (timeSeriesDatabaseConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter timeSeriesDatabaseConnectionName 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, + timeSeriesDatabaseConnectionName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 describes a time series database connection resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, 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 (timeSeriesDatabaseConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter timeSeriesDatabaseConnectionName 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, + timeSeriesDatabaseConnectionName, + accept, + context); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TimeSeriesDatabaseConnectionInner> + beginDeleteAsync(String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TimeSeriesDatabaseConnectionInner.class, + TimeSeriesDatabaseConnectionInner.class, + this.client.getContext()); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TimeSeriesDatabaseConnectionInner> + beginDeleteAsync( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + TimeSeriesDatabaseConnectionInner.class, + TimeSeriesDatabaseConnectionInner.class, + context); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TimeSeriesDatabaseConnectionInner> beginDelete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName).getSyncPoller(); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TimeSeriesDatabaseConnectionInner> beginDelete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context) + .getSyncPoller(); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + return beginDeleteAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 describes a time series database connection resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TimeSeriesDatabaseConnectionInner delete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + return deleteAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName).block(); + } + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 describes a time series database connection resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TimeSeriesDatabaseConnectionInner delete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context) { + return deleteAsync(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of time series database connection resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a pageable list of time series database connection resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionsImpl.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionsImpl.java new file mode 100644 index 000000000000..298d5a2d1ad8 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/TimeSeriesDatabaseConnectionsImpl.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.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.digitaltwins.fluent.TimeSeriesDatabaseConnectionsClient; +import com.azure.resourcemanager.digitaltwins.fluent.models.TimeSeriesDatabaseConnectionInner; +import com.azure.resourcemanager.digitaltwins.models.TimeSeriesDatabaseConnection; +import com.azure.resourcemanager.digitaltwins.models.TimeSeriesDatabaseConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class TimeSeriesDatabaseConnectionsImpl implements TimeSeriesDatabaseConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSeriesDatabaseConnectionsImpl.class); + + private final TimeSeriesDatabaseConnectionsClient innerClient; + + private final com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager; + + public TimeSeriesDatabaseConnectionsImpl( + TimeSeriesDatabaseConnectionsClient innerClient, + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, resourceName); + return Utils.mapPage(inner, inner1 -> new TimeSeriesDatabaseConnectionImpl(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 TimeSeriesDatabaseConnectionImpl(inner1, this.manager())); + } + + public TimeSeriesDatabaseConnection get( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + TimeSeriesDatabaseConnectionInner inner = + this.serviceClient().get(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName); + if (inner != null) { + return new TimeSeriesDatabaseConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new TimeSeriesDatabaseConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public TimeSeriesDatabaseConnection delete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName) { + TimeSeriesDatabaseConnectionInner inner = + this.serviceClient().delete(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName); + if (inner != null) { + return new TimeSeriesDatabaseConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public TimeSeriesDatabaseConnection delete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context) { + TimeSeriesDatabaseConnectionInner inner = + this.serviceClient().delete(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context); + if (inner != null) { + return new TimeSeriesDatabaseConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public TimeSeriesDatabaseConnection 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, "digitalTwinsInstances"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'digitalTwinsInstances'.", + id))); + } + String timeSeriesDatabaseConnectionName = Utils.getValueFromIdByName(id, "timeSeriesDatabaseConnections"); + if (timeSeriesDatabaseConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'timeSeriesDatabaseConnections'.", + id))); + } + return this + .getWithResponse(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, 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, "digitalTwinsInstances"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'digitalTwinsInstances'.", + id))); + } + String timeSeriesDatabaseConnectionName = Utils.getValueFromIdByName(id, "timeSeriesDatabaseConnections"); + if (timeSeriesDatabaseConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'timeSeriesDatabaseConnections'.", + id))); + } + return this.getWithResponse(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context); + } + + public TimeSeriesDatabaseConnection 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, "digitalTwinsInstances"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'digitalTwinsInstances'.", + id))); + } + String timeSeriesDatabaseConnectionName = Utils.getValueFromIdByName(id, "timeSeriesDatabaseConnections"); + if (timeSeriesDatabaseConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'timeSeriesDatabaseConnections'.", + id))); + } + return this.delete(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, Context.NONE); + } + + public TimeSeriesDatabaseConnection 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, "digitalTwinsInstances"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'digitalTwinsInstances'.", + id))); + } + String timeSeriesDatabaseConnectionName = Utils.getValueFromIdByName(id, "timeSeriesDatabaseConnections"); + if (timeSeriesDatabaseConnectionName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment" + + " 'timeSeriesDatabaseConnections'.", + id))); + } + return this.delete(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context); + } + + private TimeSeriesDatabaseConnectionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager() { + return this.serviceManager; + } + + public TimeSeriesDatabaseConnectionImpl define(String name) { + return new TimeSeriesDatabaseConnectionImpl(name, this.manager()); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/Utils.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/Utils.java index 4cc0600d8d38..c4d4bc812a6a 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/Utils.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/implementation/Utils.java @@ -9,8 +9,6 @@ import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.CoreUtils; -import reactor.core.publisher.Mono; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -19,6 +17,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; +import reactor.core.publisher.Flux; final class Utils { static String getValueFromIdByName(String id, String name) { @@ -80,76 +79,84 @@ static PagedIterable mapPage(PagedIterable pageIterable, Function extends PagedIterable { - private final PagedIterable pageIterable; + private final PagedIterable pagedIterable; private final Function mapper; private final Function, PagedResponse> pageMapper; - private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { - super(new PagedFlux(() -> Mono.empty())); - this.pageIterable = pageIterable; + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; this.mapper = mapper; - this.pageMapper = - page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); } @Override public Stream stream() { - return pageIterable.stream().map(mapper); + return pagedIterable.stream().map(mapper); } @Override public Stream> streamByPage() { - return pageIterable.streamByPage().map(pageMapper); + return pagedIterable.streamByPage().map(pageMapper); } @Override public Stream> streamByPage(String continuationToken) { - return pageIterable.streamByPage(continuationToken).map(pageMapper); + return pagedIterable.streamByPage(continuationToken).map(pageMapper); } @Override public Stream> streamByPage(int preferredPageSize) { - return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); } @Override public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); } @Override public Iterator iterator() { - return new IteratorImpl(pageIterable.iterator(), mapper); + return new IteratorImpl(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken), pageMapper); + pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(preferredPageSize), pageMapper); + pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/AzureDataExplorerConnectionProperties.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/AzureDataExplorerConnectionProperties.java new file mode 100644 index 000000000000..0acaf131ebef --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/AzureDataExplorerConnectionProperties.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of a time series database connection to Azure Data Explorer with data being sent via an EventHub. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "connectionType") +@JsonTypeName("AzureDataExplorer") +@Fluent +public final class AzureDataExplorerConnectionProperties extends TimeSeriesDatabaseConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureDataExplorerConnectionProperties.class); + + /* + * The resource ID of the Azure Data Explorer cluster. + */ + @JsonProperty(value = "adxResourceId", required = true) + private String adxResourceId; + + /* + * The URI of the Azure Data Explorer endpoint. + */ + @JsonProperty(value = "adxEndpointUri", required = true) + private String adxEndpointUri; + + /* + * The name of the Azure Data Explorer database. + */ + @JsonProperty(value = "adxDatabaseName", required = true) + private String adxDatabaseName; + + /* + * The name of the Azure Data Explorer table. + */ + @JsonProperty(value = "adxTableName") + private String adxTableName; + + /* + * The URL of the EventHub namespace for identity-based authentication. It + * must include the protocol sb:// + */ + @JsonProperty(value = "eventHubEndpointUri", required = true) + private String eventHubEndpointUri; + + /* + * The EventHub name in the EventHub namespace for identity-based + * authentication. + */ + @JsonProperty(value = "eventHubEntityPath", required = true) + private String eventHubEntityPath; + + /* + * The resource ID of the EventHub namespace. + */ + @JsonProperty(value = "eventHubNamespaceResourceId", required = true) + private String eventHubNamespaceResourceId; + + /* + * The EventHub consumer group to use when ADX reads from EventHub. + * Defaults to $Default. + */ + @JsonProperty(value = "eventHubConsumerGroup") + private String eventHubConsumerGroup; + + /** + * Get the adxResourceId property: The resource ID of the Azure Data Explorer cluster. + * + * @return the adxResourceId value. + */ + public String adxResourceId() { + return this.adxResourceId; + } + + /** + * Set the adxResourceId property: The resource ID of the Azure Data Explorer cluster. + * + * @param adxResourceId the adxResourceId value to set. + * @return the AzureDataExplorerConnectionProperties object itself. + */ + public AzureDataExplorerConnectionProperties withAdxResourceId(String adxResourceId) { + this.adxResourceId = adxResourceId; + return this; + } + + /** + * Get the adxEndpointUri property: The URI of the Azure Data Explorer endpoint. + * + * @return the adxEndpointUri value. + */ + public String adxEndpointUri() { + return this.adxEndpointUri; + } + + /** + * Set the adxEndpointUri property: The URI of the Azure Data Explorer endpoint. + * + * @param adxEndpointUri the adxEndpointUri value to set. + * @return the AzureDataExplorerConnectionProperties object itself. + */ + public AzureDataExplorerConnectionProperties withAdxEndpointUri(String adxEndpointUri) { + this.adxEndpointUri = adxEndpointUri; + return this; + } + + /** + * Get the adxDatabaseName property: The name of the Azure Data Explorer database. + * + * @return the adxDatabaseName value. + */ + public String adxDatabaseName() { + return this.adxDatabaseName; + } + + /** + * Set the adxDatabaseName property: The name of the Azure Data Explorer database. + * + * @param adxDatabaseName the adxDatabaseName value to set. + * @return the AzureDataExplorerConnectionProperties object itself. + */ + public AzureDataExplorerConnectionProperties withAdxDatabaseName(String adxDatabaseName) { + this.adxDatabaseName = adxDatabaseName; + return this; + } + + /** + * Get the adxTableName property: The name of the Azure Data Explorer table. + * + * @return the adxTableName value. + */ + public String adxTableName() { + return this.adxTableName; + } + + /** + * Set the adxTableName property: The name of the Azure Data Explorer table. + * + * @param adxTableName the adxTableName value to set. + * @return the AzureDataExplorerConnectionProperties object itself. + */ + public AzureDataExplorerConnectionProperties withAdxTableName(String adxTableName) { + this.adxTableName = adxTableName; + return this; + } + + /** + * Get the eventHubEndpointUri property: The URL of the EventHub namespace for identity-based authentication. It + * must include the protocol sb://. + * + * @return the eventHubEndpointUri value. + */ + public String eventHubEndpointUri() { + return this.eventHubEndpointUri; + } + + /** + * Set the eventHubEndpointUri property: The URL of the EventHub namespace for identity-based authentication. It + * must include the protocol sb://. + * + * @param eventHubEndpointUri the eventHubEndpointUri value to set. + * @return the AzureDataExplorerConnectionProperties object itself. + */ + public AzureDataExplorerConnectionProperties withEventHubEndpointUri(String eventHubEndpointUri) { + this.eventHubEndpointUri = eventHubEndpointUri; + return this; + } + + /** + * Get the eventHubEntityPath property: The EventHub name in the EventHub namespace for identity-based + * authentication. + * + * @return the eventHubEntityPath value. + */ + public String eventHubEntityPath() { + return this.eventHubEntityPath; + } + + /** + * Set the eventHubEntityPath property: The EventHub name in the EventHub namespace for identity-based + * authentication. + * + * @param eventHubEntityPath the eventHubEntityPath value to set. + * @return the AzureDataExplorerConnectionProperties object itself. + */ + public AzureDataExplorerConnectionProperties withEventHubEntityPath(String eventHubEntityPath) { + this.eventHubEntityPath = eventHubEntityPath; + return this; + } + + /** + * Get the eventHubNamespaceResourceId property: The resource ID of the EventHub namespace. + * + * @return the eventHubNamespaceResourceId value. + */ + public String eventHubNamespaceResourceId() { + return this.eventHubNamespaceResourceId; + } + + /** + * Set the eventHubNamespaceResourceId property: The resource ID of the EventHub namespace. + * + * @param eventHubNamespaceResourceId the eventHubNamespaceResourceId value to set. + * @return the AzureDataExplorerConnectionProperties object itself. + */ + public AzureDataExplorerConnectionProperties withEventHubNamespaceResourceId(String eventHubNamespaceResourceId) { + this.eventHubNamespaceResourceId = eventHubNamespaceResourceId; + return this; + } + + /** + * Get the eventHubConsumerGroup property: The EventHub consumer group to use when ADX reads from EventHub. Defaults + * to $Default. + * + * @return the eventHubConsumerGroup value. + */ + public String eventHubConsumerGroup() { + return this.eventHubConsumerGroup; + } + + /** + * Set the eventHubConsumerGroup property: The EventHub consumer group to use when ADX reads from EventHub. Defaults + * to $Default. + * + * @param eventHubConsumerGroup the eventHubConsumerGroup value to set. + * @return the AzureDataExplorerConnectionProperties object itself. + */ + public AzureDataExplorerConnectionProperties withEventHubConsumerGroup(String eventHubConsumerGroup) { + this.eventHubConsumerGroup = eventHubConsumerGroup; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (adxResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adxResourceId in model AzureDataExplorerConnectionProperties")); + } + if (adxEndpointUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adxEndpointUri in model AzureDataExplorerConnectionProperties")); + } + if (adxDatabaseName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property adxDatabaseName in model AzureDataExplorerConnectionProperties")); + } + if (eventHubEndpointUri() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property eventHubEndpointUri in model" + + " AzureDataExplorerConnectionProperties")); + } + if (eventHubEntityPath() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property eventHubEntityPath in model AzureDataExplorerConnectionProperties")); + } + if (eventHubNamespaceResourceId() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property eventHubNamespaceResourceId in model" + + " AzureDataExplorerConnectionProperties")); + } + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/CheckNameRequest.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/CheckNameRequest.java index edfafed90939..cf2d8941316b 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/CheckNameRequest.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/CheckNameRequest.java @@ -25,7 +25,7 @@ public final class CheckNameRequest { * Microsoft.DigitalTwins/digitalTwinsInstances. */ @JsonProperty(value = "type", required = true) - private String type; + private String type = "Microsoft.DigitalTwins/digitalTwinsInstances"; /** Creates an instance of CheckNameRequest class. */ public CheckNameRequest() { diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionProperties.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionProperties.java index 63fc1cc5fc5e..7baf3738b512 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionProperties.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionProperties.java @@ -12,7 +12,7 @@ /** The properties of a private endpoint connection. */ @Fluent -public class ConnectionProperties { +public final class ConnectionProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionProperties.class); /* @@ -22,7 +22,7 @@ public class ConnectionProperties { private ConnectionPropertiesProvisioningState provisioningState; /* - * The private endpoint property of a private endpoint connection. + * The private endpoint. */ @JsonProperty(value = "privateEndpoint") private PrivateEndpoint privateEndpoint; @@ -34,10 +34,10 @@ public class ConnectionProperties { private List groupIds; /* - * The current state of a private endpoint connection. + * The connection state. */ @JsonProperty(value = "privateLinkServiceConnectionState") - private ConnectionState privateLinkServiceConnectionState; + private ConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState; /** * Get the provisioningState property: The provisioning state. @@ -49,7 +49,7 @@ public ConnectionPropertiesProvisioningState provisioningState() { } /** - * Get the privateEndpoint property: The private endpoint property of a private endpoint connection. + * Get the privateEndpoint property: The private endpoint. * * @return the privateEndpoint value. */ @@ -58,7 +58,7 @@ public PrivateEndpoint privateEndpoint() { } /** - * Set the privateEndpoint property: The private endpoint property of a private endpoint connection. + * Set the privateEndpoint property: The private endpoint. * * @param privateEndpoint the privateEndpoint value to set. * @return the ConnectionProperties object itself. @@ -89,22 +89,22 @@ public ConnectionProperties withGroupIds(List groupIds) { } /** - * Get the privateLinkServiceConnectionState property: The current state of a private endpoint connection. + * Get the privateLinkServiceConnectionState property: The connection state. * * @return the privateLinkServiceConnectionState value. */ - public ConnectionState privateLinkServiceConnectionState() { + public ConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState() { return this.privateLinkServiceConnectionState; } /** - * Set the privateLinkServiceConnectionState property: The current state of a private endpoint connection. + * Set the privateLinkServiceConnectionState property: The connection state. * * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. * @return the ConnectionProperties object itself. */ public ConnectionProperties withPrivateLinkServiceConnectionState( - ConnectionState privateLinkServiceConnectionState) { + ConnectionPropertiesPrivateLinkServiceConnectionState privateLinkServiceConnectionState) { this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; return this; } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionPropertiesPrivateEndpoint.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionPropertiesPrivateEndpoint.java deleted file mode 100644 index a4ad0de47e4a..000000000000 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionPropertiesPrivateEndpoint.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.digitaltwins.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; - -/** The ConnectionPropertiesPrivateEndpoint model. */ -@Immutable -public final class ConnectionPropertiesPrivateEndpoint extends PrivateEndpoint { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionPropertiesPrivateEndpoint.class); - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionPropertiesPrivateLinkServiceConnectionState.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionPropertiesPrivateLinkServiceConnectionState.java index ccf8f5b30505..9388eca9785c 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionPropertiesPrivateLinkServiceConnectionState.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionPropertiesPrivateLinkServiceConnectionState.java @@ -4,12 +4,12 @@ package com.azure.resourcemanager.digitaltwins.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; -/** The ConnectionPropertiesPrivateLinkServiceConnectionState model. */ -@Immutable +/** The connection state. */ +@Fluent public final class ConnectionPropertiesPrivateLinkServiceConnectionState extends ConnectionState { @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectionPropertiesPrivateLinkServiceConnectionState.class); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionType.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionType.java new file mode 100644 index 000000000000..e543af1381b1 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ConnectionType.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.digitaltwins.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ConnectionType. */ +public final class ConnectionType extends ExpandableStringEnum { + /** Static value AzureDataExplorer for ConnectionType. */ + public static final ConnectionType AZURE_DATA_EXPLORER = fromString("AzureDataExplorer"); + + /** + * Creates or finds a ConnectionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ConnectionType. + */ + @JsonCreator + public static ConnectionType fromString(String name) { + return fromString(name, ConnectionType.class); + } + + /** @return known ConnectionType values. */ + public static Collection values() { + return values(ConnectionType.class); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwins.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwins.java index bf1aa4586505..355b17e44c98 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwins.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwins.java @@ -31,7 +31,7 @@ public interface DigitalTwins { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances resource. + * @return digitalTwinsInstances resource along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String resourceName, Context context); @@ -66,7 +66,7 @@ Response getByResourceGroupWithResponse( * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -77,7 +77,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a subscription. + * @return all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -88,7 +88,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -100,7 +100,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all the DigitalTwinsInstances in a resource group. + * @return all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); @@ -127,7 +127,7 @@ Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the result returned from a check name availability request. + * @return the result returned from a check name availability request along with {@link Response}. */ Response checkNameAvailabilityWithResponse( String location, CheckNameRequest digitalTwinsInstanceCheckName, Context context); @@ -139,7 +139,7 @@ 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 digitalTwinsInstances resource. + * @return digitalTwinsInstances resource along with {@link Response}. */ DigitalTwinsDescription getById(String id); @@ -151,7 +151,7 @@ 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 digitalTwinsInstances resource. + * @return digitalTwinsInstances resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsDescription.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsDescription.java index 52df2fd69bcb..29f2c784a58e 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsDescription.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsDescription.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.digitaltwins.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.digitaltwins.fluent.models.DigitalTwinsDescriptionInner; import com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionInner; @@ -56,6 +57,13 @@ public interface DigitalTwinsDescription { */ DigitalTwinsIdentity identity(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the DigitalTwinsInstance. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the createdTime property: Time when DigitalTwinsInstance was created. * @@ -85,7 +93,7 @@ public interface DigitalTwinsDescription { String hostname(); /** - * Gets the privateEndpointConnections property: The privateEndpointConnections property. + * Gets the privateEndpointConnections property: The private endpoint connections. * * @return the privateEndpointConnections value. */ @@ -206,9 +214,9 @@ interface WithIdentity { /** The stage of the DigitalTwinsDescription definition allowing to specify privateEndpointConnections. */ interface WithPrivateEndpointConnections { /** - * Specifies the privateEndpointConnections property: The privateEndpointConnections property.. + * Specifies the privateEndpointConnections property: The private endpoint connections.. * - * @param privateEndpointConnections The privateEndpointConnections property. + * @param privateEndpointConnections The private endpoint connections. * @return the next definition stage. */ WithCreate withPrivateEndpointConnections(List privateEndpointConnections); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpointResource.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpointResource.java index da652e96fe69..34318a3c2b67 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpointResource.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpointResource.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.digitaltwins.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.digitaltwins.fluent.models.DigitalTwinsEndpointResourceInner; @@ -30,6 +31,13 @@ public interface DigitalTwinsEndpointResource { */ String type(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the properties property: DigitalTwinsInstance endpoint resource properties. * diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpointResourceProperties.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpointResourceProperties.java index bc522bdb8d35..c43fac2117fc 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpointResourceProperties.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpointResourceProperties.java @@ -43,7 +43,10 @@ public class DigitalTwinsEndpointResourceProperties { /* * Specifies the authentication type being used for connecting to the - * endpoint. + * endpoint. Defaults to 'KeyBased'. If 'KeyBased' is selected, a + * connection string must be specified (at least the primary connection + * string). If 'IdentityBased' is select, the endpointUri and entityPath + * properties must be specified. */ @JsonProperty(value = "authenticationType") private AuthenticationType authenticationType; @@ -81,6 +84,8 @@ public OffsetDateTime createdTime() { /** * Get the authenticationType property: Specifies the authentication type being used for connecting to the endpoint. + * Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be specified (at least the primary + * connection string). If 'IdentityBased' is select, the endpointUri and entityPath properties must be specified. * * @return the authenticationType value. */ @@ -90,6 +95,8 @@ public AuthenticationType authenticationType() { /** * Set the authenticationType property: Specifies the authentication type being used for connecting to the endpoint. + * Defaults to 'KeyBased'. If 'KeyBased' is selected, a connection string must be specified (at least the primary + * connection string). If 'IdentityBased' is select, the endpointUri and entityPath properties must be specified. * * @param authenticationType the authenticationType value to set. * @return the DigitalTwinsEndpointResourceProperties object itself. diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpoints.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpoints.java index ad85bc7f5bc4..194e1ae42b22 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpoints.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsEndpoints.java @@ -18,7 +18,7 @@ public interface DigitalTwinsEndpoints { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String resourceName); @@ -31,7 +31,7 @@ public interface DigitalTwinsEndpoints { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstance Endpoints. + * @return digitalTwinsInstance Endpoints as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String resourceName, Context context); @@ -58,7 +58,7 @@ public interface DigitalTwinsEndpoints { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances Endpoint. + * @return digitalTwinsInstances Endpoint along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String resourceName, String endpointName, Context context); @@ -98,7 +98,7 @@ DigitalTwinsEndpointResource delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances Endpoint. + * @return digitalTwinsInstances Endpoint along with {@link Response}. */ DigitalTwinsEndpointResource getById(String id); @@ -110,7 +110,7 @@ DigitalTwinsEndpointResource delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return digitalTwinsInstances Endpoint. + * @return digitalTwinsInstances Endpoint along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsPatchDescription.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsPatchDescription.java index c2675797ad9a..6bca67cfc7dd 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsPatchDescription.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsPatchDescription.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class DigitalTwinsPatchDescription { * Instance patch properties */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsResource.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsResource.java index 1597087d9467..a6831fa37cfc 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsResource.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/DigitalTwinsResource.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -22,6 +23,13 @@ public class DigitalTwinsResource extends Resource { @JsonProperty(value = "identity") private DigitalTwinsIdentity identity; + /* + * Metadata pertaining to creation and last modification of the + * DigitalTwinsInstance. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** * Get the identity property: The managed identity for the DigitalTwinsInstance. * @@ -42,6 +50,15 @@ public DigitalTwinsResource withIdentity(DigitalTwinsIdentity identity) { return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the DigitalTwinsInstance. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** {@inheritDoc} */ @Override public DigitalTwinsResource withLocation(String location) { diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/EventGrid.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/EventGrid.java index 5f6410e7b0a5..7e1cd4c6d829 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/EventGrid.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/EventGrid.java @@ -19,7 +19,7 @@ public final class EventGrid extends DigitalTwinsEndpointResourceProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(EventGrid.class); /* - * EventGrid Topic Endpoint + * EventGrid Topic Endpoint. */ @JsonProperty(value = "TopicEndpoint", required = true) private String topicEndpoint; diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/EventHub.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/EventHub.java index 8df3cf60539a..5c6e99b08277 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/EventHub.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/EventHub.java @@ -34,7 +34,7 @@ public final class EventHub extends DigitalTwinsEndpointResourceProperties { /* * The URL of the EventHub namespace for identity-based authentication. It - * must include the protocol sb:// + * must include the protocol 'sb://'. */ @JsonProperty(value = "endpointUri") private String endpointUri; @@ -92,7 +92,7 @@ public EventHub withConnectionStringSecondaryKey(String connectionStringSecondar /** * Get the endpointUri property: The URL of the EventHub namespace for identity-based authentication. It must - * include the protocol sb://. + * include the protocol 'sb://'. * * @return the endpointUri value. */ @@ -102,7 +102,7 @@ public String endpointUri() { /** * Set the endpointUri property: The URL of the EventHub namespace for identity-based authentication. It must - * include the protocol sb://. + * include the protocol 'sb://'. * * @param endpointUri the endpointUri value to set. * @return the EventHub object itself. diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ExternalResource.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ExternalResource.java index 0ea531feb1e2..432bd1835dce 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ExternalResource.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ExternalResource.java @@ -6,14 +6,31 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; /** Definition of a resource. */ @Immutable public class ExternalResource extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ExternalResource.class); + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Validates the instance. * diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/GroupIdInformation.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/GroupIdInformation.java index 5e04b2b5220c..9e2c41bba057 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/GroupIdInformation.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/GroupIdInformation.java @@ -9,7 +9,7 @@ /** An immutable client-side representation of GroupIdInformation. */ public interface GroupIdInformation { /** - * Gets the properties property: The properties for a group information object. + * Gets the properties property: The group information properties. * * @return the properties value. */ diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/GroupIdInformationProperties.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/GroupIdInformationProperties.java index ed94b1594b29..443ae25d3a66 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/GroupIdInformationProperties.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/GroupIdInformationProperties.java @@ -12,11 +12,11 @@ /** The properties for a group information object. */ @Fluent -public class GroupIdInformationProperties { +public final class GroupIdInformationProperties { @JsonIgnore private final ClientLogger logger = new ClientLogger(GroupIdInformationProperties.class); /* - * The group id + * The group id. */ @JsonProperty(value = "groupId") private String groupId; diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/Operation.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/Operation.java index 16f2556dfc29..872201adc2d2 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/Operation.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/Operation.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.digitaltwins.models; import com.azure.resourcemanager.digitaltwins.fluent.models.OperationInner; +import java.util.Map; /** An immutable client-side representation of Operation. */ public interface Operation { @@ -36,6 +37,13 @@ public interface Operation { */ Boolean isDataAction(); + /** + * Gets the properties property: Operation properties. + * + * @return the properties value. + */ + Map properties(); + /** * Gets the inner com.azure.resourcemanager.digitaltwins.fluent.models.OperationInner object. * diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/OperationDisplay.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/OperationDisplay.java index bf938dbac9ca..740e481288c1 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/OperationDisplay.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/OperationDisplay.java @@ -15,25 +15,25 @@ public final class OperationDisplay { @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); /* - * Service provider: Microsoft DigitalTwins + * Service provider: Microsoft DigitalTwins. */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * Resource Type: DigitalTwinsInstances + * Resource Type: DigitalTwinsInstances. */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * Name of the operation + * Name of the operation. */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * Friendly description for the operation, + * Friendly description for the operation. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; @@ -66,7 +66,7 @@ public String operation() { } /** - * Get the description property: Friendly description for the operation,. + * Get the description property: Friendly description for the operation. * * @return the description value. */ diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/Operations.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/Operations.java index 198f04c00fbe..62338d73a205 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/Operations.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/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 DigitalTwins service operations. + * @return a list of DigitalTwins service 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 DigitalTwins service operations. + * @return a list of DigitalTwins service operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpoint.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpoint.java index b51ab19335b7..127c84606921 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpoint.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpoint.java @@ -11,7 +11,7 @@ /** The private endpoint property of a private endpoint connection. */ @Immutable -public class PrivateEndpoint { +public final class PrivateEndpoint { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); /* diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnection.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnection.java index 5e9b88d1e94d..6ba3ba727b05 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnection.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnection.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.digitaltwins.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionInner; @@ -31,12 +32,20 @@ public interface PrivateEndpointConnection { String type(); /** - * Gets the properties property: The properties of a private endpoint connection. + * Gets the properties property: The connection properties. * * @return the properties value. */ ConnectionProperties properties(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the private endpoint + * connection. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the inner com.azure.resourcemanager.digitaltwins.fluent.models.PrivateEndpointConnectionInner object. * @@ -70,9 +79,9 @@ interface WithParentResource { /** The stage of the PrivateEndpointConnection definition allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: The properties of a private endpoint connection.. + * Specifies the properties property: The connection properties.. * - * @param properties The properties of a private endpoint connection. + * @param properties The connection properties. * @return the next definition stage. */ WithCreate withProperties(ConnectionProperties properties); @@ -127,9 +136,9 @@ interface UpdateStages { /** The stage of the PrivateEndpointConnection update allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: The properties of a private endpoint connection.. + * Specifies the properties property: The connection properties.. * - * @param properties The properties of a private endpoint connection. + * @param properties The connection properties. * @return the next definition stage. */ Update withProperties(ConnectionProperties properties); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnectionProperties.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnectionProperties.java deleted file mode 100644 index 77e388ec2e4f..000000000000 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnectionProperties.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.digitaltwins.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import java.util.List; - -/** The PrivateEndpointConnectionProperties model. */ -@Immutable -public final class PrivateEndpointConnectionProperties extends ConnectionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); - - /** {@inheritDoc} */ - @Override - public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - super.withPrivateEndpoint(privateEndpoint); - return this; - } - - /** {@inheritDoc} */ - @Override - public PrivateEndpointConnectionProperties withGroupIds(List groupIds) { - super.withGroupIds(groupIds); - return this; - } - - /** {@inheritDoc} */ - @Override - public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( - ConnectionState privateLinkServiceConnectionState) { - super.withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnections.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnections.java index 53c8d70442fe..7d76233603bc 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnections.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateEndpointConnections.java @@ -30,7 +30,7 @@ public interface PrivateEndpointConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link connections for a Digital Twin. + * @return the available private link connections for a Digital Twin along with {@link Response}. */ Response listWithResponse( String resourceGroupName, String resourceName, Context context); @@ -58,7 +58,7 @@ Response listWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties for the given private endpoint. + * @return private endpoint connection properties for the given private endpoint along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); @@ -95,7 +95,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties for the given private endpoint. + * @return private endpoint connection properties for the given private endpoint along with {@link Response}. */ PrivateEndpointConnection getById(String id); @@ -107,7 +107,7 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties for the given private endpoint. + * @return private endpoint connection properties for the given private endpoint along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateLinkResources.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateLinkResources.java index 3cc7839ff6e2..90d09bde973b 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateLinkResources.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/PrivateLinkResources.java @@ -30,7 +30,7 @@ public interface PrivateLinkResources { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for a Digital Twin. + * @return the available private link resources for a Digital Twin along with {@link Response}. */ Response listWithResponse( String resourceGroupName, String resourceName, Context context); @@ -58,7 +58,7 @@ Response listWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given Digital Twin. + * @return the specified private link resource for the given Digital Twin along with {@link Response}. */ Response getWithResponse( String resourceGroupName, String resourceName, String resourceId, Context context); diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ServiceBus.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ServiceBus.java index 07b901058e7e..42f3f91da533 100644 --- a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ServiceBus.java +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/ServiceBus.java @@ -34,13 +34,13 @@ public final class ServiceBus extends DigitalTwinsEndpointResourceProperties { /* * The URL of the ServiceBus namespace for identity-based authentication. - * It must include the protocol sb:// + * It must include the protocol 'sb://'. */ @JsonProperty(value = "endpointUri") private String endpointUri; /* - * The ServiceBus Topic name for identity-based authentication + * The ServiceBus Topic name for identity-based authentication. */ @JsonProperty(value = "entityPath") private String entityPath; @@ -91,7 +91,7 @@ public ServiceBus withSecondaryConnectionString(String secondaryConnectionString /** * Get the endpointUri property: The URL of the ServiceBus namespace for identity-based authentication. It must - * include the protocol sb://. + * include the protocol 'sb://'. * * @return the endpointUri value. */ @@ -101,7 +101,7 @@ public String endpointUri() { /** * Set the endpointUri property: The URL of the ServiceBus namespace for identity-based authentication. It must - * include the protocol sb://. + * include the protocol 'sb://'. * * @param endpointUri the endpointUri value to set. * @return the ServiceBus object itself. diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnection.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnection.java new file mode 100644 index 000000000000..21f3499b086e --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnection.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.digitaltwins.fluent.models.TimeSeriesDatabaseConnectionInner; + +/** An immutable client-side representation of TimeSeriesDatabaseConnection. */ +public interface TimeSeriesDatabaseConnection { + /** + * 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: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the properties property: Properties of a specific time series database connection. + * + * @return the properties value. + */ + TimeSeriesDatabaseConnectionProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.digitaltwins.fluent.models.TimeSeriesDatabaseConnectionInner object. + * + * @return the inner object. + */ + TimeSeriesDatabaseConnectionInner innerModel(); + + /** The entirety of the TimeSeriesDatabaseConnection definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The TimeSeriesDatabaseConnection definition stages. */ + interface DefinitionStages { + /** The first stage of the TimeSeriesDatabaseConnection definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the TimeSeriesDatabaseConnection definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, resourceName. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @return the next definition stage. + */ + WithCreate withExistingDigitalTwinsInstance(String resourceGroupName, String resourceName); + } + /** + * The stage of the TimeSeriesDatabaseConnection 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + TimeSeriesDatabaseConnection create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + TimeSeriesDatabaseConnection create(Context context); + } + /** The stage of the TimeSeriesDatabaseConnection definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of a specific time series database connection.. + * + * @param properties Properties of a specific time series database connection. + * @return the next definition stage. + */ + WithCreate withProperties(TimeSeriesDatabaseConnectionProperties properties); + } + } + /** + * Begins update for the TimeSeriesDatabaseConnection resource. + * + * @return the stage of resource update. + */ + TimeSeriesDatabaseConnection.Update update(); + + /** The template for TimeSeriesDatabaseConnection update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + TimeSeriesDatabaseConnection apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + TimeSeriesDatabaseConnection apply(Context context); + } + /** The TimeSeriesDatabaseConnection update stages. */ + interface UpdateStages { + /** The stage of the TimeSeriesDatabaseConnection update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Properties of a specific time series database connection.. + * + * @param properties Properties of a specific time series database connection. + * @return the next definition stage. + */ + Update withProperties(TimeSeriesDatabaseConnectionProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + TimeSeriesDatabaseConnection refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + TimeSeriesDatabaseConnection refresh(Context context); +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionListResult.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionListResult.java new file mode 100644 index 000000000000..392794c347b7 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionListResult.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.digitaltwins.fluent.models.TimeSeriesDatabaseConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A pageable list of time series database connection resources. */ +@Fluent +public final class TimeSeriesDatabaseConnectionListResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSeriesDatabaseConnectionListResult.class); + + /* + * The link used to get the next page of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /* + * A list of time series database connection resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the nextLink property: The link used to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the TimeSeriesDatabaseConnectionListResult object itself. + */ + public TimeSeriesDatabaseConnectionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the value property: A list of time series database connection resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: A list of time series database connection resources. + * + * @param value the value value to set. + * @return the TimeSeriesDatabaseConnectionListResult object itself. + */ + public TimeSeriesDatabaseConnectionListResult 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/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionProperties.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionProperties.java new file mode 100644 index 000000000000..18e7e66ace29 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionProperties.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** Properties of a time series database connection resource. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "connectionType", + defaultImpl = TimeSeriesDatabaseConnectionProperties.class) +@JsonTypeName("TimeSeriesDatabaseConnectionProperties") +@JsonSubTypes({@JsonSubTypes.Type(name = "AzureDataExplorer", value = AzureDataExplorerConnectionProperties.class)}) +@Immutable +public class TimeSeriesDatabaseConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TimeSeriesDatabaseConnectionProperties.class); + + /* + * The provisioning state. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private TimeSeriesDatabaseConnectionState provisioningState; + + /** + * Get the provisioningState property: The provisioning state. + * + * @return the provisioningState value. + */ + public TimeSeriesDatabaseConnectionState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionState.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionState.java new file mode 100644 index 000000000000..0b4e9ef7eec2 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnectionState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for TimeSeriesDatabaseConnectionState. */ +public final class TimeSeriesDatabaseConnectionState extends ExpandableStringEnum { + /** Static value Provisioning for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState PROVISIONING = fromString("Provisioning"); + + /** Static value Deleting for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState DELETING = fromString("Deleting"); + + /** Static value Succeeded for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState FAILED = fromString("Failed"); + + /** Static value Canceled for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState CANCELED = fromString("Canceled"); + + /** Static value Deleted for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState DELETED = fromString("Deleted"); + + /** Static value Warning for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState WARNING = fromString("Warning"); + + /** Static value Suspending for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState SUSPENDING = fromString("Suspending"); + + /** Static value Restoring for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState RESTORING = fromString("Restoring"); + + /** Static value Moving for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState MOVING = fromString("Moving"); + + /** Static value Disabled for TimeSeriesDatabaseConnectionState. */ + public static final TimeSeriesDatabaseConnectionState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a TimeSeriesDatabaseConnectionState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeSeriesDatabaseConnectionState. + */ + @JsonCreator + public static TimeSeriesDatabaseConnectionState fromString(String name) { + return fromString(name, TimeSeriesDatabaseConnectionState.class); + } + + /** @return known TimeSeriesDatabaseConnectionState values. */ + public static Collection values() { + return values(TimeSeriesDatabaseConnectionState.class); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnections.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnections.java new file mode 100644 index 000000000000..f1139b2c756c --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/main/java/com/azure/resourcemanager/digitaltwins/models/TimeSeriesDatabaseConnections.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.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 TimeSeriesDatabaseConnections. */ +public interface TimeSeriesDatabaseConnections { + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 existing time series database connections for this DigitalTwins instance as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Get all existing time series database connections for this DigitalTwins instance. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @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 existing time series database connections for this DigitalTwins instance as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the description of an existing time series database connection. + */ + TimeSeriesDatabaseConnection get( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName); + + /** + * Get the description of an existing time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 description of an existing time series database connection along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context); + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return describes a time series database connection resource. + */ + TimeSeriesDatabaseConnection delete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName); + + /** + * Delete a time series database connection. + * + * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance. + * @param resourceName The name of the DigitalTwinsInstance. + * @param timeSeriesDatabaseConnectionName Name of time series database connection. + * @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 describes a time series database connection resource. + */ + TimeSeriesDatabaseConnection delete( + String resourceGroupName, String resourceName, String timeSeriesDatabaseConnectionName, Context context); + + /** + * Get the description of an existing time series database connection. + * + * @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 description of an existing time series database connection along with {@link Response}. + */ + TimeSeriesDatabaseConnection getById(String id); + + /** + * Get the description of an existing time series database connection. + * + * @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 description of an existing time series database connection along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a time series database connection. + * + * @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 describes a time series database connection resource. + */ + TimeSeriesDatabaseConnection deleteById(String id); + + /** + * Delete a time series database connection. + * + * @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 describes a time series database connection resource. + */ + TimeSeriesDatabaseConnection deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new TimeSeriesDatabaseConnection resource. + * + * @param name resource name. + * @return the first stage of the new TimeSeriesDatabaseConnection definition. + */ + TimeSeriesDatabaseConnection.DefinitionStages.Blank define(String name); +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsCheckNameAvailabilitySamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsCheckNameAvailabilitySamples.java new file mode 100644 index 000000000000..c3145541f7ab --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsCheckNameAvailabilitySamples.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.digitaltwins.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.digitaltwins.models.CheckNameRequest; + +/** Samples for DigitalTwins CheckNameAvailability. */ +public final class DigitalTwinsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsCheckNameAvailability_example.json + */ + /** + * Sample code: Check name Availability. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void checkNameAvailability(com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwins() + .checkNameAvailabilityWithResponse( + "WestUS2", new CheckNameRequest().withName("myadtinstance"), Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsCreateOrUpdateSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f778c452028f --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsCreateOrUpdateSamples.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.digitaltwins.generated; + +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentity; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentityType; +import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess; + +/** Samples for DigitalTwins CreateOrUpdate. */ +public final class DigitalTwinsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPut_example.json + */ + /** + * Sample code: Put a DigitalTwinsInstance resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsInstanceResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwins() + .define("myDigitalTwinsService") + .withRegion("WestUS2") + .withExistingResourceGroup("resRg") + .create(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPut_WithPublicNetworkAccess.json + */ + /** + * Sample code: Put a DigitalTwinsInstance resource with publicNetworkAccess property. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwins() + .define("myDigitalTwinsService") + .withRegion("WestUS2") + .withExistingResourceGroup("resRg") + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .create(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPut_WithIdentity_example.json + */ + /** + * Sample code: Put a DigitalTwinsInstance resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsInstanceResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwins() + .define("myDigitalTwinsService") + .withRegion("WestUS2") + .withExistingResourceGroup("resRg") + .withIdentity(new DigitalTwinsIdentity().withType(DigitalTwinsIdentityType.SYSTEM_ASSIGNED)) + .create(); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsDeleteSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsDeleteSamples.java new file mode 100644 index 000000000000..a40a1ea4ad5f --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsDeleteSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for DigitalTwins Delete. */ +public final class DigitalTwinsDeleteSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsDelete_example.json + */ + /** + * Sample code: Delete a DigitalTwinsInstance resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteADigitalTwinsInstanceResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().delete("resRg", "myDigitalTwinsService", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsDelete_WithIdentity_example.json + */ + /** + * Sample code: Delete a DigitalTwinsInstance resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteADigitalTwinsInstanceResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().delete("resRg", "myDigitalTwinsService", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointCreateOrUpdateSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6e7883fc2972 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointCreateOrUpdateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.resourcemanager.digitaltwins.models.AuthenticationType; +import com.azure.resourcemanager.digitaltwins.models.ServiceBus; + +/** Samples for DigitalTwinsEndpoint CreateOrUpdate. */ +public final class DigitalTwinsEndpointCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointPut_example.json + */ + /** + * Sample code: Put a DigitalTwinsEndpoint resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsEndpointResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwinsEndpoints() + .define("myServiceBus") + .withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService") + .withProperties( + new ServiceBus() + .withAuthenticationType(AuthenticationType.KEY_BASED) + .withPrimaryConnectionString( + "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc") + .withSecondaryConnectionString( + "Endpoint=sb://mysb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xyzxyzoX4=;EntityPath=abcabc")) + .create(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointPut_WithIdentity_example.json + */ + /** + * Sample code: Put a DigitalTwinsEndpoint resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void putADigitalTwinsEndpointResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .digitalTwinsEndpoints() + .define("myServiceBus") + .withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService") + .withProperties( + new ServiceBus() + .withAuthenticationType(AuthenticationType.IDENTITY_BASED) + .withEndpointUri("sb://mysb.servicebus.windows.net/") + .withEntityPath("mysbtopic")) + .create(); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointDeleteSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointDeleteSamples.java new file mode 100644 index 000000000000..0e348eaf7142 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointDeleteSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for DigitalTwinsEndpoint Delete. */ +public final class DigitalTwinsEndpointDeleteSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointDelete_example.json + */ + /** + * Sample code: Delete a DigitalTwinsInstance endpoint. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteADigitalTwinsInstanceEndpoint( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().delete("resRg", "myDigitalTwinsService", "myendpoint", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointDelete_WithIdentity_example.json + */ + /** + * Sample code: Delete a DigitalTwinsInstance endpoint with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteADigitalTwinsInstanceEndpointWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().delete("resRg", "myDigitalTwinsService", "myendpoint", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointGetSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointGetSamples.java new file mode 100644 index 000000000000..a1e3312500b8 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointGetSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for DigitalTwinsEndpoint Get. */ +public final class DigitalTwinsEndpointGetSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointGet_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance endpoint. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceEndpoint( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().getWithResponse("resRg", "myDigitalTwinsService", "myServiceBus", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointGet_WithIdentity_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance endpoint with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceEndpointWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().getWithResponse("resRg", "myDigitalTwinsService", "myServiceBus", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointListSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointListSamples.java new file mode 100644 index 000000000000..3df9a6e18046 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsEndpointListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for DigitalTwinsEndpoint List. */ +public final class DigitalTwinsEndpointListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointsGet_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance endpoints. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceEndpoints( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().list("resRg", "myDigitalTwinsService", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsEndpointsGet_WithIdentity_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance endpoints with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceEndpointsWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwinsEndpoints().list("resRg", "myDigitalTwinsService", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsGetByResourceGroupSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..1bfa0f0ce34c --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsGetByResourceGroupSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for DigitalTwins GetByResourceGroup. */ +public final class DigitalTwinsGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsGet_WithIdentity_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsGet_WithPrivateEndpointConnection_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance resource with a private endpoint connection. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceResourceWithAPrivateEndpointConnection( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsGet_example.json + */ + /** + * Sample code: Get a DigitalTwinsInstance resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getADigitalTwinsInstanceResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsListByResourceGroupSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsListByResourceGroupSamples.java new file mode 100644 index 000000000000..b5e4afd6625e --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for DigitalTwins ListByResourceGroup. */ +public final class DigitalTwinsListByResourceGroupSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsListByResourceGroup_example.json + */ + /** + * Sample code: Get DigitalTwinsInstance resources by resource group. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getDigitalTwinsInstanceResourcesByResourceGroup( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().listByResourceGroup("resRg", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsListSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsListSamples.java new file mode 100644 index 000000000000..e8852ae9b2f4 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for DigitalTwins List. */ +public final class DigitalTwinsListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsList_example.json + */ + /** + * Sample code: Get DigitalTwinsInstance resources by subscription. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getDigitalTwinsInstanceResourcesBySubscription( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.digitalTwins().list(Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsUpdateSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsUpdateSamples.java new file mode 100644 index 000000000000..e9d7555b5652 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/DigitalTwinsUpdateSamples.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsDescription; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentity; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsIdentityType; +import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsPatchProperties; +import com.azure.resourcemanager.digitaltwins.models.PublicNetworkAccess; +import java.util.HashMap; +import java.util.Map; + +/** Samples for DigitalTwins Update. */ +public final class DigitalTwinsUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPatch_example.json + */ + /** + * Sample code: Patch a DigitalTwinsInstance resource. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void patchADigitalTwinsInstanceResource( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + DigitalTwinsDescription resource = + manager + .digitalTwins() + .getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("purpose", "dev")).apply(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPatch_WithPublicNetworkAccess.json + */ + /** + * Sample code: Patch a DigitalTwinsInstance resource with publicNetworkAccess property. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void patchADigitalTwinsInstanceResourceWithPublicNetworkAccessProperty( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + DigitalTwinsDescription resource = + manager + .digitalTwins() + .getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE) + .getValue(); + resource + .update() + .withProperties(new DigitalTwinsPatchProperties().withPublicNetworkAccess(PublicNetworkAccess.DISABLED)) + .apply(); + } + + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsPatch_WithIdentity_example.json + */ + /** + * Sample code: Patch a DigitalTwinsInstance resource with identity. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void patchADigitalTwinsInstanceResourceWithIdentity( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + DigitalTwinsDescription resource = + manager + .digitalTwins() + .getByResourceGroupWithResponse("resRg", "myDigitalTwinsService", Context.NONE) + .getValue(); + resource.update().withIdentity(new DigitalTwinsIdentity().withType(DigitalTwinsIdentityType.NONE)).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/OperationsListSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/OperationsListSamples.java new file mode 100644 index 000000000000..40b20af3c87d --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/DigitalTwinsOperationsList_example.json + */ + /** + * Sample code: Get available operations. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getAvailableOperations(com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3dc6af1d052c --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.digitaltwins.models.ConnectionProperties; +import com.azure.resourcemanager.digitaltwins.models.ConnectionPropertiesPrivateLinkServiceConnectionState; +import com.azure.resourcemanager.digitaltwins.models.PrivateEndpointConnection; +import com.azure.resourcemanager.digitaltwins.models.PrivateLinkServiceConnectionStatus; + +/** Samples for PrivateEndpointConnections CreateOrUpdate. */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateEndpointConnectionPut_example.json + */ + /** + * Sample code: Update the status of a private endpoint connection with the given name. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void updateTheStatusOfAPrivateEndpointConnectionWithTheGivenName( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + PrivateEndpointConnection resource = + manager + .privateEndpointConnections() + .getWithResponse("resRg", "myDigitalTwinsService", "myPrivateConnection", Context.NONE) + .getValue(); + resource + .update() + .withProperties( + new ConnectionProperties() + .withPrivateLinkServiceConnectionState( + new ConnectionPropertiesPrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@company.com."))) + .apply(); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..cdd8d523fa07 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/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.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateEndpointConnectionDelete_example.json + */ + /** + * Sample code: Delete private endpoint connection with the specified name. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deletePrivateEndpointConnectionWithTheSpecifiedName( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .privateEndpointConnections() + .delete("resRg", "myDigitalTwinsService", "myPrivateConnection", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..52266795a935 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsGetSamples.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.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateEndpointConnectionByConnectionName_example.json + */ + /** + * Sample code: Get private endpoint connection properties for the given private endpoint. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getPrivateEndpointConnectionPropertiesForTheGivenPrivateEndpoint( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("resRg", "myDigitalTwinsService", "myPrivateConnection", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsListSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..32f8796328f9 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateEndpointConnectionsList_example.json + */ + /** + * Sample code: List private endpoint connection properties. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void listPrivateEndpointConnectionProperties( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.privateEndpointConnections().listWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateLinkResourcesGetSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..7d8dae16e513 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources Get. */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateLinkResourcesByGroupId_example.json + */ + /** + * Sample code: Get the specified private link resource for the given Digital Twin. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getTheSpecifiedPrivateLinkResourceForTheGivenDigitalTwin( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.privateLinkResources().getWithResponse("resRg", "myDigitalTwinsService", "subResource", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateLinkResourcesListSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateLinkResourcesListSamples.java new file mode 100644 index 000000000000..4020945e2a38 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/PrivateLinkResourcesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResources List. */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/PrivateLinkResourcesList_example.json + */ + /** + * Sample code: List private link resources for given Digital Twin. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void listPrivateLinkResourcesForGivenDigitalTwin( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.privateLinkResources().listWithResponse("resRg", "myDigitalTwinsService", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsCreateOrUpdateSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f6e7977c8365 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsCreateOrUpdateSamples.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.digitaltwins.generated; + +import com.azure.resourcemanager.digitaltwins.models.AzureDataExplorerConnectionProperties; + +/** Samples for TimeSeriesDatabaseConnections CreateOrUpdate. */ +public final class TimeSeriesDatabaseConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/TimeSeriesDatabaseConnectionsPut_example.json + */ + /** + * Sample code: Create or replace a time series database connection for a DigitalTwins instance. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void createOrReplaceATimeSeriesDatabaseConnectionForADigitalTwinsInstance( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .timeSeriesDatabaseConnections() + .define("myConnection") + .withExistingDigitalTwinsInstance("resRg", "myDigitalTwinsService") + .withProperties( + new AzureDataExplorerConnectionProperties() + .withAdxResourceId( + "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.Kusto/clusters/mycluster") + .withAdxEndpointUri("https://mycluster.kusto.windows.net") + .withAdxDatabaseName("myDatabase") + .withAdxTableName("myTable") + .withEventHubEndpointUri("sb://myeh.servicebus.windows.net/") + .withEventHubEntityPath("myeh") + .withEventHubNamespaceResourceId( + "/subscriptions/c493073e-2460-45ba-a403-f3e0df1e9feg/resourceGroups/testrg/providers/Microsoft.EventHub/namespaces/myeh")) + .create(); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsDeleteSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsDeleteSamples.java new file mode 100644 index 000000000000..de51abf94de3 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for TimeSeriesDatabaseConnections Delete. */ +public final class TimeSeriesDatabaseConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/TimeSeriesDatabaseConnectionsDelete_example.json + */ + /** + * Sample code: Delete a time series database connection for a DigitalTwins instance. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void deleteATimeSeriesDatabaseConnectionForADigitalTwinsInstance( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.timeSeriesDatabaseConnections().delete("resRg", "myDigitalTwinsService", "myConnection", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsGetSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsGetSamples.java new file mode 100644 index 000000000000..f140ffef4078 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsGetSamples.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.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for TimeSeriesDatabaseConnections Get. */ +public final class TimeSeriesDatabaseConnectionsGetSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/TimeSeriesDatabaseConnectionsGet_example.json + */ + /** + * Sample code: Get time series database connection for a DigitalTwins instance. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void getTimeSeriesDatabaseConnectionForADigitalTwinsInstance( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager + .timeSeriesDatabaseConnections() + .getWithResponse("resRg", "myDigitalTwinsService", "myConnection", Context.NONE); + } +} diff --git a/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsListSamples.java b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsListSamples.java new file mode 100644 index 000000000000..69490c8f6751 --- /dev/null +++ b/sdk/digitaltwins/azure-resourcemanager-digitaltwins/src/samples/java/com/azure/resourcemanager/digitaltwins/generated/TimeSeriesDatabaseConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.digitaltwins.generated; + +import com.azure.core.util.Context; + +/** Samples for TimeSeriesDatabaseConnections List. */ +public final class TimeSeriesDatabaseConnectionsListSamples { + /* + * x-ms-original-file: specification/digitaltwins/resource-manager/Microsoft.DigitalTwins/preview/2021-06-30-preview/examples/TimeSeriesDatabaseConnectionsList_example.json + */ + /** + * Sample code: List time series database connections for a DigitalTwins instance. + * + * @param manager Entry point to AzureDigitalTwinsManager. + */ + public static void listTimeSeriesDatabaseConnectionsForADigitalTwinsInstance( + com.azure.resourcemanager.digitaltwins.AzureDigitalTwinsManager manager) { + manager.timeSeriesDatabaseConnections().list("resRg", "myDigitalTwinsService", Context.NONE); + } +}