From 05eb6a652d7015fcbc306fc73a38b3d26ef81eef Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 19 Jan 2022 03:40:29 +0000 Subject: [PATCH] CodeGen from PR 17328 in Azure/azure-rest-api-specs Merge 08897b1834ca6442a2f757da3edb9c109ea02cc2 into 1b0a465061c68175898f8f5d27f0301f42ce994c --- .../CHANGELOG.md | 3 +- .../README.md | 7 +- .../SAMPLE.md | 686 ++++++++++++++++++ .../pom.xml | 2 +- .../IotDpsManager.java | 39 +- .../fluent/DpsCertificatesClient.java | 12 +- .../fluent/IotDpsResourcesClient.java | 66 +- .../models/CertificateResponseInner.java | 16 + .../PrivateEndpointConnectionInner.java | 16 + .../ProvisioningServiceDescriptionInner.java | 16 + .../CertificateResponseImpl.java | 15 + .../DpsCertificatesClientImpl.java | 64 +- .../implementation/DpsCertificatesImpl.java | 3 +- .../implementation/IotDpsClientImpl.java | 2 +- .../IotDpsResourcesClientImpl.java | 279 ++++--- .../implementation/OperationsClientImpl.java | 12 +- .../PrivateEndpointConnectionImpl.java | 5 + .../ProvisioningServiceDescriptionImpl.java | 5 + .../models/CertificateBodyDescription.java | 29 + .../models/CertificateResponse.java | 37 +- .../models/DpsCertificates.java | 16 +- .../models/IotDpsPropertiesDescription.java | 30 + .../models/IotDpsResources.java | 25 +- .../models/PrivateEndpointConnection.java | 8 + .../ProvisioningServiceDescription.java | 8 + .../models/TagsResource.java | 2 + .../AllocationPolicyTests.java | 80 -- .../CertificatesTests.java | 98 --- .../deviceprovisioningservices/Constants.java | 48 -- ...ceProvisioningResourceManagementTests.java | 150 ---- .../DeviceProvisioningTestBase.java | 98 --- .../LinkedHubTests.java | 82 --- .../SharedAccessPolicyTests.java | 117 --- .../DpsCertificateCreateOrUpdateSamples.java | 26 + .../DpsCertificateDeleteSamples.java | 38 + ...ficateGenerateVerificationCodeSamples.java | 38 + .../generated/DpsCertificateGetSamples.java | 24 + .../generated/DpsCertificateListSamples.java | 22 + ...psCertificateVerifyCertificateSamples.java | 40 + ...sioningServiceNameAvailabilitySamples.java | 26 + ...pdatePrivateEndpointConnectionSamples.java | 35 + .../IotDpsResourceCreateOrUpdateSamples.java | 45 ++ ...eletePrivateEndpointConnectionSamples.java | 26 + .../IotDpsResourceDeleteSamples.java | 22 + ...tDpsResourceGetByResourceGroupSamples.java | 24 + ...tDpsResourceGetOperationResultSamples.java | 30 + ...ceGetPrivateEndpointConnectionSamples.java | 26 + ...esourceGetPrivateLinkResourcesSamples.java | 26 + ...DpsResourceListByResourceGroupSamples.java | 23 + ...tDpsResourceListKeysForKeyNameSamples.java | 24 + .../IotDpsResourceListKeysSamples.java | 22 + ...ListPrivateEndpointConnectionsSamples.java | 25 + ...sourceListPrivateLinkResourcesSamples.java | 25 + .../generated/IotDpsResourceListSamples.java | 23 + .../IotDpsResourceListValidSkusSamples.java | 22 + .../IotDpsResourceUpdateSamples.java | 41 ++ .../generated/OperationsListSamples.java | 22 + 57 files changed, 1861 insertions(+), 890 deletions(-) create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/SAMPLE.md delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/AllocationPolicyTests.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/CertificatesTests.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/Constants.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/DeviceProvisioningResourceManagementTests.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/DeviceProvisioningTestBase.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/LinkedHubTests.java delete mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/SharedAccessPolicyTests.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateCreateOrUpdateSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateDeleteSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateGenerateVerificationCodeSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateGetSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateListSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateVerifyCertificateSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilitySamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnectionSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdateSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeleteSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetByResourceGroupSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetOperationResultSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetPrivateEndpointConnectionSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetPrivateLinkResourcesSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListByResourceGroupSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListKeysForKeyNameSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListKeysSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListPrivateEndpointConnectionsSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListPrivateLinkResourcesSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListValidSkusSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceUpdateSamples.java create mode 100644 sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/OperationsListSamples.java diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/CHANGELOG.md b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/CHANGELOG.md index 1396cce76b75..2ce1bd2f81ec 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/CHANGELOG.md +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2022-01-19) +- Azure Resource Manager IotDps client library for Java. This package contains Microsoft Azure SDK for IotDps Management SDK. API for using the Azure IoT Hub Device Provisioning Service features. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0 (2021-05-28) diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/README.md b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/README.md index 11e32eef4807..991fd5ebc064 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/README.md +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/README.md @@ -2,7 +2,7 @@ Azure Resource Manager IotDps client library for Java. -This package contains Microsoft Azure SDK for IotDps Management SDK. API for using the Azure IoT Hub Device Provisioning Service features. Package tag package-2020-03. 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 IotDps Management SDK. API for using the Azure IoT Hub Device Provisioning Service features. Package tag package-2021-10. 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 @@ -17,7 +17,6 @@ Thank you in advance for your collaboration. We really appreciate your time! Various documentation is available to help you get started - [API reference documentation][docs] -- [Service documentation][service_docs] ## Getting started @@ -33,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-deviceprovisioningservices - 1.0.0 + 1.1.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -75,6 +74,7 @@ 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/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/SAMPLE.md) ## Troubleshooting @@ -100,4 +100,3 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md -[service_docs]: https://docs.microsoft.com/azure/iot-dps diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/SAMPLE.md b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/SAMPLE.md new file mode 100644 index 000000000000..f2385f6b5bc6 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/SAMPLE.md @@ -0,0 +1,686 @@ +# Code snippets and samples + + +## DpsCertificate + +- [CreateOrUpdate](#dpscertificate_createorupdate) +- [Delete](#dpscertificate_delete) +- [GenerateVerificationCode](#dpscertificate_generateverificationcode) +- [Get](#dpscertificate_get) +- [List](#dpscertificate_list) +- [VerifyCertificate](#dpscertificate_verifycertificate) + +## IotDpsResource + +- [CheckProvisioningServiceNameAvailability](#iotdpsresource_checkprovisioningservicenameavailability) +- [CreateOrUpdate](#iotdpsresource_createorupdate) +- [CreateOrUpdatePrivateEndpointConnection](#iotdpsresource_createorupdateprivateendpointconnection) +- [Delete](#iotdpsresource_delete) +- [DeletePrivateEndpointConnection](#iotdpsresource_deleteprivateendpointconnection) +- [GetByResourceGroup](#iotdpsresource_getbyresourcegroup) +- [GetOperationResult](#iotdpsresource_getoperationresult) +- [GetPrivateEndpointConnection](#iotdpsresource_getprivateendpointconnection) +- [GetPrivateLinkResources](#iotdpsresource_getprivatelinkresources) +- [List](#iotdpsresource_list) +- [ListByResourceGroup](#iotdpsresource_listbyresourcegroup) +- [ListKeys](#iotdpsresource_listkeys) +- [ListKeysForKeyName](#iotdpsresource_listkeysforkeyname) +- [ListPrivateEndpointConnections](#iotdpsresource_listprivateendpointconnections) +- [ListPrivateLinkResources](#iotdpsresource_listprivatelinkresources) +- [ListValidSkus](#iotdpsresource_listvalidskus) +- [Update](#iotdpsresource_update) + +## Operations + +- [List](#operations_list) +### DpsCertificate_CreateOrUpdate + +```java +/** Samples for DpsCertificate CreateOrUpdate. */ +public final class DpsCertificateCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCertificateCreateOrUpdate.json + */ + /** + * Sample code: DPSCreateOrUpdateCertificate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSCreateOrUpdateCertificate( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .define("cert") + .withExistingProvisioningService("myResourceGroup", "myFirstProvisioningService") + .withCertificate("############################################") + .create(); + } +} +``` + +### DpsCertificate_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for DpsCertificate Delete. */ +public final class DpsCertificateDeleteSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDeleteCertificate.json + */ + /** + * Sample code: DPSDeleteCertificate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSDeleteCertificate( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .deleteWithResponse( + "myResourceGroup", + "AAAAAAAADGk=", + "myFirstProvisioningService", + "cert", + null, + new byte[0], + null, + null, + null, + null, + null, + null, + Context.NONE); + } +} +``` + +### DpsCertificate_GenerateVerificationCode + +```java +import com.azure.core.util.Context; + +/** Samples for DpsCertificate GenerateVerificationCode. */ +public final class DpsCertificateGenerateVerificationCodeSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGenerateVerificationCode.json + */ + /** + * Sample code: DPSGenerateVerificationCode. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGenerateVerificationCode( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .generateVerificationCodeWithResponse( + "cert", + "AAAAAAAADGk=", + "myResourceGroup", + "myFirstProvisioningService", + null, + new byte[0], + null, + null, + null, + null, + null, + null, + Context.NONE); + } +} +``` + +### DpsCertificate_Get + +```java +import com.azure.core.util.Context; + +/** Samples for DpsCertificate Get. */ +public final class DpsCertificateGetSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetCertificate.json + */ + /** + * Sample code: DPSGetCertificate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetCertificate(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .getWithResponse("cert", "myResourceGroup", "myFirstProvisioningService", null, Context.NONE); + } +} +``` + +### DpsCertificate_List + +```java +import com.azure.core.util.Context; + +/** Samples for DpsCertificate List. */ +public final class DpsCertificateListSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetCertificates.json + */ + /** + * Sample code: DPSGetCertificates. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetCertificates(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.dpsCertificates().listWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} +``` + +### DpsCertificate_VerifyCertificate + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.deviceprovisioningservices.models.VerificationCodeRequest; + +/** Samples for DpsCertificate VerifyCertificate. */ +public final class DpsCertificateVerifyCertificateSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSVerifyCertificate.json + */ + /** + * Sample code: DPSVerifyCertificate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSVerifyCertificate( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .verifyCertificateWithResponse( + "cert", + "AAAAAAAADGk=", + "myResourceGroup", + "myFirstProvisioningService", + new VerificationCodeRequest().withCertificate("#####################################"), + null, + new byte[0], + null, + null, + null, + null, + null, + null, + Context.NONE); + } +} +``` + +### IotDpsResource_CheckProvisioningServiceNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.deviceprovisioningservices.models.OperationInputs; + +/** Samples for IotDpsResource CheckProvisioningServiceNameAvailability. */ +public final class IotDpsResourceCheckProvisioningServiceNameAvailabilitySamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCheckNameAvailability.json + */ + /** + * Sample code: DPSCheckName. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSCheckName(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .checkProvisioningServiceNameAvailabilityWithResponse( + new OperationInputs().withName("test213123"), Context.NONE); + } +} +``` + +### IotDpsResource_CreateOrUpdate + +```java +import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; +import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsSku; +import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsSkuInfo; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotDpsResource CreateOrUpdate. */ +public final class IotDpsResourceCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCreate.json + */ + /** + * Sample code: DPSCreate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSCreate(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .define("myFirstProvisioningService") + .withRegion("East US") + .withExistingResourceGroup("myResourceGroup") + .withProperties(new IotDpsPropertiesDescription().withEnableDataResidency(false)) + .withSku(new IotDpsSkuInfo().withName(IotDpsSku.S1).withCapacity(1L)) + .withTags(mapOf()) + .create(); + } + + @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; + } +} +``` + +### IotDpsResource_CreateOrUpdatePrivateEndpointConnection + +```java +import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateLinkServiceConnectionStatus; + +/** Samples for IotDpsResource CreateOrUpdatePrivateEndpointConnection. */ +public final class IotDpsResourceCreateOrUpdatePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCreateOrUpdatePrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_CreateOrUpdate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .definePrivateEndpointConnection("myPrivateEndpointConnection") + .withExistingProvisioningService("myResourceGroup", "myFirstProvisioningService") + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com"))) + .create(); + } +} +``` + +### IotDpsResource_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource Delete. */ +public final class IotDpsResourceDeleteSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDelete.json + */ + /** + * Sample code: DPSDelete. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSDelete(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().delete("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} +``` + +### IotDpsResource_DeletePrivateEndpointConnection + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource DeletePrivateEndpointConnection. */ +public final class IotDpsResourceDeletePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDeletePrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_Delete. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateEndpointConnectionDelete( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .deletePrivateEndpointConnection( + "myResourceGroup", "myFirstProvisioningService", "myPrivateEndpointConnection", Context.NONE); + } +} +``` + +### IotDpsResource_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource GetByResourceGroup. */ +public final class IotDpsResourceGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGet.json + */ + /** + * Sample code: DPSGet. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGet(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .getByResourceGroupWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} +``` + +### IotDpsResource_GetOperationResult + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource GetOperationResult. */ +public final class IotDpsResourceGetOperationResultSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetOperationResult.json + */ + /** + * Sample code: DPSGetOperationResult. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetOperationResult( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .getOperationResultWithResponse( + "MTY5OTNmZDctODI5Yy00N2E2LTkxNDQtMDU1NGIyYzY1ZjRl", + "myResourceGroup", + "myFirstProvisioningService", + "1508265712453", + Context.NONE); + } +} +``` + +### IotDpsResource_GetPrivateEndpointConnection + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource GetPrivateEndpointConnection. */ +public final class IotDpsResourceGetPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetPrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_Get. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateEndpointConnectionGet( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .getPrivateEndpointConnectionWithResponse( + "myResourceGroup", "myFirstProvisioningService", "myPrivateEndpointConnection", Context.NONE); + } +} +``` + +### IotDpsResource_GetPrivateLinkResources + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource GetPrivateLinkResources. */ +public final class IotDpsResourceGetPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetPrivateLinkResources.json + */ + /** + * Sample code: PrivateLinkResources_List. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateLinkResourcesList( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .getPrivateLinkResourcesWithResponse( + "myResourceGroup", "myFirstProvisioningService", "iotDps", Context.NONE); + } +} +``` + +### IotDpsResource_List + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource List. */ +public final class IotDpsResourceListSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListBySubscription.json + */ + /** + * Sample code: DPSListBySubscription. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSListBySubscription( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().list(Context.NONE); + } +} +``` + +### IotDpsResource_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListByResourceGroup. */ +public final class IotDpsResourceListByResourceGroupSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListByResourceGroup.json + */ + /** + * Sample code: DPSListByResourceGroup. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSListByResourceGroup( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().listByResourceGroup("myResourceGroup", Context.NONE); + } +} +``` + +### IotDpsResource_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListKeys. */ +public final class IotDpsResourceListKeysSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListKeys.json + */ + /** + * Sample code: DPSListKeys. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSListKeys(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().listKeys("myFirstProvisioningService", "myResourceGroup", Context.NONE); + } +} +``` + +### IotDpsResource_ListKeysForKeyName + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListKeysForKeyName. */ +public final class IotDpsResourceListKeysForKeyNameSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetKey.json + */ + /** + * Sample code: DPSGetKey. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetKey(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .listKeysForKeyNameWithResponse("myFirstProvisioningService", "testKey", "myResourceGroup", Context.NONE); + } +} +``` + +### IotDpsResource_ListPrivateEndpointConnections + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListPrivateEndpointConnections. */ +public final class IotDpsResourceListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListPrivateEndpointConnections.json + */ + /** + * Sample code: PrivateEndpointConnections_List. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateEndpointConnectionsList( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .listPrivateEndpointConnectionsWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} +``` + +### IotDpsResource_ListPrivateLinkResources + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListPrivateLinkResources. */ +public final class IotDpsResourceListPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListPrivateLinkResources.json + */ + /** + * Sample code: PrivateLinkResources_List. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateLinkResourcesList( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .listPrivateLinkResourcesWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} +``` + +### IotDpsResource_ListValidSkus + +```java +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListValidSkus. */ +public final class IotDpsResourceListValidSkusSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetValidSku.json + */ + /** + * Sample code: DPSGetValidSku. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetValidSku(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().listValidSkus("myFirstProvisioningService", "myResourceGroup", Context.NONE); + } +} +``` + +### IotDpsResource_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.deviceprovisioningservices.models.ProvisioningServiceDescription; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotDpsResource Update. */ +public final class IotDpsResourceUpdateSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSPatch.json + */ + /** + * Sample code: DPSPatch. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSPatch(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + ProvisioningServiceDescription resource = + manager + .iotDpsResources() + .getByResourceGroupWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("foo", "bar")).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; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSOperations.json + */ + /** + * Sample code: DPSOperations. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSOperations(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/pom.xml b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/pom.xml index 58c55a284fcf..f9bee3bad7ae 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/pom.xml +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for IotDps Management - This package contains Microsoft Azure SDK for IotDps Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API for using the Azure IoT Hub Device Provisioning Service features. Package tag package-2020-03. + This package contains Microsoft Azure SDK for IotDps Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API for using the Azure IoT Hub Device Provisioning Service features. Package tag package-2021-10. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/IotDpsManager.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/IotDpsManager.java index 52876007565c..64a31e3df376 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/IotDpsManager.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/IotDpsManager.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; @@ -33,6 +34,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to IotDpsManager. API for using the Azure IoT Hub Device Provisioning Service features. */ public final class IotDpsManager { @@ -85,6 +87,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; @@ -124,6 +127,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. * @@ -166,7 +180,7 @@ public IotDpsManager authenticate(TokenCredential credential, AzureProfile profi .append("-") .append("com.azure.resourcemanager.deviceprovisioningservices") .append("/") - .append("1.0.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -180,20 +194,33 @@ public IotDpsManager authenticate(TokenCredential credential, AzureProfile profi userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/DpsCertificatesClient.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/DpsCertificatesClient.java index afb767fd3bf1..62f638d2bde4 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/DpsCertificatesClient.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/DpsCertificatesClient.java @@ -45,7 +45,7 @@ public interface DpsCertificatesClient { * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -89,7 +89,7 @@ CertificateResponseInner createOrUpdate( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -137,7 +137,7 @@ Response createOrUpdateWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( @@ -179,7 +179,7 @@ Response deleteWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 certificates tied to the provisioning service. + * @return all the certificates tied to the provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse( @@ -226,7 +226,7 @@ VerificationCodeResponseInner generateVerificationCode( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the response of the verification code. + * @return description of the response of the verification code along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response generateVerificationCodeWithResponse( @@ -291,7 +291,7 @@ CertificateResponseInner verifyCertificate( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response verifyCertificateWithResponse( diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/IotDpsResourcesClient.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/IotDpsResourcesClient.java index a923b0469250..8985ae4a7b5c 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/IotDpsResourcesClient.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/IotDpsResourcesClient.java @@ -22,6 +22,7 @@ import com.azure.resourcemanager.deviceprovisioningservices.models.OperationInputs; import com.azure.resourcemanager.deviceprovisioningservices.models.TagsResource; import java.util.List; +import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in IotDpsResourcesClient. */ public interface IotDpsResourcesClient { @@ -49,7 +50,7 @@ public interface IotDpsResourcesClient { * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of the provisioning service without SAS keys. + * @return the metadata of the provisioning service without SAS keys along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -67,9 +68,10 @@ Response getByResourceGroupWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProvisioningServiceDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -89,9 +91,10 @@ Response getByResourceGroupWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProvisioningServiceDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -150,9 +153,10 @@ ProvisioningServiceDescriptionInner 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProvisioningServiceDescriptionInner> beginUpdate( String resourceGroupName, String provisioningServiceName, TagsResource provisioningServiceTags); @@ -166,9 +170,10 @@ SyncPoller, ProvisioningServiceD * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ProvisioningServiceDescriptionInner> beginUpdate( String resourceGroupName, String provisioningServiceName, @@ -218,9 +223,9 @@ ProvisioningServiceDescriptionInner update( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String provisioningServiceName); /** @@ -233,9 +238,9 @@ ProvisioningServiceDescriptionInner update( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete( String resourceGroupName, String provisioningServiceName, Context context); @@ -348,7 +353,8 @@ AsyncOperationResultInner getOperationResult( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running operation, such as create, update or delete a provisioning service. + * @return the status of a long running operation, such as create, update or delete a provisioning service along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getOperationResultWithResponse( @@ -414,7 +420,7 @@ PagedIterable listValidSkus( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of name availability. + * @return description of name availability along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkProvisioningServiceNameAvailabilityWithResponse( @@ -478,7 +484,7 @@ SharedAccessSignatureAuthorizationRuleInner listKeysForKeyName( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the shared access key. + * @return description of the shared access key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listKeysForKeyNameWithResponse( @@ -508,7 +514,7 @@ Response listKeysForKeyNameWithResp * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the available private link resources for a provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listPrivateLinkResourcesWithResponse( @@ -540,7 +546,7 @@ Response listPrivateLinkResourcesWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the specified private link resource for the given provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getPrivateLinkResourcesWithResponse( @@ -570,7 +576,7 @@ Response getPrivateLinkResourcesWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for a provisioning service. + * @return the list of private endpoint connections for a provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response> listPrivateEndpointConnectionsWithResponse( @@ -603,7 +609,7 @@ PrivateEndpointConnectionInner getPrivateEndpointConnection( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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. + * @return private endpoint connection properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getPrivateEndpointConnectionWithResponse( @@ -620,9 +626,10 @@ Response getPrivateEndpointConnectionWithRespons * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdatePrivateEndpointConnection( String resourceGroupName, @@ -642,9 +649,10 @@ Response getPrivateEndpointConnectionWithRespons * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdatePrivateEndpointConnection( String resourceGroupName, @@ -705,9 +713,10 @@ PrivateEndpointConnectionInner createOrUpdatePrivateEndpointConnection( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginDeletePrivateEndpointConnection( String resourceGroupName, String resourceName, String privateEndpointConnectionName); @@ -723,9 +732,10 @@ PrivateEndpointConnectionInner createOrUpdatePrivateEndpointConnection( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginDeletePrivateEndpointConnection( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/CertificateResponseInner.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/CertificateResponseInner.java index 17f4d9285913..5a5cb6148be2 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/CertificateResponseInner.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/CertificateResponseInner.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.deviceprovisioningservices.models.CertificateProperties; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -28,6 +29,12 @@ public final class CertificateResponseInner extends ProxyResource { @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** * Get the properties property: properties of a certificate. * @@ -57,6 +64,15 @@ public String etag() { return this.etag; } + /** + * 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/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/PrivateEndpointConnectionInner.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/PrivateEndpointConnectionInner.java index 8763a68b2cd4..04d1a9c7b8ab 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/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.deviceprovisioningservices.models.PrivateEndpointConnectionProperties; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -22,6 +23,12 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { @JsonProperty(value = "properties", required = true) private PrivateEndpointConnectionProperties properties; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** * Get the properties property: The properties of a private endpoint connection. * @@ -42,6 +49,15 @@ public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionPr return this; } + /** + * 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/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/ProvisioningServiceDescriptionInner.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/ProvisioningServiceDescriptionInner.java index 8146e3b23c53..0ae1af11cb38 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/ProvisioningServiceDescriptionInner.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/fluent/models/ProvisioningServiceDescriptionInner.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.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsSkuInfo; @@ -38,6 +39,12 @@ public final class ProvisioningServiceDescriptionInner extends Resource { @JsonProperty(value = "sku", required = true) private IotDpsSkuInfo sku; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + /** * Get the etag property: The Etag field is *not* required. If it is provided in the response body, it must also be * provided as a header per the normal ETag convention. @@ -100,6 +107,15 @@ public ProvisioningServiceDescriptionInner withSku(IotDpsSkuInfo sku) { return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** {@inheritDoc} */ @Override public ProvisioningServiceDescriptionInner withLocation(String location) { diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/CertificateResponseImpl.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/CertificateResponseImpl.java index 99569d2f2691..77e2dfa72bc9 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/CertificateResponseImpl.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/CertificateResponseImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.deviceprovisioningservices.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.CertificateResponseInner; import com.azure.resourcemanager.deviceprovisioningservices.models.CertificateBodyDescription; @@ -36,6 +37,10 @@ public String etag() { return this.innerModel().etag(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public CertificateResponseInner innerModel() { return this.innerObject; } @@ -187,6 +192,16 @@ public CertificateResponseImpl withCertificate(String certificate) { } } + public CertificateResponseImpl withIsVerified(Boolean isVerified) { + if (isInCreateMode()) { + this.createCertificateDescription.withIsVerified(isVerified); + return this; + } else { + this.updateCertificateDescription.withIsVerified(isVerified); + return this; + } + } + public CertificateResponseImpl withIfMatch(String ifMatch) { if (isInCreateMode()) { this.createIfMatch = ifMatch; diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/DpsCertificatesClientImpl.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/DpsCertificatesClientImpl.java index b5a1f8362807..14db0a4fabe0 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/DpsCertificatesClientImpl.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/DpsCertificatesClientImpl.java @@ -203,7 +203,8 @@ Mono> verifyCertificate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -262,7 +263,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -321,7 +323,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -346,7 +348,7 @@ private Mono getAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -392,7 +394,7 @@ public CertificateResponseInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -417,7 +419,7 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -490,7 +492,7 @@ private Mono> createOrUpdateWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -560,7 +562,7 @@ private Mono> createOrUpdateWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -591,7 +593,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -649,7 +651,7 @@ public CertificateResponseInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -683,7 +685,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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( @@ -774,7 +776,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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( @@ -862,7 +864,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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( @@ -905,7 +907,7 @@ private Mono deleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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( @@ -993,7 +995,7 @@ public void delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( @@ -1035,7 +1037,8 @@ public Response deleteWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 certificates tied to the provisioning service. + * @return all the certificates tied to the provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync( @@ -1086,7 +1089,8 @@ private Mono> listWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 certificates tied to the provisioning service. + * @return all the certificates tied to the provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync( @@ -1133,7 +1137,7 @@ private Mono> listWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 certificates tied to the provisioning service. + * @return all the certificates tied to the provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync(String resourceGroupName, String provisioningServiceName) { @@ -1172,7 +1176,7 @@ public CertificateListDescriptionInner list(String resourceGroupName, String pro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 certificates tied to the provisioning service. + * @return all the certificates tied to the provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse( @@ -1200,7 +1204,8 @@ public Response listWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the response of the verification code. + * @return description of the response of the verification code along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateVerificationCodeWithResponseAsync( @@ -1292,7 +1297,8 @@ private Mono> generateVerificationCodeWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the response of the verification code. + * @return description of the response of the verification code along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateVerificationCodeWithResponseAsync( @@ -1381,7 +1387,7 @@ private Mono> generateVerificationCodeWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the response of the verification code. + * @return description of the response of the verification code on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono generateVerificationCodeAsync( @@ -1432,7 +1438,7 @@ private Mono generateVerificationCodeAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the response of the verification code. + * @return description of the response of the verification code on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono generateVerificationCodeAsync( @@ -1530,7 +1536,7 @@ public VerificationCodeResponseInner generateVerificationCode( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the response of the verification code. + * @return description of the response of the verification code along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response generateVerificationCodeWithResponse( @@ -1585,7 +1591,7 @@ public Response generateVerificationCodeWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> verifyCertificateWithResponseAsync( @@ -1685,7 +1691,7 @@ private Mono> verifyCertificateWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> verifyCertificateWithResponseAsync( @@ -1782,7 +1788,7 @@ private Mono> verifyCertificateWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono verifyCertificateAsync( @@ -1836,7 +1842,7 @@ private Mono verifyCertificateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono verifyCertificateAsync( @@ -1946,7 +1952,7 @@ public CertificateResponseInner verifyCertificate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response verifyCertificateWithResponse( diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/DpsCertificatesImpl.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/DpsCertificatesImpl.java index 4557136f8700..c173368f559e 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/DpsCertificatesImpl.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/DpsCertificatesImpl.java @@ -353,8 +353,7 @@ public void deleteById(String id) { localCertificateLastUpdated, localCertificateHasPrivateKey, localCertificateNonce, - Context.NONE) - .getValue(); + Context.NONE); } public Response deleteByIdWithResponse( diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/IotDpsClientImpl.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/IotDpsClientImpl.java index 2b0b4eb2cb30..856cf08da0a3 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/IotDpsClientImpl.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/IotDpsClientImpl.java @@ -170,7 +170,7 @@ public IotDpsResourcesClient getIotDpsResources() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2020-03-01"; + this.apiVersion = "2021-10-15"; this.operations = new OperationsClientImpl(this); this.dpsCertificates = new DpsCertificatesClientImpl(this); this.iotDpsResources = new IotDpsResourcesClientImpl(this); diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/IotDpsResourcesClientImpl.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/IotDpsResourcesClientImpl.java index 3e0199ee9ff6..5e348bea25f4 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/IotDpsResourcesClientImpl.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/IotDpsResourcesClientImpl.java @@ -388,7 +388,8 @@ Mono> listKeysNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of the provisioning service without SAS keys. + * @return the metadata of the provisioning service without SAS keys along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -439,7 +440,8 @@ private Mono> getByResourceGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of the provisioning service without SAS keys. + * @return the metadata of the provisioning service without SAS keys along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -486,7 +488,7 @@ private Mono> getByResourceGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of the provisioning service without SAS keys. + * @return the metadata of the provisioning service without SAS keys on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync( @@ -527,7 +529,7 @@ public ProvisioningServiceDescriptionInner getByResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of the provisioning service without SAS keys. + * @return the metadata of the provisioning service without SAS keys along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -546,7 +548,8 @@ public Response getByResourceGroupWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -609,7 +612,8 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -669,9 +673,10 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProvisioningServiceDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -686,7 +691,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getHttpPipeline(), ProvisioningServiceDescriptionInner.class, ProvisioningServiceDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -701,9 +706,10 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProvisioningServiceDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, @@ -734,9 +740,10 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ProvisioningServiceDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -757,9 +764,10 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ProvisioningServiceDescriptionInner> beginCreateOrUpdate( String resourceGroupName, @@ -781,7 +789,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -805,7 +813,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the description of the provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -871,7 +879,8 @@ public ProvisioningServiceDescriptionInner 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -931,7 +940,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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -990,9 +1000,10 @@ 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProvisioningServiceDescriptionInner> beginUpdateAsync( String resourceGroupName, String provisioningServiceName, TagsResource provisioningServiceTags) { @@ -1005,7 +1016,7 @@ private Mono>> updateWithResponseAsync( this.client.getHttpPipeline(), ProvisioningServiceDescriptionInner.class, ProvisioningServiceDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1018,9 +1029,10 @@ 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ProvisioningServiceDescriptionInner> beginUpdateAsync( String resourceGroupName, @@ -1049,9 +1061,10 @@ 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ProvisioningServiceDescriptionInner> beginUpdate( String resourceGroupName, String provisioningServiceName, TagsResource provisioningServiceTags) { return beginUpdateAsync(resourceGroupName, provisioningServiceName, provisioningServiceTags).getSyncPoller(); @@ -1067,9 +1080,10 @@ public SyncPoller, ProvisioningS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 provisioning service. + * @return the description of the provisioning service along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ProvisioningServiceDescriptionInner> beginUpdate( String resourceGroupName, String provisioningServiceName, @@ -1088,7 +1102,7 @@ public SyncPoller, ProvisioningS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 provisioning service. + * @return the description of the provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1108,7 +1122,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 provisioning service. + * @return the description of the provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -1167,7 +1181,7 @@ public ProvisioningServiceDescriptionInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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( @@ -1218,7 +1232,7 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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( @@ -1265,15 +1279,16 @@ private Mono>> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String provisioningServiceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, provisioningServiceName); 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()); } /** @@ -1285,9 +1300,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String provisioningServiceName, Context context) { context = this.client.mergeContext(context); @@ -1306,9 +1321,9 @@ private PollerFlux, Void> beginDeleteAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String provisioningServiceName) { return beginDeleteAsync(resourceGroupName, provisioningServiceName).getSyncPoller(); } @@ -1322,9 +1337,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String provisioningServiceName, Context context) { return beginDeleteAsync(resourceGroupName, provisioningServiceName, context).getSyncPoller(); @@ -1338,7 +1353,7 @@ public SyncPoller, Void> beginDelete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String provisioningServiceName) { @@ -1356,7 +1371,7 @@ private Mono deleteAsync(String resourceGroupName, String provisioningServ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String provisioningServiceName, Context context) { @@ -1399,7 +1414,8 @@ public void delete(String resourceGroupName, String provisioningServiceName, Con * * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of provisioning service descriptions. + * @return list of provisioning service descriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1445,7 +1461,8 @@ private Mono> listSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of provisioning service descriptions. + * @return list of provisioning service descriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -1542,7 +1559,8 @@ public PagedIterable list(Context context) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 all provisioning services in the given resource group. + * @return a list of all provisioning services in the given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1595,7 +1613,8 @@ private Mono> listByResourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 all provisioning services in the given resource group. + * @return a list of all provisioning services in the given resource group along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( @@ -1712,7 +1731,8 @@ public PagedIterable listByResourceGroup( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running operation, such as create, update or delete a provisioning service. + * @return the status of a long running operation, such as create, update or delete a provisioning service along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getOperationResultWithResponseAsync( @@ -1774,7 +1794,8 @@ private Mono> getOperationResultWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running operation, such as create, update or delete a provisioning service. + * @return the status of a long running operation, such as create, update or delete a provisioning service along + * with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getOperationResultWithResponseAsync( @@ -1836,7 +1857,8 @@ private Mono> getOperationResultWithResponse * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running operation, such as create, update or delete a provisioning service. + * @return the status of a long running operation, such as create, update or delete a provisioning service on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getOperationResultAsync( @@ -1883,7 +1905,8 @@ public AsyncOperationResultInner getOperationResult( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running operation, such as create, update or delete a provisioning service. + * @return the status of a long running operation, such as create, update or delete a provisioning service along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getOperationResultWithResponse( @@ -1905,7 +1928,8 @@ public Response getOperationResultWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of valid SKUs and tiers for a provisioning service. + * @return the list of valid SKUs and tiers for a provisioning service along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listValidSkusSinglePageAsync( @@ -1965,7 +1989,8 @@ private Mono> listValidSkusSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of valid SKUs and tiers for a provisioning service. + * @return the list of valid SKUs and tiers for a provisioning service along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listValidSkusSinglePageAsync( @@ -2092,7 +2117,7 @@ public PagedIterable listValidSkus( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of name availability. + * @return description of name availability along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkProvisioningServiceNameAvailabilityWithResponseAsync( @@ -2139,7 +2164,7 @@ private Mono> checkProvisioningServiceNameAv * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of name availability. + * @return description of name availability along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkProvisioningServiceNameAvailabilityWithResponseAsync( @@ -2182,7 +2207,7 @@ private Mono> checkProvisioningServiceNameAv * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of name availability. + * @return description of name availability on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkProvisioningServiceNameAvailabilityAsync(OperationInputs arguments) { @@ -2223,7 +2248,7 @@ public NameAvailabilityInfoInner checkProvisioningServiceNameAvailability(Operat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of name availability. + * @return description of name availability along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkProvisioningServiceNameAvailabilityWithResponse( @@ -2239,7 +2264,7 @@ public Response checkProvisioningServiceNameAvailabil * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of shared access keys. + * @return list of shared access keys along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysSinglePageAsync( @@ -2299,7 +2324,7 @@ private Mono> listKey * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of shared access keys. + * @return list of shared access keys along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysSinglePageAsync( @@ -2426,7 +2451,8 @@ public PagedIterable listKeys( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the shared access key. + * @return description of the shared access key along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysForKeyNameWithResponseAsync( @@ -2482,7 +2508,8 @@ private Mono> listKeysForK * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the shared access key. + * @return description of the shared access key along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysForKeyNameWithResponseAsync( @@ -2534,7 +2561,7 @@ private Mono> listKeysForK * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the shared access key. + * @return description of the shared access key on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listKeysForKeyNameAsync( @@ -2577,7 +2604,7 @@ public SharedAccessSignatureAuthorizationRuleInner listKeysForKeyName( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the shared access key. + * @return description of the shared access key along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysForKeyNameWithResponse( @@ -2594,7 +2621,8 @@ public Response listKeysForKeyNameW * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the available private link resources for a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPrivateLinkResourcesWithResponseAsync( @@ -2643,7 +2671,8 @@ private Mono> listPrivateLinkResourcesWithRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the available private link resources for a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPrivateLinkResourcesWithResponseAsync( @@ -2688,7 +2717,7 @@ private Mono> listPrivateLinkResourcesWithRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the available private link resources for a provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listPrivateLinkResourcesAsync( @@ -2728,7 +2757,7 @@ public PrivateLinkResourcesInner listPrivateLinkResources(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the available private link resources for a provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listPrivateLinkResourcesWithResponse( @@ -2745,7 +2774,8 @@ public Response listPrivateLinkResourcesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the specified private link resource for the given provisioning service along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getPrivateLinkResourcesWithResponseAsync( @@ -2799,7 +2829,8 @@ private Mono> getPrivateLinkResourcesWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the specified private link resource for the given provisioning service along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getPrivateLinkResourcesWithResponseAsync( @@ -2849,7 +2880,8 @@ private Mono> getPrivateLinkResourcesWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the specified private link resource for the given provisioning service on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getPrivateLinkResourcesAsync( @@ -2892,7 +2924,7 @@ public GroupIdInformationInner getPrivateLinkResources( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the specified private link resource for the given provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getPrivateLinkResourcesWithResponse( @@ -2908,7 +2940,8 @@ public Response getPrivateLinkResourcesWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for a provisioning service. + * @return the list of private endpoint connections for a provisioning service along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listPrivateEndpointConnectionsWithResponseAsync( @@ -2957,7 +2990,8 @@ private Mono>> listPrivateEndpoint * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for a provisioning service. + * @return the list of private endpoint connections for a provisioning service along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> listPrivateEndpointConnectionsWithResponseAsync( @@ -3002,7 +3036,8 @@ private Mono>> listPrivateEndpoint * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for a provisioning service. + * @return the list of private endpoint connections for a provisioning service on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPrivateEndpointConnectionsAsync( @@ -3043,7 +3078,7 @@ public List listPrivateEndpointConnections( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for a provisioning service. + * @return the list of private endpoint connections for a provisioning service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response> listPrivateEndpointConnectionsWithResponse( @@ -3060,7 +3095,8 @@ public Response> listPrivateEndpointConnect * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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. + * @return private endpoint connection properties along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getPrivateEndpointConnectionWithResponseAsync( @@ -3117,7 +3153,8 @@ private Mono> getPrivateEndpointConnect * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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. + * @return private endpoint connection properties along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getPrivateEndpointConnectionWithResponseAsync( @@ -3170,7 +3207,7 @@ private Mono> getPrivateEndpointConnect * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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. + * @return private endpoint connection properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getPrivateEndpointConnectionAsync( @@ -3215,7 +3252,7 @@ public PrivateEndpointConnectionInner getPrivateEndpointConnection( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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. + * @return private endpoint connection properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getPrivateEndpointConnectionWithResponse( @@ -3235,7 +3272,8 @@ public Response getPrivateEndpointConnectionWith * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdatePrivateEndpointConnectionWithResponseAsync( @@ -3305,7 +3343,8 @@ private Mono>> createOrUpdatePrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdatePrivateEndpointConnectionWithResponseAsync( @@ -3372,9 +3411,10 @@ private Mono>> createOrUpdatePrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdatePrivateEndpointConnectionAsync( String resourceGroupName, @@ -3391,7 +3431,7 @@ private Mono>> createOrUpdatePrivateEndpointConnection this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -3405,9 +3445,10 @@ private Mono>> createOrUpdatePrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginCreateOrUpdatePrivateEndpointConnectionAsync( String resourceGroupName, @@ -3439,9 +3480,10 @@ private Mono>> createOrUpdatePrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdatePrivateEndpointConnection( String resourceGroupName, @@ -3464,9 +3506,10 @@ private Mono>> createOrUpdatePrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginCreateOrUpdatePrivateEndpointConnection( String resourceGroupName, @@ -3489,7 +3532,7 @@ private Mono>> createOrUpdatePrivateEndpointConnection * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdatePrivateEndpointConnectionAsync( @@ -3514,7 +3557,7 @@ private Mono createOrUpdatePrivateEndpointConnec * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdatePrivateEndpointConnectionAsync( @@ -3586,7 +3629,8 @@ public PrivateEndpointConnectionInner createOrUpdatePrivateEndpointConnection( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deletePrivateEndpointConnectionWithResponseAsync( @@ -3643,7 +3687,8 @@ private Mono>> deletePrivateEndpointConnectionWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deletePrivateEndpointConnectionWithResponseAsync( @@ -3696,9 +3741,10 @@ private Mono>> deletePrivateEndpointConnectionWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginDeletePrivateEndpointConnectionAsync( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { @@ -3712,7 +3758,7 @@ private Mono>> deletePrivateEndpointConnectionWithResp this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -3725,9 +3771,10 @@ private Mono>> deletePrivateEndpointConnectionWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginDeletePrivateEndpointConnectionAsync( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { @@ -3754,9 +3801,10 @@ private Mono>> deletePrivateEndpointConnectionWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginDeletePrivateEndpointConnection( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { @@ -3774,9 +3822,10 @@ private Mono>> deletePrivateEndpointConnectionWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginDeletePrivateEndpointConnection( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { @@ -3794,7 +3843,7 @@ private Mono>> deletePrivateEndpointConnectionWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deletePrivateEndpointConnectionAsync( @@ -3814,7 +3863,7 @@ private Mono deletePrivateEndpointConnectionAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException 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 provisioning service. + * @return the private endpoint connection of a provisioning service on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deletePrivateEndpointConnectionAsync( @@ -3870,7 +3919,8 @@ public PrivateEndpointConnectionInner deletePrivateEndpointConnection( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of provisioning service descriptions. + * @return list of provisioning service descriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync( @@ -3908,7 +3958,8 @@ private Mono> listBySubscript * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of provisioning service descriptions. + * @return list of provisioning service descriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync( @@ -3944,7 +3995,8 @@ private Mono> listBySubscript * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of provisioning service descriptions. + * @return list of provisioning service descriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -3982,7 +4034,8 @@ private Mono> listByResourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of provisioning service descriptions. + * @return list of provisioning service descriptions along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync( @@ -4018,7 +4071,7 @@ private Mono> listByResourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs. + * @return list of available SKUs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listValidSkusNextSinglePageAsync(String nextLink) { @@ -4054,7 +4107,7 @@ private Mono> listValidSkusNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of available SKUs. + * @return list of available SKUs along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listValidSkusNextSinglePageAsync( @@ -4090,7 +4143,7 @@ private Mono> listValidSkusNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of shared access keys. + * @return list of shared access keys along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysNextSinglePageAsync( @@ -4127,7 +4180,7 @@ private Mono> listKey * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of shared access keys. + * @return list of shared access keys along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysNextSinglePageAsync( diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/OperationsClientImpl.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/OperationsClientImpl.java index e897c4b68bab..c5176a1a1881 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/OperationsClientImpl.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/OperationsClientImpl.java @@ -85,7 +85,8 @@ Mono> listNext( * * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list provisioning service operations. + * @return result of the request to list provisioning service operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +119,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list provisioning service operations. + * @return result of the request to list provisioning service operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -203,7 +205,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list provisioning service operations. + * @return result of the request to list provisioning service operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +242,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of the request to list provisioning service operations. + * @return result of the request to list provisioning 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/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/PrivateEndpointConnectionImpl.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/PrivateEndpointConnectionImpl.java index 035aaf8ea243..46d063297872 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/PrivateEndpointConnectionImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.deviceprovisioningservices.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateEndpointConnection; @@ -31,6 +32,10 @@ public PrivateEndpointConnectionProperties properties() { return this.innerModel().properties(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public PrivateEndpointConnectionInner innerModel() { return this.innerObject; } diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/ProvisioningServiceDescriptionImpl.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/ProvisioningServiceDescriptionImpl.java index b8ddff345f16..e7a07c998f23 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/ProvisioningServiceDescriptionImpl.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/implementation/ProvisioningServiceDescriptionImpl.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.ProvisioningServiceDescriptionInner; import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; @@ -61,6 +62,10 @@ public IotDpsSkuInfo sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public Region region() { return Region.fromName(this.regionName()); } diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/CertificateBodyDescription.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/CertificateBodyDescription.java index 5912ba99e132..23b3add7de49 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/CertificateBodyDescription.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/CertificateBodyDescription.java @@ -21,6 +21,13 @@ public final class CertificateBodyDescription { @JsonProperty(value = "certificate") private String certificate; + /* + * True indicates that the certificate will be created in verified state + * and proof of possession will not be required. + */ + @JsonProperty(value = "isVerified") + private Boolean isVerified; + /** * Get the certificate property: Base-64 representation of the X509 leaf certificate .cer file or just .pem file * content. @@ -43,6 +50,28 @@ public CertificateBodyDescription withCertificate(String certificate) { return this; } + /** + * Get the isVerified property: True indicates that the certificate will be created in verified state and proof of + * possession will not be required. + * + * @return the isVerified value. + */ + public Boolean isVerified() { + return this.isVerified; + } + + /** + * Set the isVerified property: True indicates that the certificate will be created in verified state and proof of + * possession will not be required. + * + * @param isVerified the isVerified value to set. + * @return the CertificateBodyDescription object itself. + */ + public CertificateBodyDescription withIsVerified(Boolean isVerified) { + this.isVerified = isVerified; + return this; + } + /** * Validates the instance. * diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/CertificateResponse.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/CertificateResponse.java index dcf67db6a5b5..d2a6d728322d 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/CertificateResponse.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/CertificateResponse.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.deviceprovisioningservices.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.CertificateResponseInner; @@ -44,6 +45,13 @@ public interface CertificateResponse { */ String etag(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the inner com.azure.resourcemanager.deviceprovisioningservices.fluent.models.CertificateResponseInner * object. @@ -76,7 +84,8 @@ interface WithParentResource { * The stage of the CertificateResponse 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.WithCertificate, DefinitionStages.WithIfMatch { + interface WithCreate + extends DefinitionStages.WithCertificate, DefinitionStages.WithIsVerified, DefinitionStages.WithIfMatch { /** * Executes the create request. * @@ -104,6 +113,18 @@ interface WithCertificate { */ WithCreate withCertificate(String certificate); } + /** The stage of the CertificateResponse definition allowing to specify isVerified. */ + interface WithIsVerified { + /** + * Specifies the isVerified property: True indicates that the certificate will be created in verified state + * and proof of possession will not be required.. + * + * @param isVerified True indicates that the certificate will be created in verified state and proof of + * possession will not be required. + * @return the next definition stage. + */ + WithCreate withIsVerified(Boolean isVerified); + } /** The stage of the CertificateResponse definition allowing to specify ifMatch. */ interface WithIfMatch { /** @@ -125,7 +146,7 @@ interface WithIfMatch { CertificateResponse.Update update(); /** The template for CertificateResponse update. */ - interface Update extends UpdateStages.WithCertificate, UpdateStages.WithIfMatch { + interface Update extends UpdateStages.WithCertificate, UpdateStages.WithIsVerified, UpdateStages.WithIfMatch { /** * Executes the update request. * @@ -155,6 +176,18 @@ interface WithCertificate { */ Update withCertificate(String certificate); } + /** The stage of the CertificateResponse update allowing to specify isVerified. */ + interface WithIsVerified { + /** + * Specifies the isVerified property: True indicates that the certificate will be created in verified state + * and proof of possession will not be required.. + * + * @param isVerified True indicates that the certificate will be created in verified state and proof of + * possession will not be required. + * @return the next definition stage. + */ + Update withIsVerified(Boolean isVerified); + } /** The stage of the CertificateResponse update allowing to specify ifMatch. */ interface WithIfMatch { /** diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/DpsCertificates.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/DpsCertificates.java index a247a6c07db9..1cce7f4ecd06 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/DpsCertificates.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/DpsCertificates.java @@ -36,7 +36,7 @@ public interface DpsCertificates { * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service along with {@link Response}. */ Response getWithResponse( String certificateName, @@ -81,7 +81,7 @@ Response getWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, @@ -121,7 +121,7 @@ Response deleteWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 certificates tied to the provisioning service. + * @return all the certificates tied to the provisioning service along with {@link Response}. */ Response listWithResponse( String resourceGroupName, String provisioningServiceName, Context context); @@ -166,7 +166,7 @@ VerificationCodeResponse generateVerificationCode( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the response of the verification code. + * @return description of the response of the verification code along with {@link Response}. */ Response generateVerificationCodeWithResponse( String certificateName, @@ -229,7 +229,7 @@ CertificateResponse verifyCertificate( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ Response verifyCertificateWithResponse( String certificateName, @@ -255,7 +255,7 @@ Response verifyCertificateWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service along with {@link Response}. */ CertificateResponse getById(String id); @@ -269,7 +269,7 @@ Response verifyCertificateWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the certificate from the provisioning service. + * @return the certificate from the provisioning service along with {@link Response}. */ Response getByIdWithResponse(String id, String ifMatch, Context context); @@ -302,7 +302,7 @@ Response verifyCertificateWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse( String id, diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/IotDpsPropertiesDescription.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/IotDpsPropertiesDescription.java index 839201b3cdc9..58e7aadabc0b 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/IotDpsPropertiesDescription.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/IotDpsPropertiesDescription.java @@ -86,6 +86,14 @@ public final class IotDpsPropertiesDescription { @JsonProperty(value = "authorizationPolicies") private List authorizationPolicies; + /* + * Optional. + * Indicates if the DPS instance has Data Residency enabled, removing the + * cross geo-pair disaster recovery. + */ + @JsonProperty(value = "enableDataResidency") + private Boolean enableDataResidency; + /** * Get the state property: Current state of the provisioning service. * @@ -275,6 +283,28 @@ public IotDpsPropertiesDescription withAuthorizationPolicies( return this; } + /** + * Get the enableDataResidency property: Optional. Indicates if the DPS instance has Data Residency enabled, + * removing the cross geo-pair disaster recovery. + * + * @return the enableDataResidency value. + */ + public Boolean enableDataResidency() { + return this.enableDataResidency; + } + + /** + * Set the enableDataResidency property: Optional. Indicates if the DPS instance has Data Residency enabled, + * removing the cross geo-pair disaster recovery. + * + * @param enableDataResidency the enableDataResidency value to set. + * @return the IotDpsPropertiesDescription object itself. + */ + public IotDpsPropertiesDescription withEnableDataResidency(Boolean enableDataResidency) { + this.enableDataResidency = enableDataResidency; + return this; + } + /** * Validates the instance. * diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/IotDpsResources.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/IotDpsResources.java index cd7892d32781..cb31d6f8832c 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/IotDpsResources.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/IotDpsResources.java @@ -34,7 +34,7 @@ public interface IotDpsResources { * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of the provisioning service without SAS keys. + * @return the metadata of the provisioning service without SAS keys along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String provisioningServiceName, Context context); @@ -141,7 +141,8 @@ AsyncOperationResult getOperationResult( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of a long running operation, such as create, update or delete a provisioning service. + * @return the status of a long running operation, such as create, update or delete a provisioning service along + * with {@link Response}. */ Response getOperationResultWithResponse( String operationId, @@ -203,7 +204,7 @@ PagedIterable listValidSkus( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of name availability. + * @return description of name availability along with {@link Response}. */ Response checkProvisioningServiceNameAvailabilityWithResponse( OperationInputs arguments, Context context); @@ -263,7 +264,7 @@ SharedAccessSignatureAuthorizationRule listKeysForKeyName( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of the shared access key. + * @return description of the shared access key along with {@link Response}. */ Response listKeysForKeyNameWithResponse( String provisioningServiceName, String keyName, String resourceGroupName, Context context); @@ -291,7 +292,7 @@ Response listKeysForKeyNameWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the available private link resources for a provisioning service along with {@link Response}. */ Response listPrivateLinkResourcesWithResponse( String resourceGroupName, String resourceName, Context context); @@ -321,7 +322,7 @@ Response listPrivateLinkResourcesWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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 provisioning service. + * @return the specified private link resource for the given provisioning service along with {@link Response}. */ Response getPrivateLinkResourcesWithResponse( String resourceGroupName, String resourceName, String groupId, Context context); @@ -349,7 +350,7 @@ Response getPrivateLinkResourcesWithResponse( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for a provisioning service. + * @return the list of private endpoint connections for a provisioning service along with {@link Response}. */ Response> listPrivateEndpointConnectionsWithResponse( String resourceGroupName, String resourceName, Context context); @@ -380,7 +381,7 @@ PrivateEndpointConnection getPrivateEndpointConnection( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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. + * @return private endpoint connection properties along with {@link Response}. */ Response getPrivateEndpointConnectionWithResponse( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); @@ -424,7 +425,7 @@ PrivateEndpointConnection deletePrivateEndpointConnection( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of the provisioning service without SAS keys. + * @return the metadata of the provisioning service without SAS keys along with {@link Response}. */ ProvisioningServiceDescription getById(String id); @@ -437,7 +438,7 @@ PrivateEndpointConnection deletePrivateEndpointConnection( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException thrown if the request * is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the metadata of the provisioning service without SAS keys. + * @return the metadata of the provisioning service without SAS keys along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -449,7 +450,7 @@ PrivateEndpointConnection deletePrivateEndpointConnection( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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. + * @return private endpoint connection properties along with {@link Response}. */ PrivateEndpointConnection getPrivateEndpointConnectionById(String id); @@ -462,7 +463,7 @@ PrivateEndpointConnection deletePrivateEndpointConnection( * @throws com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException 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. + * @return private endpoint connection properties along with {@link Response}. */ Response getPrivateEndpointConnectionByIdWithResponse(String id, Context context); diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/PrivateEndpointConnection.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/PrivateEndpointConnection.java index 69d8c72cd19b..1b98199aeb40 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/PrivateEndpointConnection.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/PrivateEndpointConnection.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.deviceprovisioningservices.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.PrivateEndpointConnectionInner; @@ -37,6 +38,13 @@ public interface PrivateEndpointConnection { */ PrivateEndpointConnectionProperties properties(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the inner com.azure.resourcemanager.deviceprovisioningservices.fluent.models.PrivateEndpointConnectionInner * object. diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/ProvisioningServiceDescription.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/ProvisioningServiceDescription.java index 840c844ee04f..b13334651f89 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/ProvisioningServiceDescription.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/ProvisioningServiceDescription.java @@ -6,6 +6,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.ProvisioningServiceDescriptionInner; import java.util.Map; @@ -69,6 +70,13 @@ public interface ProvisioningServiceDescription { */ IotDpsSkuInfo sku(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the region of the resource. * diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/TagsResource.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/TagsResource.java index 79db3f22497e..0a64b6621373 100644 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/TagsResource.java +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/java/com/azure/resourcemanager/deviceprovisioningservices/models/TagsResource.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; @@ -22,6 +23,7 @@ public final class TagsResource { * Resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/AllocationPolicyTests.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/AllocationPolicyTests.java deleted file mode 100644 index fbfc2e6f1851..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/AllocationPolicyTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.deviceprovisioningservices; - -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.ProvisioningServiceDescriptionInner; -import com.azure.resourcemanager.deviceprovisioningservices.models.AllocationPolicy; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class AllocationPolicyTests extends DeviceProvisioningTestBase -{ - @Test - @DoNotRecord(skipInPlayback = true) - public void Get() { - ResourceManager resourceManager = createResourceManager(); - IotDpsManager iotDpsManager = createIotDpsManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - ProvisioningServiceDescriptionInner provisioningServiceDescription = - createProvisioningService(iotDpsManager, resourceGroup); - - AllocationPolicy allocationPolicy = - provisioningServiceDescription - .properties() - .allocationPolicy(); - - assertTrue(Constants.ALLOCATION_POLICIES.contains(allocationPolicy)); - } finally { - // No matter if the test fails or not, delete the resource group that contains these test resources - resourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } - - @Test - @DoNotRecord(skipInPlayback = true) - public void Update() { - ResourceManager resourceManager = createResourceManager(); - IotDpsManager iotDpsManager = createIotDpsManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - ProvisioningServiceDescriptionInner provisioningServiceDescription = - createProvisioningService(iotDpsManager, resourceGroup); - - // pick a new allocation policy that is different from the current allocation policy - AllocationPolicy newAllocationPolicy = AllocationPolicy.GEO_LATENCY; - if (provisioningServiceDescription.properties().allocationPolicy() == AllocationPolicy.GEO_LATENCY) - { - newAllocationPolicy = AllocationPolicy.HASHED; - } - - // update the service's allocation policy to the new policy - IotDpsPropertiesDescription propertiesDescription = - provisioningServiceDescription - .properties() - .withAllocationPolicy(newAllocationPolicy); - - provisioningServiceDescription.withProperties(propertiesDescription); - - iotDpsManager - .serviceClient() - .getIotDpsResources() - .createOrUpdate( - resourceGroup.name(), - provisioningServiceDescription.name(), - provisioningServiceDescription); - - } finally { - // No matter if the test fails or not, delete the resource group that contains these test resources - resourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/CertificatesTests.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/CertificatesTests.java deleted file mode 100644 index 00e1f0831a2c..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/CertificatesTests.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.deviceprovisioningservices; - -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.CertificateListDescriptionInner; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.CertificateResponseInner; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.ProvisioningServiceDescriptionInner; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.VerificationCodeResponseInner; -import com.azure.resourcemanager.deviceprovisioningservices.models.CertificateBodyDescription; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - -public class CertificatesTests extends DeviceProvisioningTestBase -{ - @Test - @DoNotRecord(skipInPlayback = true) - public void CertificateCRUD() { - ResourceManager resourceManager = createResourceManager(); - IotDpsManager iotDpsManager = createIotDpsManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - ProvisioningServiceDescriptionInner provisioningServiceDescription = - createProvisioningService(iotDpsManager, resourceGroup); - - CertificateBodyDescription certificateBodyDescription = - new CertificateBodyDescription().withCertificate(Constants.Certificate.CONTENT); - - // create a new certificate - iotDpsManager - .serviceClient() - .getDpsCertificates() - .createOrUpdate( - resourceGroup.name(), - provisioningServiceDescription.name(), - Constants.Certificate.NAME, - certificateBodyDescription); - - CertificateListDescriptionInner certificateListDescription = - iotDpsManager - .serviceClient() - .getDpsCertificates() - .list( - resourceGroup.name(), - provisioningServiceDescription.name()); - - assertEquals(1, certificateListDescription.value().size()); - - CertificateResponseInner certificate = certificateListDescription.value().get(0); - assertFalse(certificate.properties().isVerified()); - assertEquals(Constants.Certificate.SUBJECT, certificate.properties().subject()); - assertEquals(Constants.Certificate.THUMBPRINT, certificate.properties().thumbprint()); - - // verify that you can generate certificate verification codes - VerificationCodeResponseInner verificationCodeResponse = - iotDpsManager - .serviceClient() - .getDpsCertificates() - .generateVerificationCode( - certificate.name(), - certificate.etag(), - resourceGroup.name(), - provisioningServiceDescription.name()); - - assertNotNull(verificationCodeResponse.properties().verificationCode()); - - // delete the certificate - iotDpsManager - .serviceClient() - .getDpsCertificates() - .delete( - resourceGroup.name(), - verificationCodeResponse.etag(), - provisioningServiceDescription.name(), - certificate.name()); - - // verify that the certificate isn't listed anymore - certificateListDescription = - iotDpsManager - .serviceClient() - .getDpsCertificates() - .list( - resourceGroup.name(), - provisioningServiceDescription.name()); - - assertEquals(0, certificateListDescription.value().size()); - - } finally { - // No matter if the test fails or not, delete the resource group that contains these test resources - resourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/Constants.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/Constants.java deleted file mode 100644 index 58ce02525dde..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/Constants.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.deviceprovisioningservices; - -import com.azure.resourcemanager.deviceprovisioningservices.models.AllocationPolicy; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsSku; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsSkuInfo; - -import java.util.Arrays; -import java.util.List; - -public class Constants -{ - static final String DEFAULT_LOCATION = "WestUS2"; - static final String OWNER_ACCESS_KEY_NAME = "provisioningserviceowner"; - static final String IOTHUB_OWNER_ACCESS_KEY_NAME = "iothubowner"; - - public static class DefaultSku - { - static final String NAME = "S1"; - static final Long CAPACITY = 1L; - static IotDpsSkuInfo INSTANCE = new IotDpsSkuInfo() - .withCapacity(Constants.DefaultSku.CAPACITY) - .withName(IotDpsSku.fromString(Constants.DefaultSku.NAME)); - } - - public static class Certificate - { - static final String CONTENT = - "MIIBvjCCAWOgAwIBAgIQG6PoBFT6GLJGNKn/EaxltTAKBggqhkjOPQQDAjAcMRow" - + "GAYDVQQDDBFBenVyZSBJb1QgUm9vdCBDQTAeFw0xNzExMDMyMDUyNDZaFw0xNzEy" - + "MDMyMTAyNDdaMBwxGjAYBgNVBAMMEUF6dXJlIElvVCBSb290IENBMFkwEwYHKoZI" - + "zj0CAQYIKoZIzj0DAQcDQgAE+CgpnW3K+KRNIi/U6Zqe/Al9m8PExHX2KgakmGTf" - + "E04nNBwnSoygWb0ekqpT+Lm+OP56LMMe9ynVNryDEr9OSKOBhjCBgzAOBgNVHQ8B" - + "Af8EBAMCAgQwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMB8GA1UdEQQY" - + "MBaCFENOPUF6dXJlIElvVCBSb290IENBMBIGA1UdEwEB/wQIMAYBAf8CAQwwHQYD" - + "VR0OBBYEFDjiklfHQzw1G0A33BcmRQTjAivTMAoGCCqGSM49BAMCA0kAMEYCIQCt" - + "jJ4bAvoYuDhwr92Kk+OkvpPF+qBFiRfrA/EC4YGtzQIhAO79WPtbUnBQ5fsQnW2a" - + "UAT4yJGWL+7l4/qfmqblb96n"; - - static final String NAME = "DPStestCert"; - static final String SUBJECT = "Azure IoT Root CA"; - static final String THUMBPRINT = "9F0983E8F2DB2DB3582997FEF331247D872DEE32"; - } - - static final List ALLOCATION_POLICIES = Arrays.asList(AllocationPolicy.GEO_LATENCY, AllocationPolicy.HASHED, AllocationPolicy.STATIC); -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/DeviceProvisioningResourceManagementTests.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/DeviceProvisioningResourceManagementTests.java deleted file mode 100644 index 2c726f091ba1..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/DeviceProvisioningResourceManagementTests.java +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.deviceprovisioningservices; - -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.ProvisioningServiceDescriptionInner; -import com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsSkuInfo; -import com.azure.resourcemanager.deviceprovisioningservices.models.NameAvailabilityInfo; -import com.azure.resourcemanager.deviceprovisioningservices.models.OperationInputs; -import com.azure.resourcemanager.deviceprovisioningservices.models.ProvisioningServiceDescription; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.*; - -public class DeviceProvisioningResourceManagementTests extends DeviceProvisioningTestBase -{ - @Test - @DoNotRecord(skipInPlayback = true) - public void ServiceCRUD() { - ResourceManager resourceManager = createResourceManager(); - IotDpsManager iotDpsManager = createIotDpsManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - String serviceName = DEFAULT_INSTANCE_NAME + "-" + createRandomSuffix(); - try { - try { - iotDpsManager.iotDpsResources() - .checkProvisioningServiceNameAvailability(new OperationInputs().withName(serviceName)); - } catch (ErrorDetailsException ex) { - // error code signifies that the resource name is not available, need to delete it before creating a - // new one. - if (ex.getValue().getHttpStatusCode().equals("404307")) { - // Delete the service if it already exists - iotDpsManager.iotDpsResources().delete(resourceGroup.name(), serviceName, Context.NONE); - - // After deleting the existing service, check that the name is now available to use - NameAvailabilityInfo availabilityInfo = iotDpsManager.iotDpsResources() - .checkProvisioningServiceNameAvailability(new OperationInputs().withName(serviceName)); - - assertTrue( - availabilityInfo.nameAvailable(), - "Service name was unavailable even after deleting the existing service with the name"); - } - } - - ProvisioningServiceDescription createServiceDescription = iotDpsManager - .iotDpsResources() - .define(serviceName) - .withRegion(DEFAULT_REGION) - .withExistingResourceGroup(resourceGroup.name()) - .withProperties(new IotDpsPropertiesDescription()) - .withSku(Constants.DefaultSku.INSTANCE) - .create(); - - ProvisioningServiceDescriptionInner updatedProvisioningServiceDescriptionInner = - iotDpsManager - .serviceClient() - .getIotDpsResources() - .createOrUpdate(resourceGroup.name(), serviceName, createServiceDescription.innerModel()); - - assertNotNull(updatedProvisioningServiceDescriptionInner); - assertEquals(Constants.DefaultSku.NAME, updatedProvisioningServiceDescriptionInner.sku().name().toString()); - assertEquals(serviceName, updatedProvisioningServiceDescriptionInner.name()); - - // Try getting the newly created resource - ProvisioningServiceDescription getResponse = iotDpsManager - .iotDpsResources() - .getByResourceGroup(resourceGroup.name(), serviceName); - - assertNotNull(getResponse); - assertNotNull(getResponse.etag()); - assertEquals(Constants.DefaultSku.INSTANCE.name().toString(), getResponse.sku().name().toString()); - assertEquals(Constants.DefaultSku.INSTANCE.capacity().longValue(), getResponse.sku().capacity().longValue()); - assertEquals(DEFAULT_REGION.toString(), getResponse.location()); - - // Delete the service - iotDpsManager.iotDpsResources().delete(resourceGroup.name(), serviceName, Context.NONE); - } finally { - // No matter if the test fails or not, delete the resource group that contains these test resources - resourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } - - @Test - @DoNotRecord(skipInPlayback = true) - public void updateSKU() { - ResourceManager resourceManager = createResourceManager(); - IotDpsManager iotDpsManager = createIotDpsManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - // create the provisioning service - ProvisioningServiceDescriptionInner provisioningServiceDescription = - createProvisioningService(iotDpsManager, resourceGroup); - - // locally increase the SKU capacity by 1 - long expectedSkuCapacity = provisioningServiceDescription.sku().capacity() + 1; - IotDpsSkuInfo newSku = - provisioningServiceDescription - .sku() - .withCapacity(expectedSkuCapacity); - - // update the service representation to use the new SKU - provisioningServiceDescription = iotDpsManager - .serviceClient() - .getIotDpsResources() - .createOrUpdate( - resourceGroup.name(), - provisioningServiceDescription.name(), - provisioningServiceDescription.withSku(newSku)); - - assertEquals(expectedSkuCapacity, provisioningServiceDescription.sku().capacity()); - } finally { - // No matter if the test fails or not, delete the resource group that contains these test resources - resourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } - - @Test - @DoNotRecord(skipInPlayback = true) - public void CreateFailure() { - ResourceManager resourceManager = createResourceManager(); - IotDpsManager iotDpsManager = createIotDpsManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - iotDpsManager - .iotDpsResources() - .define("some invalid service name *&^-#2?") - .withRegion(DEFAULT_REGION) - .withExistingResourceGroup(resourceGroup.name()) - .withProperties(new IotDpsPropertiesDescription()) - .withSku(Constants.DefaultSku.INSTANCE) - .create(); - - fail("Creating a device provisioning service with an invalid name should have thrown an exception"); - } catch (ErrorDetailsException ex) { - // expected throw - } finally { - // No matter if the test fails or not, delete the resource group that contains these test resources - resourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/DeviceProvisioningTestBase.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/DeviceProvisioningTestBase.java deleted file mode 100644 index d5fa45bd5092..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/DeviceProvisioningTestBase.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.deviceprovisioningservices; - -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.Region; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.TestBase; -import com.azure.core.util.Context; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.ProvisioningServiceDescriptionInner; -import com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; -import com.azure.resourcemanager.deviceprovisioningservices.models.NameAvailabilityInfo; -import com.azure.resourcemanager.deviceprovisioningservices.models.OperationInputs; -import com.azure.resourcemanager.deviceprovisioningservices.models.ProvisioningServiceDescription; -import com.azure.resourcemanager.iothub.IotHubManager; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.models.ResourceGroup; - -import java.util.UUID; - -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class DeviceProvisioningTestBase extends TestBase { - protected static final String DEFAULT_INSTANCE_NAME = "JavaDpsControlPlaneSDKTest"; - protected static final Region DEFAULT_REGION = Region.US_WEST_CENTRAL; - - public ResourceManager createResourceManager() { - return ResourceManager - .authenticate(new DefaultAzureCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE)) - .withDefaultSubscription(); - } - - public IotDpsManager createIotDpsManager() { - return IotDpsManager - .authenticate(new DefaultAzureCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE)); - } - - public ResourceGroup createResourceGroup(ResourceManager resourceManager) { - String resourceGroupName = DEFAULT_INSTANCE_NAME + "-" + createRandomSuffix(); - return resourceManager.resourceGroups() - .define(resourceGroupName) - .withRegion(DEFAULT_REGION) - .create(); - } - - public IotHubManager createIotHubManager() { - return IotHubManager - .authenticate(new DefaultAzureCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE)); - } - - public ProvisioningServiceDescriptionInner createProvisioningService(IotDpsManager iotDpsManager, ResourceGroup resourceGroup) { - String serviceName = DEFAULT_INSTANCE_NAME + "-" + createRandomSuffix(); - - try { - iotDpsManager.iotDpsResources() - .checkProvisioningServiceNameAvailability(new OperationInputs().withName(serviceName)); - } catch (ErrorDetailsException ex) { - // error code signifies that the resource name is not available, need to delete it before creating a - // new one. - if (ex.getValue().getHttpStatusCode().equals("404307")) { - // Delete the service if it already exists - iotDpsManager.iotDpsResources().delete(resourceGroup.name(), serviceName, Context.NONE); - - // After deleting the existing service, check that the name is now available to use - NameAvailabilityInfo availabilityInfo = iotDpsManager.iotDpsResources() - .checkProvisioningServiceNameAvailability(new OperationInputs().withName(serviceName)); - - assertTrue( - availabilityInfo.nameAvailable(), - "Service name was unavailable even after deleting the existing service with the name"); - } - } - - ProvisioningServiceDescription provisioningServiceDescription = iotDpsManager - .iotDpsResources() - .define(serviceName) - .withRegion(DEFAULT_REGION) - .withExistingResourceGroup(resourceGroup.name()) - .withProperties(new IotDpsPropertiesDescription()) - .withSku(Constants.DefaultSku.INSTANCE) - .create(); - - ProvisioningServiceDescriptionInner inner = iotDpsManager - .serviceClient() - .getIotDpsResources() - .createOrUpdate(resourceGroup.name(), serviceName, provisioningServiceDescription.innerModel()); - - return inner; - } - - public String createRandomSuffix() { - // need to shorten the UUID since max service name is 50 characters - return UUID.randomUUID().toString().substring(0, 18); - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/LinkedHubTests.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/LinkedHubTests.java deleted file mode 100644 index 01b9dff8ab2f..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/LinkedHubTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.deviceprovisioningservices; - -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.ProvisioningServiceDescriptionInner; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotHubDefinitionDescription; -import com.azure.resourcemanager.iothub.IotHubManager; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import com.azure.resourcemanager.iothub.models.IotHubSku; -import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -import static com.azure.resourcemanager.deviceprovisioningservices.Constants.DEFAULT_LOCATION; -import static com.azure.resourcemanager.deviceprovisioningservices.Constants.IOTHUB_OWNER_ACCESS_KEY_NAME; -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class LinkedHubTests extends DeviceProvisioningTestBase -{ - @Test - @DoNotRecord(skipInPlayback = true) - public void LinkedHubsCRUD() { - ResourceManager resourceManager = createResourceManager(); - IotDpsManager iotDpsManager = createIotDpsManager(); - IotHubManager iotHubManager = createIotHubManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - ProvisioningServiceDescriptionInner provisioningServiceDescription = - createProvisioningService(iotDpsManager, resourceGroup); - - // Create an Iot Hub in the same resource group as the DPS instance - String hubName = "JavaDpsControlPlaneSDKTestHub" + createRandomSuffix(); - IotHubDescriptionInner iotHubDescriptionInner = - new IotHubDescriptionInner() - .withLocation(DEFAULT_LOCATION) - .withSku(new IotHubSkuInfo().withCapacity(1L).withName(IotHubSku.B1)); - - iotHubDescriptionInner = iotHubManager - .serviceClient() - .getIotHubResources() - .createOrUpdate(resourceGroup.name(), hubName, iotHubDescriptionInner); - - // Link that Iot Hub to the DPS instance - List linkedHubs = new ArrayList<>(); - String hubKey = iotHubManager.iotHubResources().getKeysForKeyName(resourceGroup.name(), iotHubDescriptionInner.name(), IOTHUB_OWNER_ACCESS_KEY_NAME).primaryKey(); - String hubConnectionString = "HostName=" + hubName + ".azure-devices.net;SharedAccessKeyName=" + IOTHUB_OWNER_ACCESS_KEY_NAME + ";SharedAccessKey=" + hubKey; - - linkedHubs.add( - new IotHubDefinitionDescription() - .withConnectionString(hubConnectionString) - .withLocation(iotHubDescriptionInner.location()) - .withAllocationWeight(1) - .withApplyAllocationPolicy(true)); - - IotDpsPropertiesDescription propertiesDescription = new IotDpsPropertiesDescription(); - propertiesDescription.withIotHubs(linkedHubs); - - provisioningServiceDescription = iotDpsManager - .serviceClient() - .getIotDpsResources() - .createOrUpdate( - resourceGroup.name(), - provisioningServiceDescription.name(), - provisioningServiceDescription.withProperties(propertiesDescription)); - - // verify that the service returned view of the DPS instance has the right linked hubs - assertEquals(1, provisioningServiceDescription.properties().iotHubs().size()); - assertEquals(hubName + ".azure-devices.net", provisioningServiceDescription.properties().iotHubs().iterator().next().name()); - } finally { - // No matter if the test fails or not, delete the resource group that contains these test resources - resourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/SharedAccessPolicyTests.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/SharedAccessPolicyTests.java deleted file mode 100644 index d97d7e69068d..000000000000 --- a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/main/test/com/azure/resourcemanager/deviceprovisioningservices/SharedAccessPolicyTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.deviceprovisioningservices; - -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.ProvisioningServiceDescriptionInner; -import com.azure.resourcemanager.deviceprovisioningservices.fluent.models.SharedAccessSignatureAuthorizationRuleInner; -import com.azure.resourcemanager.deviceprovisioningservices.models.AccessRightsDescription; -import com.azure.resourcemanager.deviceprovisioningservices.models.ErrorDetailsException; -import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; -import com.azure.resourcemanager.deviceprovisioningservices.models.SharedAccessSignatureAuthorizationRule; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.models.ResourceGroup; -import org.junit.jupiter.api.Test; - -import java.net.HttpURLConnection; -import java.util.ArrayList; -import java.util.List; - -import static com.azure.resourcemanager.deviceprovisioningservices.Constants.OWNER_ACCESS_KEY_NAME; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; - -public class SharedAccessPolicyTests extends DeviceProvisioningTestBase -{ - @Test - @DoNotRecord(skipInPlayback = true) - public void SharedAccessPolicyCRUD() { - ResourceManager resourceManager = createResourceManager(); - IotDpsManager iotDpsManager = createIotDpsManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - ProvisioningServiceDescriptionInner provisioningServiceDescription = - createProvisioningService(iotDpsManager, resourceGroup); - - // verify owner key has been created - SharedAccessSignatureAuthorizationRule ownerKey = - iotDpsManager - .iotDpsResources() - .listKeysForKeyName(provisioningServiceDescription.name(), OWNER_ACCESS_KEY_NAME, resourceGroup.name()); - - assertEquals(OWNER_ACCESS_KEY_NAME, ownerKey.keyName()); - - // verify that getting an undefined key makes listKeysForKeyName throw - try { - iotDpsManager - .iotDpsResources() - .listKeysForKeyName(provisioningServiceDescription.name(), "thisKeyDoesNotExist", resourceGroup.name()); - - fail("Getting a key that does not exist should have thrown an exception"); - } catch (ErrorDetailsException ex) { - assertEquals(HttpURLConnection.HTTP_NOT_FOUND, ex.getResponse().getStatusCode()); - } - - // verify that you can create a new key - String newKeyName = "someNewKey"; - AccessRightsDescription expectedAccessRights = AccessRightsDescription.DEVICE_CONNECT; - SharedAccessSignatureAuthorizationRuleInner newKey = - new SharedAccessSignatureAuthorizationRuleInner() - .withKeyName(newKeyName) - .withRights(expectedAccessRights); - - List authorizationPolicies = new ArrayList<>(2); - authorizationPolicies.add(ownerKey.innerModel()); - authorizationPolicies.add(newKey); - - IotDpsPropertiesDescription propertiesWithNewKey = provisioningServiceDescription - .properties() - .withAuthorizationPolicies(authorizationPolicies); - - ProvisioningServiceDescriptionInner serviceWithNewProperties = - provisioningServiceDescription.withProperties(propertiesWithNewKey); - - iotDpsManager - .serviceClient() - .getIotDpsResources() - .createOrUpdate( - resourceGroup.name(), - serviceWithNewProperties.name(), - serviceWithNewProperties); - - // after updating the service, the key should be retrievable - SharedAccessSignatureAuthorizationRule retrievedNewKey = iotDpsManager - .iotDpsResources() - .listKeysForKeyName(provisioningServiceDescription.name(), newKeyName, resourceGroup.name()); - - assertEquals(expectedAccessRights, retrievedNewKey.rights()); - - // verify that the new key can be deleted - provisioningServiceDescription.properties().authorizationPolicies().remove(newKey); - - iotDpsManager - .serviceClient() - .getIotDpsResources() - .createOrUpdate( - resourceGroup.name(), - provisioningServiceDescription.name(), - provisioningServiceDescription); - - // verify that the new key was deleted by attempting to retrieve it - try { - iotDpsManager - .iotDpsResources() - .listKeysForKeyName(provisioningServiceDescription.name(), newKeyName, resourceGroup.name()); - - fail("Getting a key that does not exist should have thrown an exception"); - } catch (ErrorDetailsException ex) { - assertEquals(HttpURLConnection.HTTP_NOT_FOUND, ex.getResponse().getStatusCode()); - } - } finally { - // No matter if the test fails or not, delete the resource group that contains these test resources - resourceManager.resourceGroups().beginDeleteByName(resourceGroup.name()); - } - } -} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateCreateOrUpdateSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateCreateOrUpdateSamples.java new file mode 100644 index 000000000000..e8ebae776cab --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateCreateOrUpdateSamples.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.deviceprovisioningservices.generated; + +/** Samples for DpsCertificate CreateOrUpdate. */ +public final class DpsCertificateCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCertificateCreateOrUpdate.json + */ + /** + * Sample code: DPSCreateOrUpdateCertificate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSCreateOrUpdateCertificate( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .define("cert") + .withExistingProvisioningService("myResourceGroup", "myFirstProvisioningService") + .withCertificate("############################################") + .create(); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateDeleteSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateDeleteSamples.java new file mode 100644 index 000000000000..ac223827b818 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateDeleteSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for DpsCertificate Delete. */ +public final class DpsCertificateDeleteSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDeleteCertificate.json + */ + /** + * Sample code: DPSDeleteCertificate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSDeleteCertificate( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .deleteWithResponse( + "myResourceGroup", + "AAAAAAAADGk=", + "myFirstProvisioningService", + "cert", + null, + new byte[0], + null, + null, + null, + null, + null, + null, + Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateGenerateVerificationCodeSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateGenerateVerificationCodeSamples.java new file mode 100644 index 000000000000..37bbbd6e6f61 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateGenerateVerificationCodeSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for DpsCertificate GenerateVerificationCode. */ +public final class DpsCertificateGenerateVerificationCodeSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGenerateVerificationCode.json + */ + /** + * Sample code: DPSGenerateVerificationCode. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGenerateVerificationCode( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .generateVerificationCodeWithResponse( + "cert", + "AAAAAAAADGk=", + "myResourceGroup", + "myFirstProvisioningService", + null, + new byte[0], + null, + null, + null, + null, + null, + null, + Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateGetSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateGetSamples.java new file mode 100644 index 000000000000..42463ecd857a --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for DpsCertificate Get. */ +public final class DpsCertificateGetSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetCertificate.json + */ + /** + * Sample code: DPSGetCertificate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetCertificate(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .getWithResponse("cert", "myResourceGroup", "myFirstProvisioningService", null, Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateListSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateListSamples.java new file mode 100644 index 000000000000..c9a0b3d9d49c --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateListSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for DpsCertificate List. */ +public final class DpsCertificateListSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetCertificates.json + */ + /** + * Sample code: DPSGetCertificates. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetCertificates(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.dpsCertificates().listWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateVerifyCertificateSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateVerifyCertificateSamples.java new file mode 100644 index 000000000000..fcf122a1164b --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/DpsCertificateVerifyCertificateSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.deviceprovisioningservices.models.VerificationCodeRequest; + +/** Samples for DpsCertificate VerifyCertificate. */ +public final class DpsCertificateVerifyCertificateSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSVerifyCertificate.json + */ + /** + * Sample code: DPSVerifyCertificate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSVerifyCertificate( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .dpsCertificates() + .verifyCertificateWithResponse( + "cert", + "AAAAAAAADGk=", + "myResourceGroup", + "myFirstProvisioningService", + new VerificationCodeRequest().withCertificate("#####################################"), + null, + new byte[0], + null, + null, + null, + null, + null, + null, + Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilitySamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilitySamples.java new file mode 100644 index 000000000000..5d8be38c14fc --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCheckProvisioningServiceNameAvailabilitySamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.deviceprovisioningservices.models.OperationInputs; + +/** Samples for IotDpsResource CheckProvisioningServiceNameAvailability. */ +public final class IotDpsResourceCheckProvisioningServiceNameAvailabilitySamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCheckNameAvailability.json + */ + /** + * Sample code: DPSCheckName. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSCheckName(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .checkProvisioningServiceNameAvailabilityWithResponse( + new OperationInputs().withName("test213123"), Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnectionSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnectionSamples.java new file mode 100644 index 000000000000..f6ff5428fbe8 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdatePrivateEndpointConnectionSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deviceprovisioningservices.generated; + +import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.deviceprovisioningservices.models.PrivateLinkServiceConnectionStatus; + +/** Samples for IotDpsResource CreateOrUpdatePrivateEndpointConnection. */ +public final class IotDpsResourceCreateOrUpdatePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCreateOrUpdatePrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_CreateOrUpdate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateEndpointConnectionCreateOrUpdate( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .definePrivateEndpointConnection("myPrivateEndpointConnection") + .withExistingProvisioningService("myResourceGroup", "myFirstProvisioningService") + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com"))) + .create(); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdateSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdateSamples.java new file mode 100644 index 000000000000..a047c231f458 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deviceprovisioningservices.generated; + +import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsPropertiesDescription; +import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsSku; +import com.azure.resourcemanager.deviceprovisioningservices.models.IotDpsSkuInfo; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotDpsResource CreateOrUpdate. */ +public final class IotDpsResourceCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCreate.json + */ + /** + * Sample code: DPSCreate. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSCreate(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .define("myFirstProvisioningService") + .withRegion("East US") + .withExistingResourceGroup("myResourceGroup") + .withProperties(new IotDpsPropertiesDescription().withEnableDataResidency(false)) + .withSku(new IotDpsSkuInfo().withName(IotDpsSku.S1).withCapacity(1L)) + .withTags(mapOf()) + .create(); + } + + @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/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.java new file mode 100644 index 000000000000..51ba1c6bcbf1 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeletePrivateEndpointConnectionSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource DeletePrivateEndpointConnection. */ +public final class IotDpsResourceDeletePrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDeletePrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_Delete. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateEndpointConnectionDelete( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .deletePrivateEndpointConnection( + "myResourceGroup", "myFirstProvisioningService", "myPrivateEndpointConnection", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeleteSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeleteSamples.java new file mode 100644 index 000000000000..1bc9cdd5d766 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceDeleteSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource Delete. */ +public final class IotDpsResourceDeleteSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDelete.json + */ + /** + * Sample code: DPSDelete. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSDelete(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().delete("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetByResourceGroupSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetByResourceGroupSamples.java new file mode 100644 index 000000000000..ebef0392ad05 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource GetByResourceGroup. */ +public final class IotDpsResourceGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGet.json + */ + /** + * Sample code: DPSGet. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGet(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .getByResourceGroupWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetOperationResultSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetOperationResultSamples.java new file mode 100644 index 000000000000..8281a5b39834 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetOperationResultSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource GetOperationResult. */ +public final class IotDpsResourceGetOperationResultSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetOperationResult.json + */ + /** + * Sample code: DPSGetOperationResult. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetOperationResult( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .getOperationResultWithResponse( + "MTY5OTNmZDctODI5Yy00N2E2LTkxNDQtMDU1NGIyYzY1ZjRl", + "myResourceGroup", + "myFirstProvisioningService", + "1508265712453", + Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetPrivateEndpointConnectionSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetPrivateEndpointConnectionSamples.java new file mode 100644 index 000000000000..bc4ee0833778 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetPrivateEndpointConnectionSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource GetPrivateEndpointConnection. */ +public final class IotDpsResourceGetPrivateEndpointConnectionSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetPrivateEndpointConnection.json + */ + /** + * Sample code: PrivateEndpointConnection_Get. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateEndpointConnectionGet( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .getPrivateEndpointConnectionWithResponse( + "myResourceGroup", "myFirstProvisioningService", "myPrivateEndpointConnection", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetPrivateLinkResourcesSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetPrivateLinkResourcesSamples.java new file mode 100644 index 000000000000..8060ad13fc2f --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceGetPrivateLinkResourcesSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource GetPrivateLinkResources. */ +public final class IotDpsResourceGetPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetPrivateLinkResources.json + */ + /** + * Sample code: PrivateLinkResources_List. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateLinkResourcesList( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .getPrivateLinkResourcesWithResponse( + "myResourceGroup", "myFirstProvisioningService", "iotDps", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListByResourceGroupSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListByResourceGroupSamples.java new file mode 100644 index 000000000000..8309411e6622 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListByResourceGroupSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListByResourceGroup. */ +public final class IotDpsResourceListByResourceGroupSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListByResourceGroup.json + */ + /** + * Sample code: DPSListByResourceGroup. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSListByResourceGroup( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().listByResourceGroup("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListKeysForKeyNameSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListKeysForKeyNameSamples.java new file mode 100644 index 000000000000..c99222a388e6 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListKeysForKeyNameSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListKeysForKeyName. */ +public final class IotDpsResourceListKeysForKeyNameSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetKey.json + */ + /** + * Sample code: DPSGetKey. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetKey(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .listKeysForKeyNameWithResponse("myFirstProvisioningService", "testKey", "myResourceGroup", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListKeysSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListKeysSamples.java new file mode 100644 index 000000000000..27f8a78aed15 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListKeysSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListKeys. */ +public final class IotDpsResourceListKeysSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListKeys.json + */ + /** + * Sample code: DPSListKeys. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSListKeys(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().listKeys("myFirstProvisioningService", "myResourceGroup", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListPrivateEndpointConnectionsSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListPrivateEndpointConnectionsSamples.java new file mode 100644 index 000000000000..62fe23490498 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListPrivateEndpointConnectionsSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListPrivateEndpointConnections. */ +public final class IotDpsResourceListPrivateEndpointConnectionsSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListPrivateEndpointConnections.json + */ + /** + * Sample code: PrivateEndpointConnections_List. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateEndpointConnectionsList( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .listPrivateEndpointConnectionsWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListPrivateLinkResourcesSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListPrivateLinkResourcesSamples.java new file mode 100644 index 000000000000..12d5c2e7f9c0 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListPrivateLinkResourcesSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListPrivateLinkResources. */ +public final class IotDpsResourceListPrivateLinkResourcesSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListPrivateLinkResources.json + */ + /** + * Sample code: PrivateLinkResources_List. + * + * @param manager Entry point to IotDpsManager. + */ + public static void privateLinkResourcesList( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager + .iotDpsResources() + .listPrivateLinkResourcesWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListSamples.java new file mode 100644 index 000000000000..bb9430d259ef --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource List. */ +public final class IotDpsResourceListSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListBySubscription.json + */ + /** + * Sample code: DPSListBySubscription. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSListBySubscription( + com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().list(Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListValidSkusSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListValidSkusSamples.java new file mode 100644 index 000000000000..8dcb04b481a7 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceListValidSkusSamples.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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for IotDpsResource ListValidSkus. */ +public final class IotDpsResourceListValidSkusSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetValidSku.json + */ + /** + * Sample code: DPSGetValidSku. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSGetValidSku(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.iotDpsResources().listValidSkus("myFirstProvisioningService", "myResourceGroup", Context.NONE); + } +} diff --git a/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceUpdateSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceUpdateSamples.java new file mode 100644 index 000000000000..97588c83aa18 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/IotDpsResourceUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.deviceprovisioningservices.models.ProvisioningServiceDescription; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotDpsResource Update. */ +public final class IotDpsResourceUpdateSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSPatch.json + */ + /** + * Sample code: DPSPatch. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSPatch(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + ProvisioningServiceDescription resource = + manager + .iotDpsResources() + .getByResourceGroupWithResponse("myResourceGroup", "myFirstProvisioningService", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("foo", "bar")).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/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/OperationsListSamples.java b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/generated/OperationsListSamples.java new file mode 100644 index 000000000000..cb8a617ba378 --- /dev/null +++ b/sdk/deviceprovisioningservices/azure-resourcemanager-deviceprovisioningservices/src/samples/java/com/azure/resourcemanager/deviceprovisioningservices/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.deviceprovisioningservices.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSOperations.json + */ + /** + * Sample code: DPSOperations. + * + * @param manager Entry point to IotDpsManager. + */ + public static void dPSOperations(com.azure.resourcemanager.deviceprovisioningservices.IotDpsManager manager) { + manager.operations().list(Context.NONE); + } +}