diff --git a/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md b/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md index ac01f61a2a7fb..f1820401bb37f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md +++ b/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.0-beta.1 (2022-01-13) + +- Azure Resource Manager IotHub client library for Java. This package contains Microsoft Azure SDK for IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2021-07. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + ## 1.1.0 (2021-08-30) - Add support for new service API version 2021-07-01 diff --git a/sdk/iothub/azure-resourcemanager-iothub/README.md b/sdk/iothub/azure-resourcemanager-iothub/README.md index 9bb6e9adc46e3..dea07528ae094 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/README.md +++ b/sdk/iothub/azure-resourcemanager-iothub/README.md @@ -2,7 +2,7 @@ Azure Resource Manager IotHub client library for Java. -This package contains Microsoft Azure SDK for IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2021-07. 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 IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2021-07. 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 diff --git a/sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md b/sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md index 515fcb4b42904..36148191c3cb6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md +++ b/sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md @@ -1,61 +1,1125 @@ # Code snippets and samples -### Certificates - -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesDeleteSamples.java) -- [GenerateVerificationCode](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesGenerateVerificationCodeSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesGetSamples.java) -- [ListByIotHub](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesListByIotHubSamples.java) -- [Verify](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesVerifySamples.java) - -### IotHub - -- [ManualFailover](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubManualFailoverSamples.java) - -### IotHubResource - -- [CheckNameAvailability](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCheckNameAvailabilitySamples.java) -- [CreateEventHubConsumerGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCreateEventHubConsumerGroupSamples.java) -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceDeleteSamples.java) -- [DeleteEventHubConsumerGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceDeleteEventHubConsumerGroupSamples.java) -- [ExportDevices](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceExportDevicesSamples.java) -- [GetByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetByResourceGroupSamples.java) -- [GetEndpointHealth](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetEndpointHealthSamples.java) -- [GetEventHubConsumerGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetEventHubConsumerGroupSamples.java) -- [GetJob](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetJobSamples.java) -- [GetKeysForKeyName](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetKeysForKeyNameSamples.java) -- [GetQuotaMetrics](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetQuotaMetricsSamples.java) -- [GetStats](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetStatsSamples.java) -- [GetValidSkus](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetValidSkusSamples.java) -- [ImportDevices](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceImportDevicesSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListSamples.java) -- [ListByResourceGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListByResourceGroupSamples.java) -- [ListEventHubConsumerGroups](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListEventHubConsumerGroupsSamples.java) -- [ListJobs](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListJobsSamples.java) -- [ListKeys](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListKeysSamples.java) -- [TestAllRoutes](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceTestAllRoutesSamples.java) -- [TestRoute](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceTestRouteSamples.java) -- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceUpdateSamples.java) - -### Operations - -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/OperationsListSamples.java) - -### PrivateEndpointConnections - -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsListSamples.java) -- [Update](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsUpdateSamples.java) - -### PrivateLinkResourcesOperation - -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateLinkResourcesOperationGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateLinkResourcesOperationListSamples.java) - -### ResourceProviderCommon - -- [GetSubscriptionQuota](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/ResourceProviderCommonGetSubscriptionQuotaSamples.java) +## Certificates + +- [CreateOrUpdate](#certificates_createorupdate) +- [Delete](#certificates_delete) +- [GenerateVerificationCode](#certificates_generateverificationcode) +- [Get](#certificates_get) +- [ListByIotHub](#certificates_listbyiothub) +- [Verify](#certificates_verify) + +## IotHub + +- [ManualFailover](#iothub_manualfailover) + +## IotHubResource + +- [CheckNameAvailability](#iothubresource_checknameavailability) +- [CreateEventHubConsumerGroup](#iothubresource_createeventhubconsumergroup) +- [CreateOrUpdate](#iothubresource_createorupdate) +- [Delete](#iothubresource_delete) +- [DeleteEventHubConsumerGroup](#iothubresource_deleteeventhubconsumergroup) +- [ExportDevices](#iothubresource_exportdevices) +- [GetByResourceGroup](#iothubresource_getbyresourcegroup) +- [GetEndpointHealth](#iothubresource_getendpointhealth) +- [GetEventHubConsumerGroup](#iothubresource_geteventhubconsumergroup) +- [GetJob](#iothubresource_getjob) +- [GetKeysForKeyName](#iothubresource_getkeysforkeyname) +- [GetQuotaMetrics](#iothubresource_getquotametrics) +- [GetStats](#iothubresource_getstats) +- [GetValidSkus](#iothubresource_getvalidskus) +- [ImportDevices](#iothubresource_importdevices) +- [List](#iothubresource_list) +- [ListByResourceGroup](#iothubresource_listbyresourcegroup) +- [ListEventHubConsumerGroups](#iothubresource_listeventhubconsumergroups) +- [ListJobs](#iothubresource_listjobs) +- [ListKeys](#iothubresource_listkeys) +- [TestAllRoutes](#iothubresource_testallroutes) +- [TestRoute](#iothubresource_testroute) +- [Update](#iothubresource_update) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +- [Update](#privateendpointconnections_update) + +## PrivateLinkResourcesOperation + +- [Get](#privatelinkresourcesoperation_get) +- [List](#privatelinkresourcesoperation_list) + +## ResourceProviderCommon + +- [GetSubscriptionQuota](#resourceprovidercommon_getsubscriptionquota) +### Certificates_CreateOrUpdate + +```java +import com.azure.resourcemanager.iothub.models.CertificateProperties; + +/** Samples for Certificates CreateOrUpdate. */ +public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_certificatescreateorupdate.json + */ + /** + * Sample code: Certificates_CreateOrUpdate. + * + * @param manager Entry point to IotHubManager. + */ + public static void certificatesCreateOrUpdate(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .certificates() + .define("cert") + .withExistingIotHub("myResourceGroup", "iothub") + .withProperties(new CertificateProperties().withCertificate("############################################")) + .create(); + } +} +``` + +### Certificates_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_certificatesdelete.json + */ + /** + * Sample code: Certificates_Delete. + * + * @param manager Entry point to IotHubManager. + */ + public static void certificatesDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.certificates().deleteWithResponse("myResourceGroup", "myhub", "cert", "AAAAAAAADGk=", Context.NONE); + } +} +``` + +### Certificates_GenerateVerificationCode + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates GenerateVerificationCode. */ +public final class CertificatesGenerateVerificationCodeSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_generateverificationcode.json + */ + /** + * Sample code: Certificates_GenerateVerificationCode. + * + * @param manager Entry point to IotHubManager. + */ + public static void certificatesGenerateVerificationCode(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .certificates() + .generateVerificationCodeWithResponse("myResourceGroup", "testHub", "cert", "AAAAAAAADGk=", Context.NONE); + } +} +``` + +### Certificates_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates Get. */ +public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getcertificate.json + */ + /** + * Sample code: Certificates_Get. + * + * @param manager Entry point to IotHubManager. + */ + public static void certificatesGet(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.certificates().getWithResponse("myResourceGroup", "testhub", "cert", Context.NONE); + } +} +``` + +### Certificates_ListByIotHub + +```java +import com.azure.core.util.Context; + +/** Samples for Certificates ListByIotHub. */ +public final class CertificatesListByIotHubSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listcertificates.json + */ + /** + * Sample code: Certificates_ListByIotHub. + * + * @param manager Entry point to IotHubManager. + */ + public static void certificatesListByIotHub(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.certificates().listByIotHubWithResponse("myResourceGroup", "testhub", Context.NONE); + } +} +``` + +### Certificates_Verify + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.CertificateVerificationDescription; + +/** Samples for Certificates Verify. */ +public final class CertificatesVerifySamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_certverify.json + */ + /** + * Sample code: Certificates_Verify. + * + * @param manager Entry point to IotHubManager. + */ + public static void certificatesVerify(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .certificates() + .verifyWithResponse( + "myResourceGroup", + "myFirstProvisioningService", + "cert", + "AAAAAAAADGk=", + new CertificateVerificationDescription().withCertificate("#####################################"), + Context.NONE); + } +} +``` + +### IotHub_ManualFailover + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.FailoverInput; + +/** Samples for IotHub ManualFailover. */ +public final class IotHubManualFailoverSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/IotHub_ManualFailover.json + */ + /** + * Sample code: IotHub_ManualFailover. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubManualFailover(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubs() + .manualFailover( + "testHub", "myResourceGroup", new FailoverInput().withFailoverRegion("testHub"), Context.NONE); + } +} +``` + +### IotHubResource_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.OperationInputs; + +/** Samples for IotHubResource CheckNameAvailability. */ +public final class IotHubResourceCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/checkNameAvailability.json + */ + /** + * Sample code: IotHubResource_CheckNameAvailability. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceCheckNameAvailability(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .checkNameAvailabilityWithResponse(new OperationInputs().withName("test-request"), Context.NONE); + } +} +``` + +### IotHubResource_CreateEventHubConsumerGroup + +```java +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupName; + +/** Samples for IotHubResource CreateEventHubConsumerGroup. */ +public final class IotHubResourceCreateEventHubConsumerGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_createconsumergroup.json + */ + /** + * Sample code: IotHubResource_CreateEventHubConsumerGroup. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceCreateEventHubConsumerGroup( + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .defineEventHubConsumerGroup("test") + .withExistingEventHubEndpoint("myResourceGroup", "testHub", "events") + .withProperties(new EventHubConsumerGroupName().withName("test")) + .create(); + } +} +``` + +### IotHubResource_CreateOrUpdate + +```java +import com.azure.resourcemanager.iothub.models.Capabilities; +import com.azure.resourcemanager.iothub.models.CloudToDeviceProperties; +import com.azure.resourcemanager.iothub.models.DefaultAction; +import com.azure.resourcemanager.iothub.models.EventHubProperties; +import com.azure.resourcemanager.iothub.models.FallbackRouteProperties; +import com.azure.resourcemanager.iothub.models.FeedbackProperties; +import com.azure.resourcemanager.iothub.models.IotHubProperties; +import com.azure.resourcemanager.iothub.models.IotHubSku; +import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; +import com.azure.resourcemanager.iothub.models.MessagingEndpointProperties; +import com.azure.resourcemanager.iothub.models.NetworkRuleIpAction; +import com.azure.resourcemanager.iothub.models.NetworkRuleSetIpRule; +import com.azure.resourcemanager.iothub.models.NetworkRuleSetProperties; +import com.azure.resourcemanager.iothub.models.RoutingEndpoints; +import com.azure.resourcemanager.iothub.models.RoutingProperties; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import com.azure.resourcemanager.iothub.models.StorageEndpointProperties; +import java.time.Duration; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotHubResource CreateOrUpdate. */ +public final class IotHubResourceCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_createOrUpdate.json + */ + /** + * Sample code: IotHubResource_CreateOrUpdate. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceCreateOrUpdate(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .define("testHub") + .withRegion("centraluseuap") + .withExistingResourceGroup("myResourceGroup") + .withSku(new IotHubSkuInfo().withName(IotHubSku.S1).withCapacity(1L)) + .withTags(mapOf()) + .withEtag("AAAAAAFD6M4=") + .withProperties( + new IotHubProperties() + .withIpFilterRules(Arrays.asList()) + .withNetworkRuleSets( + new NetworkRuleSetProperties() + .withDefaultAction(DefaultAction.DENY) + .withApplyToBuiltInEventHubEndpoint(true) + .withIpRules( + Arrays + .asList( + new NetworkRuleSetIpRule() + .withFilterName("rule1") + .withAction(NetworkRuleIpAction.ALLOW) + .withIpMask("131.117.159.53"), + new NetworkRuleSetIpRule() + .withFilterName("rule2") + .withAction(NetworkRuleIpAction.ALLOW) + .withIpMask("157.55.59.128/25")))) + .withMinTlsVersion("1.2") + .withEventHubEndpoints( + mapOf("events", new EventHubProperties().withRetentionTimeInDays(1L).withPartitionCount(2))) + .withRouting( + new RoutingProperties() + .withEndpoints( + new RoutingEndpoints() + .withServiceBusQueues(Arrays.asList()) + .withServiceBusTopics(Arrays.asList()) + .withEventHubs(Arrays.asList()) + .withStorageContainers(Arrays.asList())) + .withRoutes(Arrays.asList()) + .withFallbackRoute( + new FallbackRouteProperties() + .withName("$fallback") + .withSource(RoutingSource.DEVICE_MESSAGES) + .withCondition("true") + .withEndpointNames(Arrays.asList("events")) + .withIsEnabled(true))) + .withStorageEndpoints( + mapOf( + "$default", + new StorageEndpointProperties() + .withSasTtlAsIso8601(Duration.parse("PT1H")) + .withConnectionString("") + .withContainerName(""))) + .withMessagingEndpoints( + mapOf( + "fileNotifications", + new MessagingEndpointProperties() + .withLockDurationAsIso8601(Duration.parse("PT1M")) + .withTtlAsIso8601(Duration.parse("PT1H")) + .withMaxDeliveryCount(10))) + .withEnableFileUploadNotifications(false) + .withCloudToDevice( + new CloudToDeviceProperties() + .withMaxDeliveryCount(10) + .withDefaultTtlAsIso8601(Duration.parse("PT1H")) + .withFeedback( + new FeedbackProperties() + .withLockDurationAsIso8601(Duration.parse("PT1M")) + .withTtlAsIso8601(Duration.parse("PT1H")) + .withMaxDeliveryCount(10))) + .withFeatures(Capabilities.NONE)) + .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; + } +} +``` + +### IotHubResource_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource Delete. */ +public final class IotHubResourceDeleteSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_delete.json + */ + /** + * Sample code: IotHubResource_Delete. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().delete("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### IotHubResource_DeleteEventHubConsumerGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource DeleteEventHubConsumerGroup. */ +public final class IotHubResourceDeleteEventHubConsumerGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_deleteconsumergroup.json + */ + /** + * Sample code: IotHubResource_DeleteEventHubConsumerGroup. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceDeleteEventHubConsumerGroup( + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .deleteEventHubConsumerGroupWithResponse("myResourceGroup", "testHub", "events", "test", Context.NONE); + } +} +``` + +### IotHubResource_ExportDevices + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ExportDevicesRequest; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; + +/** Samples for IotHubResource ExportDevices. */ +public final class IotHubResourceExportDevicesSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_exportdevices.json + */ + /** + * Sample code: IotHubResource_ExportDevices. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceExportDevices(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .exportDevicesWithResponse( + "myResourceGroup", + "testHub", + new ExportDevicesRequest() + .withExportBlobContainerUri("testBlob") + .withExcludeKeys(true) + .withAuthenticationType(AuthenticationType.IDENTITY_BASED) + .withIdentity( + new ManagedIdentity() + .withUserAssignedIdentity( + "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")), + Context.NONE); + } +} +``` + +### IotHubResource_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource GetByResourceGroup. */ +public final class IotHubResourceGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_get.json + */ + /** + * Sample code: IotHubResource_Get. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceGet(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getByResourceGroupWithResponse("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### IotHubResource_GetEndpointHealth + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource GetEndpointHealth. */ +public final class IotHubResourceGetEndpointHealthSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_routingendpointhealth.json + */ + /** + * Sample code: IotHubResource_GetEndpointHealth. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceGetEndpointHealth(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getEndpointHealth("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### IotHubResource_GetEventHubConsumerGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource GetEventHubConsumerGroup. */ +public final class IotHubResourceGetEventHubConsumerGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getconsumergroup.json + */ + /** + * Sample code: IotHubResource_ListEventHubConsumerGroups. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceListEventHubConsumerGroups( + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .getEventHubConsumerGroupWithResponse("myResourceGroup", "testHub", "events", "test", Context.NONE); + } +} +``` + +### IotHubResource_GetJob + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource GetJob. */ +public final class IotHubResourceGetJobSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getjob.json + */ + /** + * Sample code: IotHubResource_GetJob. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceGetJob(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getJobWithResponse("myResourceGroup", "testHub", "test", Context.NONE); + } +} +``` + +### IotHubResource_GetKeysForKeyName + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource GetKeysForKeyName. */ +public final class IotHubResourceGetKeysForKeyNameSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getkey.json + */ + /** + * Sample code: IotHubResource_GetKeysForKeyName. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceGetKeysForKeyName(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .getKeysForKeyNameWithResponse("myResourceGroup", "testHub", "iothubowner", Context.NONE); + } +} +``` + +### IotHubResource_GetQuotaMetrics + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource GetQuotaMetrics. */ +public final class IotHubResourceGetQuotaMetricsSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_quotametrics.json + */ + /** + * Sample code: IotHubResource_GetQuotaMetrics. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceGetQuotaMetrics(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getQuotaMetrics("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### IotHubResource_GetStats + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource GetStats. */ +public final class IotHubResourceGetStatsSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_stats.json + */ + /** + * Sample code: IotHubResource_GetStats. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceGetStats(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getStatsWithResponse("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### IotHubResource_GetValidSkus + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource GetValidSkus. */ +public final class IotHubResourceGetValidSkusSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getskus.json + */ + /** + * Sample code: IotHubResource_GetValidSkus. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceGetValidSkus(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getValidSkus("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### IotHubResource_ImportDevices + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; + +/** Samples for IotHubResource ImportDevices. */ +public final class IotHubResourceImportDevicesSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_importdevices.json + */ + /** + * Sample code: IotHubResource_ImportDevices. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceImportDevices(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .importDevicesWithResponse( + "myResourceGroup", + "testHub", + new ImportDevicesRequest().withInputBlobContainerUri("testBlob").withOutputBlobContainerUri("testBlob"), + Context.NONE); + } +} +``` + +### IotHubResource_List + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource List. */ +public final class IotHubResourceListSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listbysubscription.json + */ + /** + * Sample code: IotHubResource_ListBySubscription. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceListBySubscription(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().list(Context.NONE); + } +} +``` + +### IotHubResource_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource ListByResourceGroup. */ +public final class IotHubResourceListByResourceGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listbyrg.json + */ + /** + * Sample code: IotHubResource_ListByResourceGroup. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceListByResourceGroup(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().listByResourceGroup("myResourceGroup", Context.NONE); + } +} +``` + +### IotHubResource_ListEventHubConsumerGroups + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource ListEventHubConsumerGroups. */ +public final class IotHubResourceListEventHubConsumerGroupsSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listehgroups.json + */ + /** + * Sample code: IotHubResource_ListEventHubConsumerGroups. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceListEventHubConsumerGroups( + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().listEventHubConsumerGroups("myResourceGroup", "testHub", "events", Context.NONE); + } +} +``` + +### IotHubResource_ListJobs + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource ListJobs. */ +public final class IotHubResourceListJobsSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listjobs.json + */ + /** + * Sample code: IotHubResource_ListJobs. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceListJobs(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().listJobs("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### IotHubResource_ListKeys + +```java +import com.azure.core.util.Context; + +/** Samples for IotHubResource ListKeys. */ +public final class IotHubResourceListKeysSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listkeys.json + */ + /** + * Sample code: IotHubResource_ListKeys. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceListKeys(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().listKeys("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### IotHubResource_TestAllRoutes + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.RoutingMessage; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import com.azure.resourcemanager.iothub.models.TestAllRoutesInput; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotHubResource TestAllRoutes. */ +public final class IotHubResourceTestAllRoutesSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_testallroutes.json + */ + /** + * Sample code: IotHubResource_TestAllRoutes. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceTestAllRoutes(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .testAllRoutesWithResponse( + "testHub", + "myResourceGroup", + new TestAllRoutesInput() + .withRoutingSource(RoutingSource.DEVICE_MESSAGES) + .withMessage( + new RoutingMessage() + .withBody("Body of message") + .withAppProperties(mapOf("key1", "value1")) + .withSystemProperties(mapOf("key1", "value1"))), + Context.NONE); + } + + @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; + } +} +``` + +### IotHubResource_TestRoute + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.RouteProperties; +import com.azure.resourcemanager.iothub.models.RoutingMessage; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import com.azure.resourcemanager.iothub.models.TestRouteInput; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotHubResource TestRoute. */ +public final class IotHubResourceTestRouteSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_testnewroute.json + */ + /** + * Sample code: IotHubResource_TestRoute. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceTestRoute(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .testRouteWithResponse( + "testHub", + "myResourceGroup", + new TestRouteInput() + .withMessage( + new RoutingMessage() + .withBody("Body of message") + .withAppProperties(mapOf("key1", "value1")) + .withSystemProperties(mapOf("key1", "value1"))) + .withRoute( + new RouteProperties() + .withName("Routeid") + .withSource(RoutingSource.DEVICE_MESSAGES) + .withEndpointNames(Arrays.asList("id1")) + .withIsEnabled(true)), + Context.NONE); + } + + @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; + } +} +``` + +### IotHubResource_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.IotHubDescription; +import java.util.HashMap; +import java.util.Map; + +/** Samples for IotHubResource Update. */ +public final class IotHubResourceUpdateSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_patch.json + */ + /** + * Sample code: IotHubResource_Update. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceUpdate(com.azure.resourcemanager.iothub.IotHubManager manager) { + IotHubDescription resource = + manager + .iotHubResources() + .getByResourceGroupWithResponse("myResourceGroup", "myHub", 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/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_operations.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to IotHubManager. + */ + public static void operationsList(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_deleteprivateendpointconnection.json + */ + /** + * Sample code: PrivateEndpointConnection_Delete. + * + * @param manager Entry point to IotHubManager. + */ + public static void privateEndpointConnectionDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .privateEndpointConnections() + .delete("myResourceGroup", "testHub", "myPrivateEndpointConnection", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getprivateendpointconnection.json + */ + /** + * Sample code: PrivateEndpointConnection_Get. + * + * @param manager Entry point to IotHubManager. + */ + public static void privateEndpointConnectionGet(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("myResourceGroup", "testHub", "myPrivateEndpointConnection", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listprivateendpointconnections.json + */ + /** + * Sample code: PrivateEndpointConnections_List. + * + * @param manager Entry point to IotHubManager. + */ + public static void privateEndpointConnectionsList(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.privateEndpointConnections().listWithResponse("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.iothub.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionStatus; + +/** Samples for PrivateEndpointConnections Update. */ +public final class PrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_updateprivateendpointconnection.json + */ + /** + * Sample code: PrivateEndpointConnection_Update. + * + * @param manager Entry point to IotHubManager. + */ + public static void privateEndpointConnectionUpdate(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .privateEndpointConnections() + .update( + "myResourceGroup", + "testHub", + "myPrivateEndpointConnection", + new PrivateEndpointConnectionInner() + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) + .withDescription("Approved by johndoe@contoso.com"))), + Context.NONE); + } +} +``` + +### PrivateLinkResourcesOperation_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResourcesOperation Get. */ +public final class PrivateLinkResourcesOperationGetSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getprivatelinkresources.json + */ + /** + * Sample code: PrivateLinkResources_List. + * + * @param manager Entry point to IotHubManager. + */ + public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.privateLinkResourcesOperations().getWithResponse("myResourceGroup", "testHub", "iotHub", Context.NONE); + } +} +``` + +### PrivateLinkResourcesOperation_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateLinkResourcesOperation List. */ +public final class PrivateLinkResourcesOperationListSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listprivatelinkresources.json + */ + /** + * Sample code: PrivateLinkResources_List. + * + * @param manager Entry point to IotHubManager. + */ + public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.privateLinkResourcesOperations().listWithResponse("myResourceGroup", "testHub", Context.NONE); + } +} +``` + +### ResourceProviderCommon_GetSubscriptionQuota + +```java +import com.azure.core.util.Context; + +/** Samples for ResourceProviderCommon GetSubscriptionQuota. */ +public final class ResourceProviderCommonGetSubscriptionQuotaSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_usages.json + */ + /** + * Sample code: ResourceProviderCommon_GetSubscriptionQuota. + * + * @param manager Entry point to IotHubManager. + */ + public static void resourceProviderCommonGetSubscriptionQuota( + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.resourceProviderCommons().getSubscriptionQuotaWithResponse(Context.NONE); + } +} +``` + diff --git a/sdk/iothub/azure-resourcemanager-iothub/pom.xml b/sdk/iothub/azure-resourcemanager-iothub/pom.xml index 3fe6860de8634..0ce38ab577085 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/pom.xml +++ b/sdk/iothub/azure-resourcemanager-iothub/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for IotHub Management - This package contains Microsoft Azure SDK for IotHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2021-07. + This package contains Microsoft Azure SDK for IotHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2021-07. https://github.com/Azure/azure-sdk-for-java @@ -79,4 +79,8 @@ test + + + + diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java index 5b86a65f5f09b..aa12f9f5767bc 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java @@ -8,6 +8,7 @@ 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.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; @@ -41,6 +42,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure subscription. */ public final class IotHubManager { @@ -194,7 +196,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi .append("-") .append("com.azure.resourcemanager.iothub") .append("/") - .append("1.1.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -217,11 +219,24 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi 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.addAll(this.policies); + 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/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java index 611befd840b7c..07a4029d0fec8 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java @@ -65,8 +65,7 @@ Response getByResourceGroupWithResponse( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -79,15 +78,14 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch); /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -101,7 +99,7 @@ SyncPoller, IotHubDescriptionInner> beginCrea * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -112,8 +110,7 @@ SyncPoller, IotHubDescriptionInner> beginCrea /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -133,8 +130,7 @@ IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -152,8 +148,7 @@ IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -186,7 +181,7 @@ IotHubDescriptionInner createOrUpdate( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IotHubDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, TagsResource iotHubTags); @@ -202,7 +197,7 @@ SyncPoller, IotHubDescriptionInner> beginUpda * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IotHubDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, TagsResource iotHubTags, Context context); @@ -247,7 +242,7 @@ IotHubDescriptionInner update( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IotHubDescriptionInner> beginDelete( String resourceGroupName, String resourceName); @@ -263,7 +258,7 @@ SyncPoller, IotHubDescriptionInner> beginDele * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IotHubDescriptionInner> beginDelete( String resourceGroupName, String resourceName, Context context); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubsClient.java index 70bc77d461df8..65f2f27e4ef39 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubsClient.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubsClient.java @@ -27,7 +27,7 @@ public interface IotHubsClient { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginManualFailover( String iotHubName, String resourceGroupName, FailoverInput failoverInput); @@ -46,7 +46,7 @@ SyncPoller, Void> beginManualFailover( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginManualFailover( String iotHubName, String resourceGroupName, FailoverInput failoverInput, Context context); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateEndpointConnectionsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateEndpointConnectionsClient.java index 7563b1837ebf7..87e4fb20f118d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateEndpointConnectionsClient.java @@ -91,7 +91,7 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -112,7 +112,7 @@ SyncPoller, PrivateEndpointConnection * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -174,7 +174,7 @@ PrivateEndpointConnectionInner update( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName); @@ -191,7 +191,7 @@ SyncPoller, PrivateEndpointConnection * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, PrivateEndpointConnectionInner> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EventHubConsumerGroupInfoInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EventHubConsumerGroupInfoInner.java index ee5bb394fea54..36a93adaf459d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EventHubConsumerGroupInfoInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EventHubConsumerGroupInfoInner.java @@ -8,6 +8,7 @@ import com.azure.core.management.ProxyResource; 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; @@ -20,6 +21,7 @@ public final class EventHubConsumerGroupInfoInner extends ProxyResource { * The tags. */ @JsonProperty(value = "properties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map properties; /* diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java index 07c0bd873816b..76616ecf508f3 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java @@ -236,9 +236,7 @@ public void deleteById(String id) { String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); } String localIfMatch = null; - this - .deleteWithResponse(resourceGroupName, resourceName, certificateName, localIfMatch, Context.NONE) - .getValue(); + this.deleteWithResponse(resourceGroupName, resourceName, certificateName, localIfMatch, Context.NONE); } public Response deleteByIdWithResponse(String id, String ifMatch, Context context) { diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java index cc70412dc79f8..a77d23865b0b0 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java @@ -222,7 +222,7 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-07-01"; + this.apiVersion = "2021-07-01-preview"; this.operations = new OperationsClientImpl(this); this.iotHubResources = new IotHubResourcesClientImpl(this); this.resourceProviderCommons = new ResourceProviderCommonsClientImpl(this); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java index 1b0e088be46a5..e855908e7de70 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java @@ -678,8 +678,7 @@ public Response getByResourceGroupWithResponse( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -740,8 +739,7 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -804,8 +802,7 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -817,7 +814,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, IotHubDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { Mono>> mono = @@ -829,14 +826,13 @@ private PollerFlux, IotHubDescriptionInner> b this.client.getHttpPipeline(), IotHubDescriptionInner.class, IotHubDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -849,7 +845,7 @@ private PollerFlux, IotHubDescriptionInner> b * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, IotHubDescriptionInner> beginCreateOrUpdateAsync( String resourceGroupName, String resourceName, @@ -872,8 +868,7 @@ private PollerFlux, IotHubDescriptionInner> b /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -885,7 +880,7 @@ private PollerFlux, IotHubDescriptionInner> b * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { return beginCreateOrUpdateAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).getSyncPoller(); @@ -894,8 +889,7 @@ public SyncPoller, IotHubDescriptionInner> be /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -908,7 +902,7 @@ public SyncPoller, IotHubDescriptionInner> be * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate( String resourceGroupName, String resourceName, @@ -922,8 +916,7 @@ public SyncPoller, IotHubDescriptionInner> be /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -946,8 +939,7 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -969,8 +961,7 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -998,8 +989,7 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1020,8 +1010,7 @@ public IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1041,8 +1030,7 @@ public IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to - * default, which may lead to unexpected behavior. + * hub. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1184,7 +1172,7 @@ private Mono>> updateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, IotHubDescriptionInner> beginUpdateAsync( String resourceGroupName, String resourceName, TagsResource iotHubTags) { Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, iotHubTags); @@ -1195,7 +1183,7 @@ private PollerFlux, IotHubDescriptionInner> b this.client.getHttpPipeline(), IotHubDescriptionInner.class, IotHubDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1210,7 +1198,7 @@ private PollerFlux, IotHubDescriptionInner> b * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, IotHubDescriptionInner> beginUpdateAsync( String resourceGroupName, String resourceName, TagsResource iotHubTags, Context context) { context = this.client.mergeContext(context); @@ -1237,7 +1225,7 @@ private PollerFlux, IotHubDescriptionInner> b * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, TagsResource iotHubTags) { return beginUpdateAsync(resourceGroupName, resourceName, iotHubTags).getSyncPoller(); @@ -1255,7 +1243,7 @@ public SyncPoller, IotHubDescriptionInner> be * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, TagsResource iotHubTags, Context context) { return beginUpdateAsync(resourceGroupName, resourceName, iotHubTags, context).getSyncPoller(); @@ -1437,7 +1425,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, IotHubDescriptionInner> beginDeleteAsync( String resourceGroupName, String resourceName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); @@ -1448,7 +1436,7 @@ private PollerFlux, IotHubDescriptionInner> b this.client.getHttpPipeline(), IotHubDescriptionInner.class, IotHubDescriptionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1462,7 +1450,7 @@ private PollerFlux, IotHubDescriptionInner> b * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, IotHubDescriptionInner> beginDeleteAsync( String resourceGroupName, String resourceName, Context context) { context = this.client.mergeContext(context); @@ -1487,7 +1475,7 @@ private PollerFlux, IotHubDescriptionInner> b * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginDelete( String resourceGroupName, String resourceName) { return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); @@ -1504,7 +1492,7 @@ public SyncPoller, IotHubDescriptionInner> be * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the description of the IoT hub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginDelete( String resourceGroupName, String resourceName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java index 55ab18982c3c3..c55731b504d88 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java @@ -626,8 +626,7 @@ public void deleteEventHubConsumerGroupById(String id) { } this .deleteEventHubConsumerGroupWithResponse( - resourceGroupName, resourceName, eventHubEndpointName, name, Context.NONE) - .getValue(); + resourceGroupName, resourceName, eventHubEndpointName, name, Context.NONE); } public Response deleteEventHubConsumerGroupByIdWithResponse(String id, Context context) { diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java index d42e8e128b89b..03dade8c162ed 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java @@ -201,14 +201,15 @@ private Mono>> manualFailoverWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginManualFailoverAsync( String iotHubName, String resourceGroupName, FailoverInput failoverInput) { Mono>> mono = manualFailoverWithResponseAsync(iotHubName, resourceGroupName, failoverInput); 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()); } /** @@ -225,7 +226,7 @@ private PollerFlux, Void> beginManualFailoverAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginManualFailoverAsync( String iotHubName, String resourceGroupName, FailoverInput failoverInput, Context context) { context = this.client.mergeContext(context); @@ -249,7 +250,7 @@ private PollerFlux, Void> beginManualFailoverAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginManualFailover( String iotHubName, String resourceGroupName, FailoverInput failoverInput) { return beginManualFailoverAsync(iotHubName, resourceGroupName, failoverInput).getSyncPoller(); @@ -269,7 +270,7 @@ public SyncPoller, Void> beginManualFailover( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginManualFailover( String iotHubName, String resourceGroupName, FailoverInput failoverInput, Context context) { return beginManualFailoverAsync(iotHubName, resourceGroupName, failoverInput, context).getSyncPoller(); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java index 513136f571370..3ccca956cb679 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java @@ -598,7 +598,7 @@ private Mono>> updateWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginUpdateAsync( String resourceGroupName, String resourceName, @@ -614,7 +614,7 @@ private PollerFlux, PrivateEndpointCo this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -630,7 +630,7 @@ private PollerFlux, PrivateEndpointCo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginUpdateAsync( String resourceGroupName, String resourceName, @@ -663,7 +663,7 @@ private PollerFlux, PrivateEndpointCo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -687,7 +687,7 @@ public SyncPoller, PrivateEndpointCon * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginUpdate( String resourceGroupName, String resourceName, @@ -917,7 +917,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { Mono>> mono = @@ -929,7 +929,7 @@ private PollerFlux, PrivateEndpointCo this.client.getHttpPipeline(), PrivateEndpointConnectionInner.class, PrivateEndpointConnectionInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -944,7 +944,7 @@ private PollerFlux, PrivateEndpointCo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, PrivateEndpointConnectionInner> beginDeleteAsync( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { context = this.client.mergeContext(context); @@ -971,7 +971,7 @@ private PollerFlux, PrivateEndpointCo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).getSyncPoller(); @@ -989,7 +989,7 @@ public SyncPoller, PrivateEndpointCon * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private endpoint connection of an IotHub. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java index 32e27c25e82ae..77a5ccd0af8a2 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmIdentity.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; @@ -28,10 +29,10 @@ public class ArmIdentity { private String tenantId; /* - * The type of identity used for the resource. The type 'SystemAssigned, - * UserAssigned' includes both an implicitly created identity and a set of - * user assigned identities. The type 'None' will remove any identities - * from the service. + * The type of identity used for the resource. The type + * 'SystemAssigned,UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will + * remove any identities from the service. */ @JsonProperty(value = "type") private ResourceIdentityType type; @@ -40,6 +41,7 @@ public class ArmIdentity { * Dictionary of */ @JsonProperty(value = "userAssignedIdentities") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /** @@ -61,7 +63,7 @@ public String tenantId() { } /** - * Get the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * Get the type property: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove * any identities from the service. * @@ -72,7 +74,7 @@ public ResourceIdentityType type() { } /** - * Set the type property: The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' + * Set the type property: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' * includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove * any identities from the service. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java new file mode 100644 index 0000000000000..0a4aa8924d485 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EncryptionPropertiesDescription.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The encryption properties for the IoT hub. */ +@Fluent +public final class EncryptionPropertiesDescription { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionPropertiesDescription.class); + + /* + * The source of the key. + */ + @JsonProperty(value = "keySource") + private String keySource; + + /* + * The properties of the KeyVault key. + */ + @JsonProperty(value = "keyVaultProperties") + private List keyVaultProperties; + + /** + * Get the keySource property: The source of the key. + * + * @return the keySource value. + */ + public String keySource() { + return this.keySource; + } + + /** + * Set the keySource property: The source of the key. + * + * @param keySource the keySource value to set. + * @return the EncryptionPropertiesDescription object itself. + */ + public EncryptionPropertiesDescription withKeySource(String keySource) { + this.keySource = keySource; + return this; + } + + /** + * Get the keyVaultProperties property: The properties of the KeyVault key. + * + * @return the keyVaultProperties value. + */ + public List keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the keyVaultProperties property: The properties of the KeyVault key. + * + * @param keyVaultProperties the keyVaultProperties value to set. + * @return the EncryptionPropertiesDescription object itself. + */ + public EncryptionPropertiesDescription withKeyVaultProperties(List keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyVaultProperties() != null) { + keyVaultProperties().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java index b1ca9bfa255e5..e3402244008ba 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java @@ -9,6 +9,7 @@ import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; @@ -114,6 +115,7 @@ public final class IotHubProperties { * while making create or update calls for the IoT hub. */ @JsonProperty(value = "eventHubEndpoints") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map eventHubEndpoints; /* @@ -132,6 +134,7 @@ public final class IotHubProperties { * an error to be thrown. */ @JsonProperty(value = "storageEndpoints") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map storageEndpoints; /* @@ -139,6 +142,7 @@ public final class IotHubProperties { * queue. */ @JsonProperty(value = "messagingEndpoints") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map messagingEndpoints; /* @@ -159,12 +163,24 @@ public final class IotHubProperties { @JsonProperty(value = "comments") private String comments; + /* + * The device streams properties of iothub. + */ + @JsonProperty(value = "deviceStreams") + private IotHubPropertiesDeviceStreams deviceStreams; + /* * The capabilities and features enabled for the IoT hub. */ @JsonProperty(value = "features") private Capabilities features; + /* + * The encryption properties for the IoT hub. + */ + @JsonProperty(value = "encryption") + private EncryptionPropertiesDescription encryption; + /* * Primary and secondary location for iot hub */ @@ -582,6 +598,26 @@ public IotHubProperties withComments(String comments) { return this; } + /** + * Get the deviceStreams property: The device streams properties of iothub. + * + * @return the deviceStreams value. + */ + public IotHubPropertiesDeviceStreams deviceStreams() { + return this.deviceStreams; + } + + /** + * Set the deviceStreams property: The device streams properties of iothub. + * + * @param deviceStreams the deviceStreams value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withDeviceStreams(IotHubPropertiesDeviceStreams deviceStreams) { + this.deviceStreams = deviceStreams; + return this; + } + /** * Get the features property: The capabilities and features enabled for the IoT hub. * @@ -602,6 +638,26 @@ public IotHubProperties withFeatures(Capabilities features) { return this; } + /** + * Get the encryption property: The encryption properties for the IoT hub. + * + * @return the encryption value. + */ + public EncryptionPropertiesDescription encryption() { + return this.encryption; + } + + /** + * Set the encryption property: The encryption properties for the IoT hub. + * + * @param encryption the encryption value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withEncryption(EncryptionPropertiesDescription encryption) { + this.encryption = encryption; + return this; + } + /** * Get the locations property: Primary and secondary location for iot hub. * @@ -665,6 +721,12 @@ public void validate() { if (cloudToDevice() != null) { cloudToDevice().validate(); } + if (deviceStreams() != null) { + deviceStreams().validate(); + } + if (encryption() != null) { + encryption().validate(); + } if (locations() != null) { locations().forEach(e -> e.validate()); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java new file mode 100644 index 0000000000000..28bb6f5c29ad3 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubPropertiesDeviceStreams.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The device streams properties of iothub. */ +@Fluent +public final class IotHubPropertiesDeviceStreams { + @JsonIgnore private final ClientLogger logger = new ClientLogger(IotHubPropertiesDeviceStreams.class); + + /* + * List of Device Streams Endpoints. + */ + @JsonProperty(value = "streamingEndpoints") + private List streamingEndpoints; + + /** + * Get the streamingEndpoints property: List of Device Streams Endpoints. + * + * @return the streamingEndpoints value. + */ + public List streamingEndpoints() { + return this.streamingEndpoints; + } + + /** + * Set the streamingEndpoints property: List of Device Streams Endpoints. + * + * @param streamingEndpoints the streamingEndpoints value to set. + * @return the IotHubPropertiesDeviceStreams object itself. + */ + public IotHubPropertiesDeviceStreams withStreamingEndpoints(List streamingEndpoints) { + this.streamingEndpoints = streamingEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java new file mode 100644 index 0000000000000..1e5461f8ca536 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/KeyVaultKeyProperties.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the KeyVault key. */ +@Fluent +public final class KeyVaultKeyProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(KeyVaultKeyProperties.class); + + /* + * The identifier of the key. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /* + * Managed identity properties of KeyVault Key. + */ + @JsonProperty(value = "identity") + private ManagedIdentity identity; + + /** + * Get the keyIdentifier property: The identifier of the key. + * + * @return the keyIdentifier value. + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set the keyIdentifier property: The identifier of the key. + * + * @param keyIdentifier the keyIdentifier value to set. + * @return the KeyVaultKeyProperties object itself. + */ + public KeyVaultKeyProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the identity property: Managed identity properties of KeyVault Key. + * + * @return the identity value. + */ + public ManagedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Managed identity properties of KeyVault Key. + * + * @param identity the identity value to set. + * @return the KeyVaultKeyProperties object itself. + */ + public KeyVaultKeyProperties withIdentity(ManagedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (identity() != null) { + identity().validate(); + } + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingMessage.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingMessage.java index f91d7887c2574..a3d2d00f01124 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingMessage.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingMessage.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; @@ -25,12 +26,14 @@ public final class RoutingMessage { * App properties */ @JsonProperty(value = "appProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map appProperties; /* * System properties */ @JsonProperty(value = "systemProperties") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map systemProperties; /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java index 666b10fecd934..a6d1239424bef 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingSource.java @@ -25,9 +25,15 @@ public final class RoutingSource extends ExpandableStringEnum { /** Static value DeviceJobLifecycleEvents for RoutingSource. */ public static final RoutingSource DEVICE_JOB_LIFECYCLE_EVENTS = fromString("DeviceJobLifecycleEvents"); + /** Static value DigitalTwinChangeEvents for RoutingSource. */ + public static final RoutingSource DIGITAL_TWIN_CHANGE_EVENTS = fromString("DigitalTwinChangeEvents"); + /** Static value DeviceConnectionStateEvents for RoutingSource. */ public static final RoutingSource DEVICE_CONNECTION_STATE_EVENTS = fromString("DeviceConnectionStateEvents"); + /** Static value MqttBrokerMessages for RoutingSource. */ + public static final RoutingSource MQTT_BROKER_MESSAGES = fromString("MqttBrokerMessages"); + /** * Creates or finds a RoutingSource from its string representation. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TagsResource.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TagsResource.java index 4254c12506ffc..77f43a06514c5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TagsResource.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/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; @@ -19,6 +20,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/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/Constants.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/Constants.java deleted file mode 100644 index c23bc804c9059..0000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/Constants.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.iothub; - -import com.azure.core.management.Region; -import com.azure.resourcemanager.iothub.models.IotHubSku; -import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; - -public class Constants -{ - static final String DEFAULT_INSTANCE_NAME = "JavaIotHubControlPlaneSDKTest"; - static final Region DEFAULT_REGION = Region.US_WEST_CENTRAL; - - public static class DefaultSku - { - static final String NAME = "S1"; - static final Long CAPACITY = 1L; - static IotHubSkuInfo INSTANCE = new IotHubSkuInfo() - .withCapacity(Constants.DefaultSku.CAPACITY) - .withName(IotHubSku.fromString(Constants.DefaultSku.NAME)); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/IotHubResourceManagementTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/IotHubResourceManagementTests.java deleted file mode 100644 index 1ab96a1164393..0000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/IotHubResourceManagementTests.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.iothub; - -import com.azure.core.test.annotation.DoNotRecord; -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import com.azure.resourcemanager.iothub.models.ErrorDetailsException; -import com.azure.resourcemanager.iothub.models.IotHubDescription; -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 static com.azure.resourcemanager.iothub.Constants.DEFAULT_INSTANCE_NAME; -import static com.azure.resourcemanager.iothub.Constants.DEFAULT_REGION; -import static org.junit.jupiter.api.Assertions.*; - -public class IotHubResourceManagementTests extends IotHubTestBase { - @Test - @DoNotRecord(skipInPlayback = true) - public void ServiceCRUD() { - ResourceManager resourceManager = createResourceManager(); - IotHubManager iotHubManager = createIotHubManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - String serviceName = DEFAULT_INSTANCE_NAME + "-" + createRandomSuffix(); - - try { - // Define the IoT Hub - IotHubDescription createServiceDescription = iotHubManager - .iotHubResources() - .define(serviceName) - .withRegion(DEFAULT_REGION) - .withExistingResourceGroup(resourceGroup.name()) - .withSku(Constants.DefaultSku.INSTANCE) - .create(); - - // Deploy the IoT Hub - IotHubDescriptionInner updatedIotHubServiceDescriptionInner = - iotHubManager - .serviceClient() - .getIotHubResources() - .createOrUpdate(resourceGroup.name(), serviceName, createServiceDescription.innerModel()); - - // Verify that the deployed IoT Hub has the expected SKU and name - assertNotNull(updatedIotHubServiceDescriptionInner); - assertEquals(Constants.DefaultSku.NAME, updatedIotHubServiceDescriptionInner.sku().name().toString()); - assertEquals(serviceName, updatedIotHubServiceDescriptionInner.name()); - - // Try getting the newly created resource - IotHubDescription getResponse = iotHubManager - .iotHubResources() - .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 - iotHubManager.iotHubResources().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(); - IotHubManager iotHubManager = createIotHubManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - // Deploy an IoT Hub - IotHubDescriptionInner iotHubDescription = - createIotHub(iotHubManager, resourceGroup); - - // locally increase the SKU capacity by 1 - long expectedSkuCapacity = iotHubDescription.sku().capacity() + 1; - IotHubSkuInfo newSku = - iotHubDescription - .sku() - .withCapacity(expectedSkuCapacity); - - // update the service representation to use the new SKU - iotHubDescription = iotHubManager - .serviceClient() - .getIotHubResources() - .createOrUpdate( - resourceGroup.name(), - iotHubDescription.name(), - iotHubDescription.withSku(newSku)); - - // verify that the returned IoT Hub description has the new capacity - assertEquals(expectedSkuCapacity, iotHubDescription.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(); - IotHubManager iotHubManager = createIotHubManager(); - ResourceGroup resourceGroup = createResourceGroup(resourceManager); - - try { - iotHubManager - .iotHubResources() - .define("some invalid service name *&^-#2?") - .withRegion(DEFAULT_REGION) - .withExistingResourceGroup(resourceGroup.name()) - .withSku(Constants.DefaultSku.INSTANCE) - .create(); - - fail("Creating an IoT hub 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/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/IotHubTestBase.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/IotHubTestBase.java deleted file mode 100644 index 27a54b68b19d7..0000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/test/com/azure/resourcemanager/iothub/IotHubTestBase.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.resourcemanager.iothub; - -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.TestBase; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; -import com.azure.resourcemanager.iothub.models.IotHubDescription; -import com.azure.resourcemanager.resources.ResourceManager; -import com.azure.resourcemanager.resources.models.ResourceGroup; - -import java.util.UUID; - -import static com.azure.resourcemanager.iothub.Constants.DEFAULT_INSTANCE_NAME; -import static com.azure.resourcemanager.iothub.Constants.DEFAULT_REGION; - -public class IotHubTestBase extends TestBase { - public ResourceManager createResourceManager() { - return ResourceManager - .authenticate(new DefaultAzureCredentialBuilder().build(), new AzureProfile(AzureEnvironment.AZURE)) - .withDefaultSubscription(); - } - - 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 IotHubDescriptionInner createIotHub(IotHubManager iotHubManager, ResourceGroup resourceGroup) { - String serviceName = DEFAULT_INSTANCE_NAME + "-" + createRandomSuffix(); - - IotHubDescription iotHubDescription = iotHubManager - .iotHubResources() - .define(serviceName) - .withRegion(DEFAULT_REGION) - .withExistingResourceGroup(resourceGroup.name()) - .withSku(Constants.DefaultSku.INSTANCE) - .create(); - - IotHubDescriptionInner inner = iotHubManager - .serviceClient() - .getIotHubResources() - .createOrUpdate(resourceGroup.name(), serviceName, iotHubDescription.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/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesDeleteSamples.java deleted file mode 100644 index c63f4bc7db634..0000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.iothub; - -import com.azure.core.util.Context; - -/** Samples for Certificates Delete. */ -public final class CertificatesDeleteSamples { - /** - * Sample code: Certificates_Delete. - * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. - */ - public static void certificatesDelete(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager - .certificates() - .deleteWithResponse("myResourceGroup", "myhub", "cert", "AAAAAAAADGk=", Context.NONE); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceExportDevicesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceExportDevicesSamples.java deleted file mode 100644 index a2e7872284ece..0000000000000 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceExportDevicesSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.iothub; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.models.ExportDevicesRequest; - -/** Samples for IotHubResource ExportDevices. */ -public final class IotHubResourceExportDevicesSamples { - /** - * Sample code: IotHubResource_ExportDevices. - * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. - */ - public static void iotHubResourceExportDevices(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager - .iotHubResources() - .exportDevicesWithResponse( - "myResourceGroup", - "testHub", - new ExportDevicesRequest().withExportBlobContainerUri("testBlob").withExcludeKeys(true), - Context.NONE); - } -} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesCreateOrUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java similarity index 68% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesCreateOrUpdateSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java index 48ff393917534..3280b0881dd48 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesCreateOrUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.resourcemanager.iothub.models.CertificateProperties; /** Samples for Certificates CreateOrUpdate. */ public final class CertificatesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_certificatescreateorupdate.json + */ /** * Sample code: Certificates_CreateOrUpdate. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void certificatesCreateOrUpdate(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void certificatesCreateOrUpdate(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .certificates() .define("cert") .withExistingIotHub("myResourceGroup", "iothub") diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteSamples.java new file mode 100644 index 0000000000000..af930988f0f65 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteSamples.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.iothub.generated; + +import com.azure.core.util.Context; + +/** Samples for Certificates Delete. */ +public final class CertificatesDeleteSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_certificatesdelete.json + */ + /** + * Sample code: Certificates_Delete. + * + * @param manager Entry point to IotHubManager. + */ + public static void certificatesDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.certificates().deleteWithResponse("myResourceGroup", "myhub", "cert", "AAAAAAAADGk=", Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesGenerateVerificationCodeSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java similarity index 57% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesGenerateVerificationCodeSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java index 87884082a7290..0c8583ccd6ab5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesGenerateVerificationCodeSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java @@ -2,21 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for Certificates GenerateVerificationCode. */ public final class CertificatesGenerateVerificationCodeSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_generateverificationcode.json + */ /** * Sample code: Certificates_GenerateVerificationCode. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void certificatesGenerateVerificationCode( - com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void certificatesGenerateVerificationCode(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .certificates() .generateVerificationCodeWithResponse("myResourceGroup", "testHub", "cert", "AAAAAAAADGk=", Context.NONE); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java similarity index 50% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesGetSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java index 2d3fcc9a1b858..4f7a7206462e1 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for Certificates Get. */ public final class CertificatesGetSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getcertificate.json + */ /** * Sample code: Certificates_Get. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void certificatesGet(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.certificates().getWithResponse("myResourceGroup", "testhub", "cert", Context.NONE); + public static void certificatesGet(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.certificates().getWithResponse("myResourceGroup", "testhub", "cert", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesListByIotHubSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java similarity index 51% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesListByIotHubSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java index 0702493857deb..aabc53feb6b94 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesListByIotHubSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for Certificates ListByIotHub. */ public final class CertificatesListByIotHubSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listcertificates.json + */ /** * Sample code: Certificates_ListByIotHub. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void certificatesListByIotHub(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.certificates().listByIotHubWithResponse("myResourceGroup", "testhub", Context.NONE); + public static void certificatesListByIotHub(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.certificates().listByIotHubWithResponse("myResourceGroup", "testhub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesVerifySamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java similarity index 72% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesVerifySamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java index 44507e396bd04..4cce18d6795c7 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/CertificatesVerifySamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.CertificateVerificationDescription; /** Samples for Certificates Verify. */ public final class CertificatesVerifySamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_certverify.json + */ /** * Sample code: Certificates_Verify. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void certificatesVerify(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void certificatesVerify(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .certificates() .verifyWithResponse( "myResourceGroup", diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubManualFailoverSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java similarity index 67% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubManualFailoverSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java index 0f76dff0cd362..b2a4972a52f8a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubManualFailoverSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.FailoverInput; /** Samples for IotHub ManualFailover. */ public final class IotHubManualFailoverSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/IotHub_ManualFailover.json + */ /** * Sample code: IotHub_ManualFailover. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubManualFailover(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void iotHubManualFailover(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubs() .manualFailover( "testHub", "myResourceGroup", new FailoverInput().withFailoverRegion("testHub"), Context.NONE); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCheckNameAvailabilitySamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java similarity index 60% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCheckNameAvailabilitySamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java index f6f6b5be5bc05..a95ce030e37c6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCheckNameAvailabilitySamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java @@ -2,22 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.OperationInputs; /** Samples for IotHubResource CheckNameAvailability. */ public final class IotHubResourceCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/checkNameAvailability.json + */ /** * Sample code: IotHubResource_CheckNameAvailability. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceCheckNameAvailability( - com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void iotHubResourceCheckNameAvailability(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .checkNameAvailabilityWithResponse(new OperationInputs().withName("test-request"), Context.NONE); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCreateEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java similarity index 69% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCreateEventHubConsumerGroupSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java index c50e2884405f6..436e11ad93abe 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCreateEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupName; /** Samples for IotHubResource CreateEventHubConsumerGroup. */ public final class IotHubResourceCreateEventHubConsumerGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_createconsumergroup.json + */ /** * Sample code: IotHubResource_CreateEventHubConsumerGroup. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ public static void iotHubResourceCreateEventHubConsumerGroup( - com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .defineEventHubConsumerGroup("test") .withExistingEventHubEndpoint("myResourceGroup", "testHub", "events") diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCreateOrUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java similarity index 94% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCreateOrUpdateSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java index b77ef5aa7937f..cec561bd563b3 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceCreateOrUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.resourcemanager.iothub.models.Capabilities; import com.azure.resourcemanager.iothub.models.CloudToDeviceProperties; @@ -28,14 +28,16 @@ /** Samples for IotHubResource CreateOrUpdate. */ public final class IotHubResourceCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_createOrUpdate.json + */ /** * Sample code: IotHubResource_CreateOrUpdate. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceCreateOrUpdate(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void iotHubResourceCreateOrUpdate(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .define("testHub") .withRegion("centraluseuap") diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceDeleteEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java similarity index 64% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceDeleteEventHubConsumerGroupSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java index cc42e72228865..21c7527a60fca 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceDeleteEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource DeleteEventHubConsumerGroup. */ public final class IotHubResourceDeleteEventHubConsumerGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_deleteconsumergroup.json + */ /** * Sample code: IotHubResource_DeleteEventHubConsumerGroup. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ public static void iotHubResourceDeleteEventHubConsumerGroup( - com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .deleteEventHubConsumerGroupWithResponse("myResourceGroup", "testHub", "events", "test", Context.NONE); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceDeleteSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java index d4305995d5b67..ddd77209bcadd 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceDeleteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource Delete. */ public final class IotHubResourceDeleteSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_delete.json + */ /** * Sample code: IotHubResource_Delete. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceDelete(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().delete("myResourceGroup", "testHub", Context.NONE); + public static void iotHubResourceDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().delete("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceExportDevicesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceExportDevicesSamples.java new file mode 100644 index 0000000000000..aa0c678e27636 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceExportDevicesSamples.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.iothub.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ExportDevicesRequest; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; + +/** Samples for IotHubResource ExportDevices. */ +public final class IotHubResourceExportDevicesSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_exportdevices.json + */ + /** + * Sample code: IotHubResource_ExportDevices. + * + * @param manager Entry point to IotHubManager. + */ + public static void iotHubResourceExportDevices(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager + .iotHubResources() + .exportDevicesWithResponse( + "myResourceGroup", + "testHub", + new ExportDevicesRequest() + .withExportBlobContainerUri("testBlob") + .withExcludeKeys(true) + .withAuthenticationType(AuthenticationType.IDENTITY_BASED) + .withIdentity( + new ManagedIdentity() + .withUserAssignedIdentity( + "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")), + Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetByResourceGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetByResourceGroupSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java index 1ed1d58717f00..50faab5a559b9 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetByResourceGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource GetByResourceGroup. */ public final class IotHubResourceGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_get.json + */ /** * Sample code: IotHubResource_Get. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceGet(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().getByResourceGroupWithResponse("myResourceGroup", "testHub", Context.NONE); + public static void iotHubResourceGet(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getByResourceGroupWithResponse("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetEndpointHealthSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetEndpointHealthSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java index 295a8e98f9a78..de0097e8b4ea5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetEndpointHealthSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource GetEndpointHealth. */ public final class IotHubResourceGetEndpointHealthSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_routingendpointhealth.json + */ /** * Sample code: IotHubResource_GetEndpointHealth. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceGetEndpointHealth(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().getEndpointHealth("myResourceGroup", "testHub", Context.NONE); + public static void iotHubResourceGetEndpointHealth(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getEndpointHealth("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java similarity index 64% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetEventHubConsumerGroupSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java index 64f4f96019c7e..99d893627d673 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource GetEventHubConsumerGroup. */ public final class IotHubResourceGetEventHubConsumerGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getconsumergroup.json + */ /** * Sample code: IotHubResource_ListEventHubConsumerGroups. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListEventHubConsumerGroups( - com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .getEventHubConsumerGroupWithResponse("myResourceGroup", "testHub", "events", "test", Context.NONE); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetJobSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java similarity index 51% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetJobSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java index 7486f17a7555b..c63d71f294cf0 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetJobSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource GetJob. */ public final class IotHubResourceGetJobSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getjob.json + */ /** * Sample code: IotHubResource_GetJob. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceGetJob(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().getJobWithResponse("myResourceGroup", "testHub", "test", Context.NONE); + public static void iotHubResourceGetJob(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getJobWithResponse("myResourceGroup", "testHub", "test", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetKeysForKeyNameSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java similarity index 64% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetKeysForKeyNameSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java index 8dcde0eb8bdb8..143f2fa8dae0c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetKeysForKeyNameSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource GetKeysForKeyName. */ public final class IotHubResourceGetKeysForKeyNameSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getkey.json + */ /** * Sample code: IotHubResource_GetKeysForKeyName. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceGetKeysForKeyName(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void iotHubResourceGetKeysForKeyName(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .getKeysForKeyNameWithResponse("myResourceGroup", "testHub", "iothubowner", Context.NONE); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetQuotaMetricsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetQuotaMetricsSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java index 76c998ca2d6af..6322f74e193ca 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetQuotaMetricsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource GetQuotaMetrics. */ public final class IotHubResourceGetQuotaMetricsSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_quotametrics.json + */ /** * Sample code: IotHubResource_GetQuotaMetrics. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceGetQuotaMetrics(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().getQuotaMetrics("myResourceGroup", "testHub", Context.NONE); + public static void iotHubResourceGetQuotaMetrics(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getQuotaMetrics("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetStatsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetStatsSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java index 7e621f73854a8..1cb2bedefd26f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetStatsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource GetStats. */ public final class IotHubResourceGetStatsSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_stats.json + */ /** * Sample code: IotHubResource_GetStats. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceGetStats(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().getStatsWithResponse("myResourceGroup", "testHub", Context.NONE); + public static void iotHubResourceGetStats(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getStatsWithResponse("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetValidSkusSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetValidSkusSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java index 3bd52d0650f69..4ae1420ea3078 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceGetValidSkusSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource GetValidSkus. */ public final class IotHubResourceGetValidSkusSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getskus.json + */ /** * Sample code: IotHubResource_GetValidSkus. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceGetValidSkus(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().getValidSkus("myResourceGroup", "testHub", Context.NONE); + public static void iotHubResourceGetValidSkus(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().getValidSkus("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceImportDevicesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java similarity index 71% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceImportDevicesSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java index f5e5f5191b3ad..aee86859b6181 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceImportDevicesSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; /** Samples for IotHubResource ImportDevices. */ public final class IotHubResourceImportDevicesSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_importdevices.json + */ /** * Sample code: IotHubResource_ImportDevices. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceImportDevices(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void iotHubResourceImportDevices(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .importDevicesWithResponse( "myResourceGroup", diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListByResourceGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java similarity index 53% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListByResourceGroupSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java index 9794c68b7e5c2..27930409aab95 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListByResourceGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource ListByResourceGroup. */ public final class IotHubResourceListByResourceGroupSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listbyrg.json + */ /** * Sample code: IotHubResource_ListByResourceGroup. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceListByResourceGroup(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().listByResourceGroup("myResourceGroup", Context.NONE); + public static void iotHubResourceListByResourceGroup(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().listByResourceGroup("myResourceGroup", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListEventHubConsumerGroupsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListEventHubConsumerGroupsSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java index 2935df9511f0c..cc5cf650e86ed 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListEventHubConsumerGroupsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java @@ -2,22 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource ListEventHubConsumerGroups. */ public final class IotHubResourceListEventHubConsumerGroupsSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listehgroups.json + */ /** * Sample code: IotHubResource_ListEventHubConsumerGroups. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListEventHubConsumerGroups( - com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager - .iotHubResources() - .listEventHubConsumerGroups("myResourceGroup", "testHub", "events", Context.NONE); + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().listEventHubConsumerGroups("myResourceGroup", "testHub", "events", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListJobsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListJobsSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java index 9f91894866281..ebdb34534d232 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListJobsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource ListJobs. */ public final class IotHubResourceListJobsSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listjobs.json + */ /** * Sample code: IotHubResource_ListJobs. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceListJobs(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().listJobs("myResourceGroup", "testHub", Context.NONE); + public static void iotHubResourceListJobs(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().listJobs("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListKeysSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java similarity index 52% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListKeysSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java index ec5d46cb37fe1..7361780211246 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListKeysSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource ListKeys. */ public final class IotHubResourceListKeysSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listkeys.json + */ /** * Sample code: IotHubResource_ListKeys. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceListKeys(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().listKeys("myResourceGroup", "testHub", Context.NONE); + public static void iotHubResourceListKeys(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().listKeys("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java similarity index 53% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java index ec790fd166b81..28b866e7b7ecf 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for IotHubResource List. */ public final class IotHubResourceListSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listbysubscription.json + */ /** * Sample code: IotHubResource_ListBySubscription. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceListBySubscription(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.iotHubResources().list(Context.NONE); + public static void iotHubResourceListBySubscription(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.iotHubResources().list(Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceTestAllRoutesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java similarity index 83% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceTestAllRoutesSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java index 484db25511086..1594193697313 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceTestAllRoutesSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.RoutingMessage; @@ -13,14 +13,16 @@ /** Samples for IotHubResource TestAllRoutes. */ public final class IotHubResourceTestAllRoutesSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_testallroutes.json + */ /** * Sample code: IotHubResource_TestAllRoutes. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceTestAllRoutes(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void iotHubResourceTestAllRoutes(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .testAllRoutesWithResponse( "testHub", diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceTestRouteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java similarity index 85% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceTestRouteSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java index d497a03203cff..c8e32c599192b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceTestRouteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.RouteProperties; @@ -15,14 +15,16 @@ /** Samples for IotHubResource TestRoute. */ public final class IotHubResourceTestRouteSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_testnewroute.json + */ /** * Sample code: IotHubResource_TestRoute. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceTestRoute(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void iotHubResourceTestRoute(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .iotHubResources() .testRouteWithResponse( "testHub", diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java similarity index 78% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceUpdateSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java index 17954f98bb9ff..840fe944406c4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/IotHubResourceUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.IotHubDescription; @@ -11,15 +11,17 @@ /** Samples for IotHubResource Update. */ public final class IotHubResourceUpdateSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_patch.json + */ /** * Sample code: IotHubResource_Update. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void iotHubResourceUpdate(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { + public static void iotHubResourceUpdate(com.azure.resourcemanager.iothub.IotHubManager manager) { IotHubDescription resource = - iotHubManager + manager .iotHubResources() .getByResourceGroupWithResponse("myResourceGroup", "myHub", Context.NONE) .getValue(); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/OperationsListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java similarity index 54% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/OperationsListSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java index 3d4939b57565c..2e69f762eecf0 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/OperationsListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for Operations List. */ public final class OperationsListSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_operations.json + */ /** * Sample code: Operations_List. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void operationsList(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.operations().list(Context.NONE); + public static void operationsList(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.operations().list(Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java similarity index 63% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsDeleteSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java index 342fc9aa1ebaa..60eeec3b94843 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_deleteprivateendpointconnection.json + */ /** * Sample code: PrivateEndpointConnection_Delete. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void privateEndpointConnectionDelete(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void privateEndpointConnectionDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .privateEndpointConnections() .delete("myResourceGroup", "testHub", "myPrivateEndpointConnection", Context.NONE); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java similarity index 63% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsGetSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java index a06bfcc81844d..61d28ddd3a0f4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getprivateendpointconnection.json + */ /** * Sample code: PrivateEndpointConnection_Get. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void privateEndpointConnectionGet(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void privateEndpointConnectionGet(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .privateEndpointConnections() .getWithResponse("myResourceGroup", "testHub", "myPrivateEndpointConnection", Context.NONE); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java similarity index 51% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsListSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java index 7c3cfad469fd9..605eeb28d9b72 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for PrivateEndpointConnections List. */ public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listprivateendpointconnections.json + */ /** * Sample code: PrivateEndpointConnections_List. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void privateEndpointConnectionsList(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.privateEndpointConnections().listWithResponse("myResourceGroup", "testHub", Context.NONE); + public static void privateEndpointConnectionsList(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.privateEndpointConnections().listWithResponse("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java similarity index 80% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsUpdateSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java index 3d53b21e49dc5..8f8f6d6198d1e 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateEndpointConnectionsUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; @@ -12,14 +12,16 @@ /** Samples for PrivateEndpointConnections Update. */ public final class PrivateEndpointConnectionsUpdateSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_updateprivateendpointconnection.json + */ /** * Sample code: PrivateEndpointConnection_Update. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void privateEndpointConnectionUpdate(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager + public static void privateEndpointConnectionUpdate(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager .privateEndpointConnections() .update( "myResourceGroup", diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateLinkResourcesOperationGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java similarity index 50% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateLinkResourcesOperationGetSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java index e036c409e1268..9f9fb52d25889 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateLinkResourcesOperationGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java @@ -2,21 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for PrivateLinkResourcesOperation Get. */ public final class PrivateLinkResourcesOperationGetSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_getprivatelinkresources.json + */ /** * Sample code: PrivateLinkResources_List. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager - .privateLinkResourcesOperations() - .getWithResponse("myResourceGroup", "testHub", "iotHub", Context.NONE); + public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.privateLinkResourcesOperations().getWithResponse("myResourceGroup", "testHub", "iotHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateLinkResourcesOperationListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java similarity index 51% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateLinkResourcesOperationListSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java index c7c74de63bb03..b4eab04af9bfa 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/PrivateLinkResourcesOperationListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for PrivateLinkResourcesOperation List. */ public final class PrivateLinkResourcesOperationListSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_listprivatelinkresources.json + */ /** * Sample code: PrivateLinkResources_List. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ - public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.privateLinkResourcesOperations().listWithResponse("myResourceGroup", "testHub", Context.NONE); + public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.privateLinkResourcesOperations().listWithResponse("myResourceGroup", "testHub", Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/ResourceProviderCommonGetSubscriptionQuotaSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java similarity index 54% rename from sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/ResourceProviderCommonGetSubscriptionQuotaSamples.java rename to sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java index 2ba9a097bfe30..0c70f9a3fb8d5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/ResourceProviderCommonGetSubscriptionQuotaSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.iothub; +package com.azure.resourcemanager.iothub.generated; import com.azure.core.util.Context; /** Samples for ResourceProviderCommon GetSubscriptionQuota. */ public final class ResourceProviderCommonGetSubscriptionQuotaSamples { + /* + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2021-07-01-preview/examples/iothub_usages.json + */ /** * Sample code: ResourceProviderCommon_GetSubscriptionQuota. * - * @param iotHubManager Entry point to IotHubManager. Use this API to manage the IoT hubs in your Azure - * subscription. + * @param manager Entry point to IotHubManager. */ public static void resourceProviderCommonGetSubscriptionQuota( - com.azure.resourcemanager.iothub.IotHubManager iotHubManager) { - iotHubManager.resourceProviderCommons().getSubscriptionQuotaWithResponse(Context.NONE); + com.azure.resourcemanager.iothub.IotHubManager manager) { + manager.resourceProviderCommons().getSubscriptionQuotaWithResponse(Context.NONE); } }