diff --git a/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md b/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md index e184a4b1e222..9ca9bf5b5ae2 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md +++ b/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md @@ -1,14 +1,17 @@ # Release History -## 1.2.0-beta.3 (Unreleased) +## 1.2.0-beta.3 (2023-04-18) + +- 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-2022-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.IpVersion` was added -### Bugs Fixed +#### `models.IotHubProperties` was modified -### Other Changes +* `ipVersion()` was added +* `withIpVersion(models.IpVersion)` was added ## 1.2.0-beta.2 (2022-08-23) diff --git a/sdk/iothub/azure-resourcemanager-iothub/README.md b/sdk/iothub/azure-resourcemanager-iothub/README.md index 9cb71f2cd7fa..bd0264c77073 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-preview-2022-04-30. 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-2022-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-iothub - 1.2.0-beta.2 + 1.2.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md b/sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md index 48e37e68b982..32f34ea03892 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md +++ b/sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md @@ -67,7 +67,7 @@ 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/2022-04-30-preview/examples/iothub_certificatescreateorupdate.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certificatescreateorupdate.json */ /** * Sample code: Certificates_CreateOrUpdate. @@ -88,12 +88,10 @@ public final class CertificatesCreateOrUpdateSamples { ### 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/2022-04-30-preview/examples/iothub_certificatesdelete.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certificatesdelete.json */ /** * Sample code: Certificates_Delete. @@ -101,7 +99,9 @@ public final class CertificatesDeleteSamples { * @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); + manager + .certificates() + .deleteWithResponse("myResourceGroup", "myhub", "cert", "AAAAAAAADGk=", com.azure.core.util.Context.NONE); } } ``` @@ -109,12 +109,10 @@ public final class CertificatesDeleteSamples { ### 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/2022-04-30-preview/examples/iothub_generateverificationcode.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_generateverificationcode.json */ /** * Sample code: Certificates_GenerateVerificationCode. @@ -124,7 +122,8 @@ public final class CertificatesGenerateVerificationCodeSamples { public static void certificatesGenerateVerificationCode(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .certificates() - .generateVerificationCodeWithResponse("myResourceGroup", "testHub", "cert", "AAAAAAAADGk=", Context.NONE); + .generateVerificationCodeWithResponse( + "myResourceGroup", "testHub", "cert", "AAAAAAAADGk=", com.azure.core.util.Context.NONE); } } ``` @@ -132,12 +131,10 @@ public final class CertificatesGenerateVerificationCodeSamples { ### 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/2022-04-30-preview/examples/iothub_getcertificate.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getcertificate.json */ /** * Sample code: Certificates_Get. @@ -145,7 +142,7 @@ public final class CertificatesGetSamples { * @param manager Entry point to IotHubManager. */ public static void certificatesGet(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.certificates().getWithResponse("myResourceGroup", "testhub", "cert", Context.NONE); + manager.certificates().getWithResponse("myResourceGroup", "testhub", "cert", com.azure.core.util.Context.NONE); } } ``` @@ -153,12 +150,10 @@ public final class CertificatesGetSamples { ### 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/2022-04-30-preview/examples/iothub_listcertificates.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listcertificates.json */ /** * Sample code: Certificates_ListByIotHub. @@ -166,7 +161,7 @@ public final class CertificatesListByIotHubSamples { * @param manager Entry point to IotHubManager. */ public static void certificatesListByIotHub(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.certificates().listByIotHubWithResponse("myResourceGroup", "testhub", Context.NONE); + manager.certificates().listByIotHubWithResponse("myResourceGroup", "testhub", com.azure.core.util.Context.NONE); } } ``` @@ -174,13 +169,12 @@ public final class CertificatesListByIotHubSamples { ### 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/2022-04-30-preview/examples/iothub_certverify.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certverify.json */ /** * Sample code: Certificates_Verify. @@ -196,7 +190,7 @@ public final class CertificatesVerifySamples { "cert", "AAAAAAAADGk=", new CertificateVerificationDescription().withCertificate("#####################################"), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -204,13 +198,12 @@ public final class CertificatesVerifySamples { ### 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/2022-04-30-preview/examples/IotHub_ManualFailover.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/IotHub_ManualFailover.json */ /** * Sample code: IotHub_ManualFailover. @@ -221,7 +214,10 @@ public final class IotHubManualFailoverSamples { manager .iotHubs() .manualFailover( - "testHub", "myResourceGroup", new FailoverInput().withFailoverRegion("testHub"), Context.NONE); + "testHub", + "myResourceGroup", + new FailoverInput().withFailoverRegion("testHub"), + com.azure.core.util.Context.NONE); } } ``` @@ -229,13 +225,12 @@ public final class IotHubManualFailoverSamples { ### 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/2022-04-30-preview/examples/checkNameAvailability.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/checkNameAvailability.json */ /** * Sample code: IotHubResource_CheckNameAvailability. @@ -245,7 +240,8 @@ public final class IotHubResourceCheckNameAvailabilitySamples { public static void iotHubResourceCheckNameAvailability(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .iotHubResources() - .checkNameAvailabilityWithResponse(new OperationInputs().withName("test-request"), Context.NONE); + .checkNameAvailabilityWithResponse( + new OperationInputs().withName("test-request"), com.azure.core.util.Context.NONE); } } ``` @@ -258,7 +254,7 @@ 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/2022-04-30-preview/examples/iothub_createconsumergroup.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_createconsumergroup.json */ /** * Sample code: IotHubResource_CreateEventHubConsumerGroup. @@ -289,6 +285,7 @@ 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.IpVersion; import com.azure.resourcemanager.iothub.models.MessagingEndpointProperties; import com.azure.resourcemanager.iothub.models.NetworkRuleIpAction; import com.azure.resourcemanager.iothub.models.NetworkRuleSetIpRule; @@ -306,7 +303,7 @@ import java.util.Map; /** Samples for IotHubResource CreateOrUpdate. */ public final class IotHubResourceCreateOrUpdateSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_createOrUpdate.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_createOrUpdate.json */ /** * Sample code: IotHubResource_CreateOrUpdate. @@ -385,7 +382,8 @@ public final class IotHubResourceCreateOrUpdateSamples { .withMaxDeliveryCount(10))) .withFeatures(Capabilities.NONE) .withEnableDataResidency(true) - .withRootCertificate(new RootCertificateProperties().withEnableRootCertificateV2(true))) + .withRootCertificate(new RootCertificateProperties().withEnableRootCertificateV2(true)) + .withIpVersion(IpVersion.IPV4IPV6)) .create(); } @@ -405,12 +403,10 @@ public final class IotHubResourceCreateOrUpdateSamples { ### 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/2022-04-30-preview/examples/iothub_delete.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_delete.json */ /** * Sample code: IotHubResource_Delete. @@ -418,7 +414,7 @@ public final class IotHubResourceDeleteSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().delete("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().delete("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -426,12 +422,10 @@ public final class IotHubResourceDeleteSamples { ### 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/2022-04-30-preview/examples/iothub_deleteconsumergroup.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_deleteconsumergroup.json */ /** * Sample code: IotHubResource_DeleteEventHubConsumerGroup. @@ -442,7 +436,8 @@ public final class IotHubResourceDeleteEventHubConsumerGroupSamples { com.azure.resourcemanager.iothub.IotHubManager manager) { manager .iotHubResources() - .deleteEventHubConsumerGroupWithResponse("myResourceGroup", "testHub", "events", "test", Context.NONE); + .deleteEventHubConsumerGroupWithResponse( + "myResourceGroup", "testHub", "events", "test", com.azure.core.util.Context.NONE); } } ``` @@ -450,7 +445,6 @@ public final class IotHubResourceDeleteEventHubConsumerGroupSamples { ### 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; @@ -458,7 +452,7 @@ 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/2022-04-30-preview/examples/iothub_exportdevices.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_exportdevices.json */ /** * Sample code: IotHubResource_ExportDevices. @@ -479,7 +473,7 @@ public final class IotHubResourceExportDevicesSamples { new ManagedIdentity() .withUserAssignedIdentity( "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -487,12 +481,10 @@ public final class IotHubResourceExportDevicesSamples { ### 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/2022-04-30-preview/examples/iothub_get.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_get.json */ /** * Sample code: IotHubResource_Get. @@ -500,7 +492,9 @@ public final class IotHubResourceGetByResourceGroupSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGet(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getByResourceGroupWithResponse("myResourceGroup", "testHub", Context.NONE); + manager + .iotHubResources() + .getByResourceGroupWithResponse("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -508,12 +502,10 @@ public final class IotHubResourceGetByResourceGroupSamples { ### 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/2022-04-30-preview/examples/iothub_routingendpointhealth.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_routingendpointhealth.json */ /** * Sample code: IotHubResource_GetEndpointHealth. @@ -521,7 +513,7 @@ public final class IotHubResourceGetEndpointHealthSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetEndpointHealth(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getEndpointHealth("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().getEndpointHealth("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -529,12 +521,10 @@ public final class IotHubResourceGetEndpointHealthSamples { ### 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/2022-04-30-preview/examples/iothub_getconsumergroup.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getconsumergroup.json */ /** * Sample code: IotHubResource_ListEventHubConsumerGroups. @@ -545,7 +535,8 @@ public final class IotHubResourceGetEventHubConsumerGroupSamples { com.azure.resourcemanager.iothub.IotHubManager manager) { manager .iotHubResources() - .getEventHubConsumerGroupWithResponse("myResourceGroup", "testHub", "events", "test", Context.NONE); + .getEventHubConsumerGroupWithResponse( + "myResourceGroup", "testHub", "events", "test", com.azure.core.util.Context.NONE); } } ``` @@ -553,12 +544,10 @@ public final class IotHubResourceGetEventHubConsumerGroupSamples { ### 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/2022-04-30-preview/examples/iothub_getjob.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getjob.json */ /** * Sample code: IotHubResource_GetJob. @@ -566,7 +555,9 @@ public final class IotHubResourceGetJobSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetJob(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getJobWithResponse("myResourceGroup", "testHub", "test", Context.NONE); + manager + .iotHubResources() + .getJobWithResponse("myResourceGroup", "testHub", "test", com.azure.core.util.Context.NONE); } } ``` @@ -574,12 +565,10 @@ public final class IotHubResourceGetJobSamples { ### 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/2022-04-30-preview/examples/iothub_getkey.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getkey.json */ /** * Sample code: IotHubResource_GetKeysForKeyName. @@ -589,7 +578,8 @@ public final class IotHubResourceGetKeysForKeyNameSamples { public static void iotHubResourceGetKeysForKeyName(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .iotHubResources() - .getKeysForKeyNameWithResponse("myResourceGroup", "testHub", "iothubowner", Context.NONE); + .getKeysForKeyNameWithResponse( + "myResourceGroup", "testHub", "iothubowner", com.azure.core.util.Context.NONE); } } ``` @@ -597,12 +587,10 @@ public final class IotHubResourceGetKeysForKeyNameSamples { ### 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/2022-04-30-preview/examples/iothub_quotametrics.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_quotametrics.json */ /** * Sample code: IotHubResource_GetQuotaMetrics. @@ -610,7 +598,7 @@ public final class IotHubResourceGetQuotaMetricsSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetQuotaMetrics(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getQuotaMetrics("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().getQuotaMetrics("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -618,12 +606,10 @@ public final class IotHubResourceGetQuotaMetricsSamples { ### 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/2022-04-30-preview/examples/iothub_stats.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_stats.json */ /** * Sample code: IotHubResource_GetStats. @@ -631,7 +617,7 @@ public final class IotHubResourceGetStatsSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetStats(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getStatsWithResponse("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().getStatsWithResponse("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -639,12 +625,10 @@ public final class IotHubResourceGetStatsSamples { ### 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/2022-04-30-preview/examples/iothub_getskus.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getskus.json */ /** * Sample code: IotHubResource_GetValidSkus. @@ -652,7 +636,7 @@ public final class IotHubResourceGetValidSkusSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetValidSkus(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getValidSkus("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().getValidSkus("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -660,13 +644,12 @@ public final class IotHubResourceGetValidSkusSamples { ### 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/2022-04-30-preview/examples/iothub_importdevices.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_importdevices.json */ /** * Sample code: IotHubResource_ImportDevices. @@ -680,7 +663,7 @@ public final class IotHubResourceImportDevicesSamples { "myResourceGroup", "testHub", new ImportDevicesRequest().withInputBlobContainerUri("testBlob").withOutputBlobContainerUri("testBlob"), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -688,12 +671,10 @@ public final class IotHubResourceImportDevicesSamples { ### 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/2022-04-30-preview/examples/iothub_listbysubscription.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listbysubscription.json */ /** * Sample code: IotHubResource_ListBySubscription. @@ -701,7 +682,7 @@ public final class IotHubResourceListSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListBySubscription(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().list(Context.NONE); + manager.iotHubResources().list(com.azure.core.util.Context.NONE); } } ``` @@ -709,12 +690,10 @@ public final class IotHubResourceListSamples { ### 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/2022-04-30-preview/examples/iothub_listbyrg.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listbyrg.json */ /** * Sample code: IotHubResource_ListByResourceGroup. @@ -722,7 +701,7 @@ public final class IotHubResourceListByResourceGroupSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListByResourceGroup(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().listByResourceGroup("myResourceGroup", Context.NONE); + manager.iotHubResources().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); } } ``` @@ -730,12 +709,10 @@ public final class IotHubResourceListByResourceGroupSamples { ### 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/2022-04-30-preview/examples/iothub_listehgroups.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listehgroups.json */ /** * Sample code: IotHubResource_ListEventHubConsumerGroups. @@ -744,7 +721,9 @@ public final class IotHubResourceListEventHubConsumerGroupsSamples { */ public static void iotHubResourceListEventHubConsumerGroups( com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().listEventHubConsumerGroups("myResourceGroup", "testHub", "events", Context.NONE); + manager + .iotHubResources() + .listEventHubConsumerGroups("myResourceGroup", "testHub", "events", com.azure.core.util.Context.NONE); } } ``` @@ -752,12 +731,10 @@ public final class IotHubResourceListEventHubConsumerGroupsSamples { ### 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/2022-04-30-preview/examples/iothub_listjobs.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listjobs.json */ /** * Sample code: IotHubResource_ListJobs. @@ -765,7 +742,7 @@ public final class IotHubResourceListJobsSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListJobs(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().listJobs("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().listJobs("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -773,12 +750,10 @@ public final class IotHubResourceListJobsSamples { ### 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/2022-04-30-preview/examples/iothub_listkeys.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listkeys.json */ /** * Sample code: IotHubResource_ListKeys. @@ -786,7 +761,7 @@ public final class IotHubResourceListKeysSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListKeys(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().listKeys("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().listKeys("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -794,7 +769,6 @@ public final class IotHubResourceListKeysSamples { ### 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; @@ -804,7 +778,7 @@ import java.util.Map; /** Samples for IotHubResource TestAllRoutes. */ public final class IotHubResourceTestAllRoutesSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_testallroutes.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_testallroutes.json */ /** * Sample code: IotHubResource_TestAllRoutes. @@ -824,7 +798,7 @@ public final class IotHubResourceTestAllRoutesSamples { .withBody("Body of message") .withAppProperties(mapOf("key1", "value1")) .withSystemProperties(mapOf("key1", "value1"))), - Context.NONE); + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -843,7 +817,6 @@ public final class IotHubResourceTestAllRoutesSamples { ### 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; @@ -855,7 +828,7 @@ import java.util.Map; /** Samples for IotHubResource TestRoute. */ public final class IotHubResourceTestRouteSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_testnewroute.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_testnewroute.json */ /** * Sample code: IotHubResource_TestRoute. @@ -880,7 +853,7 @@ public final class IotHubResourceTestRouteSamples { .withSource(RoutingSource.DEVICE_MESSAGES) .withEndpointNames(Arrays.asList("id1")) .withIsEnabled(true)), - Context.NONE); + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") @@ -899,7 +872,6 @@ public final class IotHubResourceTestRouteSamples { ### IotHubResource_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.IotHubDescription; import java.util.HashMap; import java.util.Map; @@ -907,7 +879,7 @@ import java.util.Map; /** Samples for IotHubResource Update. */ public final class IotHubResourceUpdateSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_patch.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_patch.json */ /** * Sample code: IotHubResource_Update. @@ -918,7 +890,7 @@ public final class IotHubResourceUpdateSamples { IotHubDescription resource = manager .iotHubResources() - .getByResourceGroupWithResponse("myResourceGroup", "myHub", Context.NONE) + .getByResourceGroupWithResponse("myResourceGroup", "myHub", com.azure.core.util.Context.NONE) .getValue(); resource.update().withTags(mapOf("foo", "bar")).apply(); } @@ -939,12 +911,10 @@ public final class IotHubResourceUpdateSamples { ### 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/2022-04-30-preview/examples/iothub_operations.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_operations.json */ /** * Sample code: Operations_List. @@ -952,7 +922,7 @@ public final class OperationsListSamples { * @param manager Entry point to IotHubManager. */ public static void operationsList(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -960,12 +930,10 @@ public final class OperationsListSamples { ### 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/2022-04-30-preview/examples/iothub_deleteprivateendpointconnection.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_deleteprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Delete. @@ -975,7 +943,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { public static void privateEndpointConnectionDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .privateEndpointConnections() - .delete("myResourceGroup", "testHub", "myPrivateEndpointConnection", Context.NONE); + .delete("myResourceGroup", "testHub", "myPrivateEndpointConnection", com.azure.core.util.Context.NONE); } } ``` @@ -983,12 +951,10 @@ public final class PrivateEndpointConnectionsDeleteSamples { ### 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/2022-04-30-preview/examples/iothub_getprivateendpointconnection.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Get. @@ -998,7 +964,8 @@ public final class PrivateEndpointConnectionsGetSamples { public static void privateEndpointConnectionGet(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .privateEndpointConnections() - .getWithResponse("myResourceGroup", "testHub", "myPrivateEndpointConnection", Context.NONE); + .getWithResponse( + "myResourceGroup", "testHub", "myPrivateEndpointConnection", com.azure.core.util.Context.NONE); } } ``` @@ -1006,12 +973,10 @@ public final class PrivateEndpointConnectionsGetSamples { ### 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/2022-04-30-preview/examples/iothub_listprivateendpointconnections.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listprivateendpointconnections.json */ /** * Sample code: PrivateEndpointConnections_List. @@ -1019,7 +984,9 @@ public final class PrivateEndpointConnectionsListSamples { * @param manager Entry point to IotHubManager. */ public static void privateEndpointConnectionsList(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.privateEndpointConnections().listWithResponse("myResourceGroup", "testHub", Context.NONE); + manager + .privateEndpointConnections() + .listWithResponse("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -1027,7 +994,6 @@ public final class PrivateEndpointConnectionsListSamples { ### 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; @@ -1036,7 +1002,7 @@ import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionStatu /** Samples for PrivateEndpointConnections Update. */ public final class PrivateEndpointConnectionsUpdateSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_updateprivateendpointconnection.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_updateprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Update. @@ -1057,7 +1023,7 @@ public final class PrivateEndpointConnectionsUpdateSamples { new PrivateLinkServiceConnectionState() .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) .withDescription("Approved by johndoe@contoso.com"))), - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1065,12 +1031,10 @@ public final class PrivateEndpointConnectionsUpdateSamples { ### 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/2022-04-30-preview/examples/iothub_getprivatelinkresources.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getprivatelinkresources.json */ /** * Sample code: PrivateLinkResources_List. @@ -1078,7 +1042,9 @@ public final class PrivateLinkResourcesOperationGetSamples { * @param manager Entry point to IotHubManager. */ public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.privateLinkResourcesOperations().getWithResponse("myResourceGroup", "testHub", "iotHub", Context.NONE); + manager + .privateLinkResourcesOperations() + .getWithResponse("myResourceGroup", "testHub", "iotHub", com.azure.core.util.Context.NONE); } } ``` @@ -1086,12 +1052,10 @@ public final class PrivateLinkResourcesOperationGetSamples { ### 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/2022-04-30-preview/examples/iothub_listprivatelinkresources.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listprivatelinkresources.json */ /** * Sample code: PrivateLinkResources_List. @@ -1099,7 +1063,9 @@ public final class PrivateLinkResourcesOperationListSamples { * @param manager Entry point to IotHubManager. */ public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.privateLinkResourcesOperations().listWithResponse("myResourceGroup", "testHub", Context.NONE); + manager + .privateLinkResourcesOperations() + .listWithResponse("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } ``` @@ -1107,12 +1073,10 @@ public final class PrivateLinkResourcesOperationListSamples { ### 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/2022-04-30-preview/examples/iothub_usages.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_usages.json */ /** * Sample code: ResourceProviderCommon_GetSubscriptionQuota. @@ -1121,7 +1085,7 @@ public final class ResourceProviderCommonGetSubscriptionQuotaSamples { */ public static void resourceProviderCommonGetSubscriptionQuota( com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.resourceProviderCommons().getSubscriptionQuotaWithResponse(Context.NONE); + manager.resourceProviderCommons().getSubscriptionQuotaWithResponse(com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/iothub/azure-resourcemanager-iothub/pom.xml b/sdk/iothub/azure-resourcemanager-iothub/pom.xml index 10c3d0173f67..acf2edd743cd 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/pom.xml +++ b/sdk/iothub/azure-resourcemanager-iothub/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,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-preview-2022-04-30. + 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-2022-11. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true @@ -51,6 +58,12 @@ azure-core-management 1.11.0 + + com.azure + azure-core-test + 1.16.1 + test + com.azure azure-identity @@ -58,15 +71,21 @@ test - com.azure.resourcemanager - azure-resourcemanager-resources - 2.25.0 + org.junit.jupiter + junit-jupiter-api + 5.9.1 test - com.azure - azure-core-test - 1.16.1 + org.junit.jupiter + junit-jupiter-engine + 5.9.1 + test + + + org.mockito + mockito-core + 4.11.0 test @@ -75,5 +94,11 @@ 1.7.36 test + + com.azure.resourcemanager + azure-resourcemanager-resources + 2.25.0 + 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 44c1d82f0bf6..0d0d7659ce21 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 @@ -227,7 +227,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi .append("-") .append("com.azure.resourcemanager.iothub") .append("/") - .append("1.2.0-beta.2"); + .append("1.2.0-beta.3"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java index 86c05595bbd8..5b7d861b8dc6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java @@ -22,14 +22,16 @@ public interface CertificatesClient { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the JSON-serialized array of Certificate objects. + * @return the JSON-serialized array of Certificate objects along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName); + Response listByIotHubWithResponse( + String resourceGroupName, String resourceName, Context context); /** * Get the certificate list. @@ -38,16 +40,14 @@ public interface CertificatesClient { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the JSON-serialized array of Certificate objects along with {@link Response}. + * @return the JSON-serialized array of Certificate objects. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listByIotHubWithResponse( - String resourceGroupName, String resourceName, Context context); + CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName); /** * Get the certificate. @@ -57,14 +57,16 @@ Response listByIotHubWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName); + Response getWithResponse( + String resourceGroupName, String resourceName, String certificateName, Context context); /** * Get the certificate. @@ -74,16 +76,14 @@ Response listByIotHubWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String resourceName, String certificateName, Context context); + CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName); /** * Upload the certificate to the IoT hub. @@ -94,18 +94,23 @@ Response getWithResponse( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param certificateDescription The certificate body. + * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update + * an existing certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateDescriptionInner createOrUpdate( + Response createOrUpdateWithResponse( String resourceGroupName, String resourceName, String certificateName, - CertificateDescriptionInner certificateDescription); + CertificateDescriptionInner certificateDescription, + String ifMatch, + Context context); /** * Upload the certificate to the IoT hub. @@ -116,23 +121,18 @@ CertificateDescriptionInner createOrUpdate( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param certificateDescription The certificate body. - * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update - * an existing certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( + CertificateDescriptionInner createOrUpdate( String resourceGroupName, String resourceName, String certificateName, - CertificateDescriptionInner certificateDescription, - String ifMatch, - Context context); + CertificateDescriptionInner certificateDescription); /** * Delete an X509 certificate. @@ -143,13 +143,16 @@ Response createOrUpdateWithResponse( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch); + Response deleteWithResponse( + String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context); /** * Delete an X509 certificate. @@ -160,16 +163,13 @@ Response createOrUpdateWithResponse( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context); + void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch); /** * Generate verification code for proof of possession flow. @@ -181,15 +181,16 @@ Response deleteWithResponse( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateWithNonceDescriptionInner generateVerificationCode( - String resourceGroupName, String resourceName, String certificateName, String ifMatch); + Response generateVerificationCodeWithResponse( + String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context); /** * Generate verification code for proof of possession flow. @@ -201,16 +202,15 @@ CertificateWithNonceDescriptionInner generateVerificationCode( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response generateVerificationCodeWithResponse( - String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context); + CertificateWithNonceDescriptionInner generateVerificationCode( + String resourceGroupName, String resourceName, String certificateName, String ifMatch); /** * Verify certificate's private key possession. @@ -223,19 +223,21 @@ Response generateVerificationCodeWithRespo * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. * @param certificateVerificationBody The name of the certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CertificateDescriptionInner verify( + Response verifyWithResponse( String resourceGroupName, String resourceName, String certificateName, String ifMatch, - CertificateVerificationDescription certificateVerificationBody); + CertificateVerificationDescription certificateVerificationBody, + Context context); /** * Verify certificate's private key possession. @@ -248,19 +250,17 @@ CertificateDescriptionInner verify( * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. * @param certificateVerificationBody The name of the certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response verifyWithResponse( + CertificateDescriptionInner verify( String resourceGroupName, String resourceName, String certificateName, String ifMatch, - CertificateVerificationDescription certificateVerificationBody, - Context context); + CertificateVerificationDescription certificateVerificationBody); } 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 232340cc1e30..b1d1f94aa9ba 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 @@ -39,14 +39,16 @@ public interface IotHubResourcesClient { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub. + * @return the non-security related metadata of an IoT hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IotHubDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName); + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); /** * Get the non-security related metadata of an IoT hub @@ -55,16 +57,14 @@ public interface IotHubResourcesClient { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub along with {@link Response}. + * @return the non-security related metadata of an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String resourceName, Context context); + IotHubDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName); /** * Create or update the metadata of an IoT hub. @@ -76,8 +76,6 @@ Response getByResourceGroupWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. @@ -86,7 +84,7 @@ Response getByResourceGroupWithResponse( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, IotHubDescriptionInner> beginCreateOrUpdate( - String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch); + String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription); /** * Create or update the metadata of an IoT hub. @@ -115,28 +113,6 @@ SyncPoller, IotHubDescriptionInner> beginCrea String ifMatch, Context context); - /** - * Create or update the metadata of an IoT hub. - * - *

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. - * - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by - * server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IotHubDescriptionInner createOrUpdate( - String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch); - /** * Create or update the metadata of an IoT hub. * @@ -387,14 +363,16 @@ SyncPoller, IotHubDescriptionInner> beginDele * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub. + * @return the statistics from an IoT hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RegistryStatisticsInner getStats(String resourceGroupName, String resourceName); + Response getStatsWithResponse( + String resourceGroupName, String resourceName, Context context); /** * Get the statistics from an IoT hub @@ -403,16 +381,14 @@ SyncPoller, IotHubDescriptionInner> beginDele * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub along with {@link Response}. + * @return the statistics from an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getStatsWithResponse( - String resourceGroupName, String resourceName, Context context); + RegistryStatisticsInner getStats(String resourceGroupName, String resourceName); /** * Get the list of valid SKUs for an IoT hub @@ -496,15 +472,17 @@ PagedIterable listEventHubConsumerGroups( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EventHubConsumerGroupInfoInner getEventHubConsumerGroup( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name); + Response getEventHubConsumerGroupWithResponse( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context); /** * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub @@ -515,17 +493,15 @@ EventHubConsumerGroupInfoInner getEventHubConsumerGroup( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with {@link - * Response}. + * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getEventHubConsumerGroupWithResponse( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context); + EventHubConsumerGroupInfoInner getEventHubConsumerGroup( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name); /** * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub @@ -537,19 +513,21 @@ Response getEventHubConsumerGroupWithResponse( * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to add. * @param consumerGroupBody The consumer group to add. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object. + * @return the properties of the EventHubConsumerGroupInfo object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - EventHubConsumerGroupInfoInner createEventHubConsumerGroup( + Response createEventHubConsumerGroupWithResponse( String resourceGroupName, String resourceName, String eventHubEndpointName, String name, - EventHubConsumerGroupBodyDescription consumerGroupBody); + EventHubConsumerGroupBodyDescription consumerGroupBody, + Context context); /** * Add a consumer group to an Event Hub-compatible endpoint in an IoT hub @@ -561,21 +539,19 @@ EventHubConsumerGroupInfoInner createEventHubConsumerGroup( * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to add. * @param consumerGroupBody The consumer group to add. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object along with {@link Response}. + * @return the properties of the EventHubConsumerGroupInfo object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createEventHubConsumerGroupWithResponse( + EventHubConsumerGroupInfoInner createEventHubConsumerGroup( String resourceGroupName, String resourceName, String eventHubEndpointName, String name, - EventHubConsumerGroupBodyDescription consumerGroupBody, - Context context); + EventHubConsumerGroupBodyDescription consumerGroupBody); /** * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub @@ -586,14 +562,16 @@ Response createEventHubConsumerGroupWithResponse * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteEventHubConsumerGroup( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name); + Response deleteEventHubConsumerGroupWithResponse( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context); /** * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub @@ -604,16 +582,14 @@ void deleteEventHubConsumerGroup( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteEventHubConsumerGroupWithResponse( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context); + void deleteEventHubConsumerGroup( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name); /** * Get a list of all the jobs in an IoT hub. For more information, see: @@ -662,14 +638,16 @@ Response deleteEventHubConsumerGroupWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param jobId The job identifier. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub. + * @return the details of a job from an IoT hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobResponseInner getJob(String resourceGroupName, String resourceName, String jobId); + Response getJobWithResponse( + String resourceGroupName, String resourceName, String jobId, Context context); /** * Get the details of a job from an IoT hub. For more information, see: @@ -681,16 +659,14 @@ Response deleteEventHubConsumerGroupWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param jobId The job identifier. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub along with {@link Response}. + * @return the details of a job from an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getJobWithResponse( - String resourceGroupName, String resourceName, String jobId, Context context); + JobResponseInner getJob(String resourceGroupName, String resourceName, String jobId); /** * Get the quota metrics for an IoT hub @@ -767,14 +743,16 @@ PagedIterable getEndpointHealth( * * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT hub to * check. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available. + * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - IotHubNameAvailabilityInfoInner checkNameAvailability(OperationInputs operationInputs); + Response checkNameAvailabilityWithResponse( + OperationInputs operationInputs, Context context); /** * Check if an IoT hub name is available @@ -783,16 +761,14 @@ PagedIterable getEndpointHealth( * * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT hub to * check. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. + * @return the properties indicating whether a given IoT hub name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse( - OperationInputs operationInputs, Context context); + IotHubNameAvailabilityInfoInner checkNameAvailability(OperationInputs operationInputs); /** * Test all routes @@ -802,14 +778,16 @@ Response checkNameAvailabilityWithResponse( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Input for testing all routes. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing all routes. + * @return result of testing all routes along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TestAllRoutesResultInner testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input); + Response testAllRoutesWithResponse( + String iotHubName, String resourceGroupName, TestAllRoutesInput input, Context context); /** * Test all routes @@ -819,16 +797,14 @@ Response checkNameAvailabilityWithResponse( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Input for testing all routes. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing all routes along with {@link Response}. + * @return result of testing all routes. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response testAllRoutesWithResponse( - String iotHubName, String resourceGroupName, TestAllRoutesInput input, Context context); + TestAllRoutesResultInner testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input); /** * Test the new route @@ -838,14 +814,16 @@ Response testAllRoutesWithResponse( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Route that needs to be tested. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing one route. + * @return result of testing one route along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TestRouteResultInner testRoute(String iotHubName, String resourceGroupName, TestRouteInput input); + Response testRouteWithResponse( + String iotHubName, String resourceGroupName, TestRouteInput input, Context context); /** * Test the new route @@ -855,16 +833,14 @@ Response testAllRoutesWithResponse( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Route that needs to be tested. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing one route along with {@link Response}. + * @return result of testing one route. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response testRouteWithResponse( - String iotHubName, String resourceGroupName, TestRouteInput input, Context context); + TestRouteResultInner testRoute(String iotHubName, String resourceGroupName, TestRouteInput input); /** * Get the security metadata for an IoT hub. For more information, see: @@ -914,15 +890,16 @@ PagedIterable listKeys( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param keyName The name of the shared access policy. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub. + * @return a shared access policy by name from an IoT hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName( - String resourceGroupName, String resourceName, String keyName); + Response getKeysForKeyNameWithResponse( + String resourceGroupName, String resourceName, String keyName, Context context); /** * Get a shared access policy by name from an IoT hub. For more information, see: @@ -934,16 +911,15 @@ SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param keyName The name of the shared access policy. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub along with {@link Response}. + * @return a shared access policy by name from an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getKeysForKeyNameWithResponse( - String resourceGroupName, String resourceName, String keyName, Context context); + SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName( + String resourceGroupName, String resourceName, String keyName); /** * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more @@ -957,15 +933,16 @@ Response getKeysForKeyNameWithRespo * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param exportDevicesParameters The parameters that specify the export devices operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. + * @return the properties of the Job Response object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobResponseInner exportDevices( - String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters); + Response exportDevicesWithResponse( + String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters, Context context); /** * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more @@ -979,16 +956,15 @@ JobResponseInner exportDevices( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. + * @return the properties of the Job Response object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response exportDevicesWithResponse( - String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters, Context context); + JobResponseInner exportDevices( + String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters); /** * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, @@ -1002,15 +978,16 @@ Response exportDevicesWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param importDevicesParameters The parameters that specify the import devices operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. + * @return the properties of the Job Response object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - JobResponseInner importDevices( - String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters); + Response importDevicesWithResponse( + String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, Context context); /** * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, @@ -1024,14 +1001,13 @@ JobResponseInner importDevices( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param importDevicesParameters The parameters that specify the import devices operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. + * @return the properties of the Job Response object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response importDevicesWithResponse( - String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, Context context); + JobResponseInner importDevices( + String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters); } 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 6a701e6f94e2..41246583c47a 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 @@ -22,14 +22,16 @@ public interface PrivateEndpointConnectionsClient { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for an IotHub. + * @return the list of private endpoint connections for an IotHub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - List list(String resourceGroupName, String resourceName); + Response> listWithResponse( + String resourceGroupName, String resourceName, Context context); /** * List private endpoint connections @@ -38,16 +40,14 @@ public interface PrivateEndpointConnectionsClient { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for an IotHub along with {@link Response}. + * @return the list of private endpoint connections for an IotHub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response> listWithResponse( - String resourceGroupName, String resourceName, Context context); + List list(String resourceGroupName, String resourceName); /** * Get private endpoint connection @@ -57,15 +57,16 @@ Response> listWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties. + * @return private endpoint connection properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionInner get( - String resourceGroupName, String resourceName, String privateEndpointConnectionName); + Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); /** * Get private endpoint connection @@ -75,16 +76,15 @@ PrivateEndpointConnectionInner get( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties along with {@link Response}. + * @return private endpoint connection properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnectionInner get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName); /** * Update private endpoint connection diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateLinkResourcesOperationsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateLinkResourcesOperationsClient.java index b6072ee9b95b..6cec15e84e68 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateLinkResourcesOperationsClient.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/PrivateLinkResourcesOperationsClient.java @@ -20,14 +20,16 @@ public interface PrivateLinkResourcesOperationsClient { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for an IotHub. + * @return the available private link resources for an IotHub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourcesInner list(String resourceGroupName, String resourceName); + Response listWithResponse( + String resourceGroupName, String resourceName, Context context); /** * List private link resources @@ -36,16 +38,14 @@ public interface PrivateLinkResourcesOperationsClient { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for an IotHub along with {@link Response}. + * @return the available private link resources for an IotHub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String resourceName, Context context); + PrivateLinkResourcesInner list(String resourceGroupName, String resourceName); /** * Get the specified private link resource @@ -55,14 +55,16 @@ Response listWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param groupId The name of the private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given IotHub. + * @return the specified private link resource for the given IotHub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - GroupIdInformationInner get(String resourceGroupName, String resourceName, String groupId); + Response getWithResponse( + String resourceGroupName, String resourceName, String groupId, Context context); /** * Get the specified private link resource @@ -72,14 +74,12 @@ Response listWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param groupId The name of the private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given IotHub along with {@link Response}. + * @return the specified private link resource for the given IotHub. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String resourceName, String groupId, Context context); + GroupIdInformationInner get(String resourceGroupName, String resourceName, String groupId); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/ResourceProviderCommonsClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/ResourceProviderCommonsClient.java index bce652fdbcee..cf2cfc785d90 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/ResourceProviderCommonsClient.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/ResourceProviderCommonsClient.java @@ -17,26 +17,26 @@ public interface ResourceProviderCommonsClient { * *

Get the number of free and paid iot hubs in the subscription. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of free and paid iot hubs in the subscription. + * @return the number of free and paid iot hubs in the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - UserSubscriptionQuotaListResultInner getSubscriptionQuota(); + Response getSubscriptionQuotaWithResponse(Context context); /** * Get the number of iot hubs in the subscription * *

Get the number of free and paid iot hubs in the subscription. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of free and paid iot hubs in the subscription along with {@link Response}. + * @return the number of free and paid iot hubs in the subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getSubscriptionQuotaWithResponse(Context context); + UserSubscriptionQuotaListResultInner getSubscriptionQuota(); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateDescriptionInner.java index 9a279107e23d..5029f8127414 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateDescriptionInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateDescriptionInner.java @@ -24,6 +24,10 @@ public final class CertificateDescriptionInner extends ProxyResource { @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /** Creates an instance of CertificateDescriptionInner class. */ + public CertificateDescriptionInner() { + } + /** * Get the properties property: The description of an X509 CA Certificate. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateListDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateListDescriptionInner.java index 224446fc9059..38978a03b38b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateListDescriptionInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateListDescriptionInner.java @@ -17,6 +17,10 @@ public final class CertificateListDescriptionInner { @JsonProperty(value = "value") private List value; + /** Creates an instance of CertificateListDescriptionInner class. */ + public CertificateListDescriptionInner() { + } + /** * Get the value property: The array of Certificate objects. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateWithNonceDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateWithNonceDescriptionInner.java index f4660a738d8d..6bd0db9900ef 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateWithNonceDescriptionInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/CertificateWithNonceDescriptionInner.java @@ -24,6 +24,10 @@ public final class CertificateWithNonceDescriptionInner extends ProxyResource { @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /** Creates an instance of CertificateWithNonceDescriptionInner class. */ + public CertificateWithNonceDescriptionInner() { + } + /** * Get the properties property: The description of an X509 CA Certificate including the challenge nonce issued for * the Proof-Of-Possession flow. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EndpointHealthDataInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EndpointHealthDataInner.java index b019ff304074..8670be2531c6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EndpointHealthDataInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/EndpointHealthDataInner.java @@ -55,6 +55,10 @@ public final class EndpointHealthDataInner { @JsonProperty(value = "lastSendAttemptTime") private DateTimeRfc1123 lastSendAttemptTime; + /** Creates an instance of EndpointHealthDataInner class. */ + public EndpointHealthDataInner() { + } + /** * Get the endpointId property: Id of the endpoint. * 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 3f31cc5a8b65..dfe6c896c944 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 @@ -26,6 +26,10 @@ public final class EventHubConsumerGroupInfoInner extends ProxyResource { @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /** Creates an instance of EventHubConsumerGroupInfoInner class. */ + public EventHubConsumerGroupInfoInner() { + } + /** * Get the properties property: The tags. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/GroupIdInformationInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/GroupIdInformationInner.java index 9b709713887e..f65727faa6c2 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/GroupIdInformationInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/GroupIdInformationInner.java @@ -36,6 +36,10 @@ public final class GroupIdInformationInner { @JsonProperty(value = "properties", required = true) private GroupIdInformationProperties properties; + /** Creates an instance of GroupIdInformationInner class. */ + public GroupIdInformationInner() { + } + /** * Get the id property: The resource identifier. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubDescriptionInner.java index 0aa1cf7d3ba5..3903fcd46fae 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubDescriptionInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubDescriptionInner.java @@ -48,6 +48,10 @@ public final class IotHubDescriptionInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /** Creates an instance of IotHubDescriptionInner class. */ + public IotHubDescriptionInner() { + } + /** * Get the etag property: The Etag field is *not* required. If it is provided in the response body, it must also be * provided as a header per the normal ETag convention. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubNameAvailabilityInfoInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubNameAvailabilityInfoInner.java index 220c14db378b..21ddc7a0d922 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubNameAvailabilityInfoInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubNameAvailabilityInfoInner.java @@ -29,6 +29,10 @@ public final class IotHubNameAvailabilityInfoInner { @JsonProperty(value = "message") private String message; + /** Creates an instance of IotHubNameAvailabilityInfoInner class. */ + public IotHubNameAvailabilityInfoInner() { + } + /** * Get the nameAvailable property: The value which indicates whether the provided name is available. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubQuotaMetricInfoInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubQuotaMetricInfoInner.java index 84c9b471bbac..75d6ec425d34 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubQuotaMetricInfoInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubQuotaMetricInfoInner.java @@ -28,6 +28,10 @@ public final class IotHubQuotaMetricInfoInner { @JsonProperty(value = "maxValue", access = JsonProperty.Access.WRITE_ONLY) private Long maxValue; + /** Creates an instance of IotHubQuotaMetricInfoInner class. */ + public IotHubQuotaMetricInfoInner() { + } + /** * Get the name property: The name of the quota metric. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubSkuDescriptionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubSkuDescriptionInner.java index a0d9c52024a1..d4a09d1c9d44 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubSkuDescriptionInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/IotHubSkuDescriptionInner.java @@ -31,6 +31,10 @@ public final class IotHubSkuDescriptionInner { @JsonProperty(value = "capacity", required = true) private IotHubCapacity capacity; + /** Creates an instance of IotHubSkuDescriptionInner class. */ + public IotHubSkuDescriptionInner() { + } + /** * Get the resourceType property: The type of the resource. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/JobResponseInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/JobResponseInner.java index 2f9c443287c7..b3ff56066725 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/JobResponseInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/JobResponseInner.java @@ -62,6 +62,10 @@ public final class JobResponseInner { @JsonProperty(value = "parentJobId", access = JsonProperty.Access.WRITE_ONLY) private String parentJobId; + /** Creates an instance of JobResponseInner class. */ + public JobResponseInner() { + } + /** * Get the jobId property: The job identifier. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/OperationInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/OperationInner.java index fe3c409f1305..cbcd098a8212 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/OperationInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/OperationInner.java @@ -23,6 +23,10 @@ public final class OperationInner { @JsonProperty(value = "display") private OperationDisplay display; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the name property: Operation name: {provider}/{resource}/{read | write | action | delete}. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateEndpointConnectionInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateEndpointConnectionInner.java index 70ec1e4bb3fe..f547e63363a8 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateEndpointConnectionInner.java @@ -19,6 +19,10 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { @JsonProperty(value = "properties", required = true) private PrivateEndpointConnectionProperties properties; + /** Creates an instance of PrivateEndpointConnectionInner class. */ + public PrivateEndpointConnectionInner() { + } + /** * Get the properties property: The properties of a private endpoint connection. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateLinkResourcesInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateLinkResourcesInner.java index 6b642dedb9ef..bdf58e8fc5e2 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateLinkResourcesInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/PrivateLinkResourcesInner.java @@ -17,6 +17,10 @@ public final class PrivateLinkResourcesInner { @JsonProperty(value = "value") private List value; + /** Creates an instance of PrivateLinkResourcesInner class. */ + public PrivateLinkResourcesInner() { + } + /** * Get the value property: The list of available private link resources for an IotHub. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/RegistryStatisticsInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/RegistryStatisticsInner.java index 5188da0f6567..bb46abf9ca79 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/RegistryStatisticsInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/RegistryStatisticsInner.java @@ -28,6 +28,10 @@ public final class RegistryStatisticsInner { @JsonProperty(value = "disabledDeviceCount", access = JsonProperty.Access.WRITE_ONLY) private Long disabledDeviceCount; + /** Creates an instance of RegistryStatisticsInner class. */ + public RegistryStatisticsInner() { + } + /** * Get the totalDeviceCount property: The total count of devices in the identity registry. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/SharedAccessSignatureAuthorizationRuleInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/SharedAccessSignatureAuthorizationRuleInner.java index d7d38620b29f..82e956a3802c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/SharedAccessSignatureAuthorizationRuleInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/SharedAccessSignatureAuthorizationRuleInner.java @@ -36,6 +36,10 @@ public final class SharedAccessSignatureAuthorizationRuleInner { @JsonProperty(value = "rights", required = true) private AccessRights rights; + /** Creates an instance of SharedAccessSignatureAuthorizationRuleInner class. */ + public SharedAccessSignatureAuthorizationRuleInner() { + } + /** * Get the keyName property: The name of the shared access policy. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestAllRoutesResultInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestAllRoutesResultInner.java index d89d3d46ca99..6daf3997c419 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestAllRoutesResultInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestAllRoutesResultInner.java @@ -18,6 +18,10 @@ public final class TestAllRoutesResultInner { @JsonProperty(value = "routes") private List routes; + /** Creates an instance of TestAllRoutesResultInner class. */ + public TestAllRoutesResultInner() { + } + /** * Get the routes property: JSON-serialized array of matched routes. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestRouteResultInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestRouteResultInner.java index bd47269a717d..eb142e816b21 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestRouteResultInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/TestRouteResultInner.java @@ -24,6 +24,10 @@ public final class TestRouteResultInner { @JsonProperty(value = "details") private TestRouteResultDetails details; + /** Creates an instance of TestRouteResultInner class. */ + public TestRouteResultInner() { + } + /** * Get the result property: Result of testing route. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/UserSubscriptionQuotaListResultInner.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/UserSubscriptionQuotaListResultInner.java index 4e64d127c9bd..c797bddb3768 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/UserSubscriptionQuotaListResultInner.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/models/UserSubscriptionQuotaListResultInner.java @@ -24,6 +24,10 @@ public final class UserSubscriptionQuotaListResultInner { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of UserSubscriptionQuotaListResultInner class. */ + public UserSubscriptionQuotaListResultInner() { + } + /** * Get the value property: The value property. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java index d71cd21c22ae..958a850707e4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java @@ -57,11 +57,10 @@ public final class CertificatesClientImpl implements CertificatesClient { */ @Host("{$host}") @ServiceInterface(name = "IotHubClientCertific") - private interface CertificatesService { + public interface CertificatesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/certificates") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> listByIotHub( @@ -75,8 +74,7 @@ Mono> listByIotHub( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> get( @@ -91,8 +89,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> createOrUpdate( @@ -109,8 +106,7 @@ Mono> createOrUpdate( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/certificates/{certificateName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> delete( @@ -126,8 +122,7 @@ Mono> delete( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/certificates/{certificateName}/generateVerificationCode") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> generateVerificationCode( @@ -143,8 +138,7 @@ Mono> generateVerificationCode( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/certificates/{certificateName}/verify") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> verify( @@ -285,14 +279,16 @@ private Mono listByIotHubAsync(String resourceG * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the JSON-serialized array of Certificate objects. + * @return the JSON-serialized array of Certificate objects along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName) { - return listByIotHubAsync(resourceGroupName, resourceName).block(); + public Response listByIotHubWithResponse( + String resourceGroupName, String resourceName, Context context) { + return listByIotHubWithResponseAsync(resourceGroupName, resourceName, context).block(); } /** @@ -302,16 +298,14 @@ public CertificateListDescriptionInner listByIotHub(String resourceGroupName, St * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the JSON-serialized array of Certificate objects along with {@link Response}. + * @return the JSON-serialized array of Certificate objects. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByIotHubWithResponse( - String resourceGroupName, String resourceName, Context context) { - return listByIotHubWithResponseAsync(resourceGroupName, resourceName, context).block(); + public CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName) { + return listByIotHubWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); } /** @@ -452,14 +446,16 @@ private Mono getAsync( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName) { - return getAsync(resourceGroupName, resourceName, certificateName).block(); + public Response getWithResponse( + String resourceGroupName, String resourceName, String certificateName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, certificateName, context).block(); } /** @@ -470,16 +466,14 @@ public CertificateDescriptionInner get(String resourceGroupName, String resource * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String resourceName, String certificateName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, certificateName, context).block(); + public CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName) { + return getWithResponse(resourceGroupName, resourceName, certificateName, Context.NONE).getValue(); } /** @@ -634,8 +628,6 @@ private Mono> createOrUpdateWithResponseAs * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param certificateDescription The certificate body. - * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update - * an existing certificate. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -646,8 +638,8 @@ private Mono createOrUpdateAsync( String resourceGroupName, String resourceName, String certificateName, - CertificateDescriptionInner certificateDescription, - String ifMatch) { + CertificateDescriptionInner certificateDescription) { + final String ifMatch = null; return createOrUpdateWithResponseAsync( resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch) .flatMap(res -> Mono.justOrEmpty(res.getValue())); @@ -662,21 +654,25 @@ private Mono createOrUpdateAsync( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param certificateDescription The certificate body. + * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update + * an existing certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate on successful completion of {@link Mono}. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( + public Response createOrUpdateWithResponse( String resourceGroupName, String resourceName, String certificateName, - CertificateDescriptionInner certificateDescription) { - final String ifMatch = null; + CertificateDescriptionInner certificateDescription, + String ifMatch, + Context context) { return createOrUpdateWithResponseAsync( - resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch, context) + .block(); } /** @@ -700,38 +696,9 @@ public CertificateDescriptionInner createOrUpdate( String certificateName, CertificateDescriptionInner certificateDescription) { final String ifMatch = null; - return createOrUpdateAsync(resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch) - .block(); - } - - /** - * Upload the certificate to the IoT hub. - * - *

Adds new or replaces existing certificate. - * - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param certificateName The name of the certificate. - * @param certificateDescription The certificate body. - * @param ifMatch ETag of the Certificate. Do not specify for creating a brand new certificate. Required to update - * an existing certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String resourceName, - String certificateName, - CertificateDescriptionInner certificateDescription, - String ifMatch, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch, context) - .block(); + return createOrUpdateWithResponse( + resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch, Context.NONE) + .getValue(); } /** @@ -884,13 +851,16 @@ private Mono deleteAsync( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { - deleteAsync(resourceGroupName, resourceName, certificateName, ifMatch).block(); + public Response deleteWithResponse( + String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context) { + return deleteWithResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, context).block(); } /** @@ -902,16 +872,13 @@ public void delete(String resourceGroupName, String resourceName, String certifi * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context) { - return deleteWithResponseAsync(resourceGroupName, resourceName, certificateName, ifMatch, context).block(); + public void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + deleteWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, Context.NONE); } /** @@ -1068,15 +1035,18 @@ private Mono generateVerificationCodeAsync * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateWithNonceDescriptionInner generateVerificationCode( - String resourceGroupName, String resourceName, String certificateName, String ifMatch) { - return generateVerificationCodeAsync(resourceGroupName, resourceName, certificateName, ifMatch).block(); + public Response generateVerificationCodeWithResponse( + String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context) { + return generateVerificationCodeWithResponseAsync( + resourceGroupName, resourceName, certificateName, ifMatch, context) + .block(); } /** @@ -1089,18 +1059,17 @@ public CertificateWithNonceDescriptionInner generateVerificationCode( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response generateVerificationCodeWithResponse( - String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context) { - return generateVerificationCodeWithResponseAsync( - resourceGroupName, resourceName, certificateName, ifMatch, context) - .block(); + public CertificateWithNonceDescriptionInner generateVerificationCode( + String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + return generateVerificationCodeWithResponse( + resourceGroupName, resourceName, certificateName, ifMatch, Context.NONE) + .getValue(); } /** @@ -1293,19 +1262,22 @@ private Mono verifyAsync( * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. * @param certificateVerificationBody The name of the certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateDescriptionInner verify( + public Response verifyWithResponse( String resourceGroupName, String resourceName, String certificateName, String ifMatch, - CertificateVerificationDescription certificateVerificationBody) { - return verifyAsync(resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody) + CertificateVerificationDescription certificateVerificationBody, + Context context) { + return verifyWithResponseAsync( + resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody, context) .block(); } @@ -1320,22 +1292,20 @@ public CertificateDescriptionInner verify( * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. * @param certificateVerificationBody The name of the certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response verifyWithResponse( + public CertificateDescriptionInner verify( String resourceGroupName, String resourceName, String certificateName, String ifMatch, - CertificateVerificationDescription certificateVerificationBody, - Context context) { - return verifyWithResponseAsync( - resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody, context) - .block(); + CertificateVerificationDescription certificateVerificationBody) { + return verifyWithResponse( + resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody, Context.NONE) + .getValue(); } } 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 3cdd59adceaa..44fbec70418f 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 @@ -31,15 +31,6 @@ public CertificatesImpl( this.serviceManager = serviceManager; } - public CertificateListDescription listByIotHub(String resourceGroupName, String resourceName) { - CertificateListDescriptionInner inner = this.serviceClient().listByIotHub(resourceGroupName, resourceName); - if (inner != null) { - return new CertificateListDescriptionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listByIotHubWithResponse( String resourceGroupName, String resourceName, Context context) { Response inner = @@ -55,10 +46,10 @@ public Response listByIotHubWithResponse( } } - public CertificateDescription get(String resourceGroupName, String resourceName, String certificateName) { - CertificateDescriptionInner inner = this.serviceClient().get(resourceGroupName, resourceName, certificateName); + public CertificateListDescription listByIotHub(String resourceGroupName, String resourceName) { + CertificateListDescriptionInner inner = this.serviceClient().listByIotHub(resourceGroupName, resourceName); if (inner != null) { - return new CertificateDescriptionImpl(inner, this.manager()); + return new CertificateListDescriptionImpl(inner, this.manager()); } else { return null; } @@ -79,8 +70,13 @@ public Response getWithResponse( } } - public void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { - this.serviceClient().delete(resourceGroupName, resourceName, certificateName, ifMatch); + public CertificateDescription get(String resourceGroupName, String resourceName, String certificateName) { + CertificateDescriptionInner inner = this.serviceClient().get(resourceGroupName, resourceName, certificateName); + if (inner != null) { + return new CertificateDescriptionImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteWithResponse( @@ -90,15 +86,8 @@ public Response deleteWithResponse( .deleteWithResponse(resourceGroupName, resourceName, certificateName, ifMatch, context); } - public CertificateWithNonceDescription generateVerificationCode( - String resourceGroupName, String resourceName, String certificateName, String ifMatch) { - CertificateWithNonceDescriptionInner inner = - this.serviceClient().generateVerificationCode(resourceGroupName, resourceName, certificateName, ifMatch); - if (inner != null) { - return new CertificateWithNonceDescriptionImpl(inner, this.manager()); - } else { - return null; - } + public void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + this.serviceClient().delete(resourceGroupName, resourceName, certificateName, ifMatch); } public Response generateVerificationCodeWithResponse( @@ -119,18 +108,12 @@ public Response generateVerificationCodeWithRes } } - public CertificateDescription verify( - String resourceGroupName, - String resourceName, - String certificateName, - String ifMatch, - CertificateVerificationDescription certificateVerificationBody) { - CertificateDescriptionInner inner = - this - .serviceClient() - .verify(resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody); + public CertificateWithNonceDescription generateVerificationCode( + String resourceGroupName, String resourceName, String certificateName, String ifMatch) { + CertificateWithNonceDescriptionInner inner = + this.serviceClient().generateVerificationCode(resourceGroupName, resourceName, certificateName, ifMatch); if (inner != null) { - return new CertificateDescriptionImpl(inner, this.manager()); + return new CertificateWithNonceDescriptionImpl(inner, this.manager()); } else { return null; } @@ -159,6 +142,23 @@ public Response verifyWithResponse( } } + public CertificateDescription verify( + String resourceGroupName, + String resourceName, + String certificateName, + String ifMatch, + CertificateVerificationDescription certificateVerificationBody) { + CertificateDescriptionInner inner = + this + .serviceClient() + .verify(resourceGroupName, resourceName, certificateName, ifMatch, certificateVerificationBody); + if (inner != null) { + return new CertificateDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + public CertificateDescription getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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 3d89f5ebaa03..bac045f9f008 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 @@ -220,7 +220,7 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-04-30-preview"; + this.apiVersion = "2022-11-15-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/IotHubDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java index 488b458ae10d..ee3654eefa21 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java @@ -190,10 +190,6 @@ public PagedIterable listKeys(Context co return serviceManager.iotHubResources().listKeys(resourceGroupName, resourceName, context); } - public JobResponse exportDevices(ExportDevicesRequest exportDevicesParameters) { - return serviceManager.iotHubResources().exportDevices(resourceGroupName, resourceName, exportDevicesParameters); - } - public Response exportDevicesWithResponse( ExportDevicesRequest exportDevicesParameters, Context context) { return serviceManager @@ -201,8 +197,8 @@ public Response exportDevicesWithResponse( .exportDevicesWithResponse(resourceGroupName, resourceName, exportDevicesParameters, context); } - public JobResponse importDevices(ImportDevicesRequest importDevicesParameters) { - return serviceManager.iotHubResources().importDevices(resourceGroupName, resourceName, importDevicesParameters); + public JobResponse exportDevices(ExportDevicesRequest exportDevicesParameters) { + return serviceManager.iotHubResources().exportDevices(resourceGroupName, resourceName, exportDevicesParameters); } public Response importDevicesWithResponse( @@ -212,6 +208,10 @@ public Response importDevicesWithResponse( .importDevicesWithResponse(resourceGroupName, resourceName, importDevicesParameters, context); } + public JobResponse importDevices(ImportDevicesRequest importDevicesParameters) { + return serviceManager.iotHubResources().importDevices(resourceGroupName, resourceName, importDevicesParameters); + } + public IotHubDescriptionImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return 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 90cc8da5e809..2f6835b2ae6e 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 @@ -89,11 +89,10 @@ public final class IotHubResourcesClientImpl implements IotHubResourcesClient { */ @Host("{$host}") @ServiceInterface(name = "IotHubClientIotHubRe") - private interface IotHubResourcesService { + public interface IotHubResourcesService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> getByResourceGroup( @@ -107,8 +106,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono>> createOrUpdate( @@ -124,8 +122,7 @@ Mono>> createOrUpdate( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update( @@ -140,8 +137,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}") @ExpectedResponses({200, 202, 204, 404}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono>> delete( @@ -178,8 +174,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/IotHubStats") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> getStats( @@ -193,8 +188,7 @@ Mono> getStats( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/skus") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> getValidSkus( @@ -208,8 +202,7 @@ Mono> getValidSkus( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> listEventHubConsumerGroups( @@ -224,8 +217,7 @@ Mono> listEventHubConsumerGroups( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> getEventHubConsumerGroup( @@ -241,8 +233,7 @@ Mono> getEventHubConsumerGroup( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> createEventHubConsumerGroup( @@ -259,8 +250,7 @@ Mono> createEventHubConsumerGroup( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> deleteEventHubConsumerGroup( @@ -276,8 +266,7 @@ Mono> deleteEventHubConsumerGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/jobs") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> listJobs( @@ -291,8 +280,7 @@ Mono> listJobs( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/jobs/{jobId}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> getJob( @@ -307,8 +295,7 @@ Mono> getJob( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/quotaMetrics") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> getQuotaMetrics( @@ -322,8 +309,7 @@ Mono> getQuotaMetrics( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{iotHubName}/routingEndpointsHealth") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> getEndpointHealth( @@ -349,8 +335,7 @@ Mono> checkNameAvailability( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{iotHubName}/routing/routes/$testall") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> testAllRoutes( @@ -365,8 +350,7 @@ Mono> testAllRoutes( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{iotHubName}/routing/routes/$testnew") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> testRoute( @@ -381,8 +365,7 @@ Mono> testRoute( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/listkeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> listKeys( @@ -396,8 +379,7 @@ Mono> listKeys( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/IotHubKeys/{keyName}/listkeys") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> getKeysForKeyName( @@ -412,8 +394,7 @@ Mono> getKeysForKeyName( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/exportDevices") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> exportDevices( @@ -428,8 +409,7 @@ Mono> exportDevices( @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{resourceName}/importDevices") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> importDevices( @@ -648,14 +628,16 @@ private Mono getByResourceGroupAsync(String resourceGrou * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub. + * @return the non-security related metadata of an IoT hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName) { - return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); } /** @@ -665,16 +647,14 @@ public IotHubDescriptionInner getByResourceGroup(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub along with {@link Response}. + * @return the non-security related metadata of an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String resourceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + public IotHubDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); } /** @@ -837,6 +817,37 @@ private PollerFlux, IotHubDescriptionInner> b this.client.getContext()); } + /** + * Create or update the metadata of an IoT hub. + * + *

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. + * + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param iotHubDescription The IoT hub metadata and security metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ErrorDetailsException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the description of the IoT hub. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IotHubDescriptionInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { + final String ifMatch = null; + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + IotHubDescriptionInner.class, + IotHubDescriptionInner.class, + this.client.getContext()); + } + /** * Create or update the metadata of an IoT hub. * @@ -885,8 +896,6 @@ private PollerFlux, IotHubDescriptionInner> b * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -894,8 +903,11 @@ private PollerFlux, IotHubDescriptionInner> b */ @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(); + String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription) { + final String ifMatch = null; + return this + .beginCreateOrUpdateAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch) + .getSyncPoller(); } /** @@ -923,7 +935,8 @@ public SyncPoller, IotHubDescriptionInner> be IotHubDescriptionInner iotHubDescription, String ifMatch, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch, context) + return this + .beginCreateOrUpdateAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch, context) .getSyncPoller(); } @@ -1006,29 +1019,6 @@ private Mono createOrUpdateAsync( .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create or update the metadata of an IoT hub. - * - *

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. - * - * @param resourceGroupName The name of the resource group that contains the IoT hub. - * @param resourceName The name of the IoT hub. - * @param iotHubDescription The IoT hub metadata and security metadata. - * @param ifMatch ETag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an - * existing IoT Hub. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorDetailsException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the description of the IoT hub. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubDescriptionInner createOrUpdate( - String resourceGroupName, String resourceName, IotHubDescriptionInner iotHubDescription, String ifMatch) { - return createOrUpdateAsync(resourceGroupName, resourceName, iotHubDescription, ifMatch).block(); - } - /** * Create or update the metadata of an IoT hub. * @@ -1264,7 +1254,7 @@ private PollerFlux, IotHubDescriptionInner> b @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginUpdate( String resourceGroupName, String resourceName, TagsResource iotHubTags) { - return beginUpdateAsync(resourceGroupName, resourceName, iotHubTags).getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, resourceName, iotHubTags).getSyncPoller(); } /** @@ -1284,7 +1274,7 @@ public SyncPoller, IotHubDescriptionInner> be @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(); + return this.beginUpdateAsync(resourceGroupName, resourceName, iotHubTags, context).getSyncPoller(); } /** @@ -1534,7 +1524,7 @@ private PollerFlux, IotHubDescriptionInner> b @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginDelete( String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); } /** @@ -1553,7 +1543,7 @@ public SyncPoller, IotHubDescriptionInner> be @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, IotHubDescriptionInner> beginDelete( String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); } /** @@ -2083,14 +2073,16 @@ private Mono getStatsAsync(String resourceGroupName, St * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub. + * @return the statistics from an IoT hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RegistryStatisticsInner getStats(String resourceGroupName, String resourceName) { - return getStatsAsync(resourceGroupName, resourceName).block(); + public Response getStatsWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getStatsWithResponseAsync(resourceGroupName, resourceName, context).block(); } /** @@ -2100,16 +2092,14 @@ public RegistryStatisticsInner getStats(String resourceGroupName, String resourc * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub along with {@link Response}. + * @return the statistics from an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStatsWithResponse( - String resourceGroupName, String resourceName, Context context) { - return getStatsWithResponseAsync(resourceGroupName, resourceName, context).block(); + public RegistryStatisticsInner getStats(String resourceGroupName, String resourceName) { + return getStatsWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); } /** @@ -2679,15 +2669,19 @@ private Mono getEventHubConsumerGroupAsync( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EventHubConsumerGroupInfoInner getEventHubConsumerGroup( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { - return getEventHubConsumerGroupAsync(resourceGroupName, resourceName, eventHubEndpointName, name).block(); + public Response getEventHubConsumerGroupWithResponse( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context) { + return getEventHubConsumerGroupWithResponseAsync( + resourceGroupName, resourceName, eventHubEndpointName, name, context) + .block(); } /** @@ -2699,19 +2693,17 @@ public EventHubConsumerGroupInfoInner getEventHubConsumerGroup( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with {@link - * Response}. + * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getEventHubConsumerGroupWithResponse( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context) { - return getEventHubConsumerGroupWithResponseAsync( - resourceGroupName, resourceName, eventHubEndpointName, name, context) - .block(); + public EventHubConsumerGroupInfoInner getEventHubConsumerGroup( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + return getEventHubConsumerGroupWithResponse( + resourceGroupName, resourceName, eventHubEndpointName, name, Context.NONE) + .getValue(); } /** @@ -2898,20 +2890,22 @@ private Mono createEventHubConsumerGroupAsync( * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to add. * @param consumerGroupBody The consumer group to add. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object. + * @return the properties of the EventHubConsumerGroupInfo object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public EventHubConsumerGroupInfoInner createEventHubConsumerGroup( + public Response createEventHubConsumerGroupWithResponse( String resourceGroupName, String resourceName, String eventHubEndpointName, String name, - EventHubConsumerGroupBodyDescription consumerGroupBody) { - return createEventHubConsumerGroupAsync( - resourceGroupName, resourceName, eventHubEndpointName, name, consumerGroupBody) + EventHubConsumerGroupBodyDescription consumerGroupBody, + Context context) { + return createEventHubConsumerGroupWithResponseAsync( + resourceGroupName, resourceName, eventHubEndpointName, name, consumerGroupBody, context) .block(); } @@ -2925,23 +2919,21 @@ public EventHubConsumerGroupInfoInner createEventHubConsumerGroup( * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to add. * @param consumerGroupBody The consumer group to add. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the EventHubConsumerGroupInfo object along with {@link Response}. + * @return the properties of the EventHubConsumerGroupInfo object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createEventHubConsumerGroupWithResponse( + public EventHubConsumerGroupInfoInner createEventHubConsumerGroup( String resourceGroupName, String resourceName, String eventHubEndpointName, String name, - EventHubConsumerGroupBodyDescription consumerGroupBody, - Context context) { - return createEventHubConsumerGroupWithResponseAsync( - resourceGroupName, resourceName, eventHubEndpointName, name, consumerGroupBody, context) - .block(); + EventHubConsumerGroupBodyDescription consumerGroupBody) { + return createEventHubConsumerGroupWithResponse( + resourceGroupName, resourceName, eventHubEndpointName, name, consumerGroupBody, Context.NONE) + .getValue(); } /** @@ -3094,14 +3086,18 @@ private Mono deleteEventHubConsumerGroupAsync( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteEventHubConsumerGroup( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { - deleteEventHubConsumerGroupAsync(resourceGroupName, resourceName, eventHubEndpointName, name).block(); + public Response deleteEventHubConsumerGroupWithResponse( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context) { + return deleteEventHubConsumerGroupWithResponseAsync( + resourceGroupName, resourceName, eventHubEndpointName, name, context) + .block(); } /** @@ -3113,18 +3109,15 @@ public void deleteEventHubConsumerGroup( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteEventHubConsumerGroupWithResponse( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context) { - return deleteEventHubConsumerGroupWithResponseAsync( - resourceGroupName, resourceName, eventHubEndpointName, name, context) - .block(); + public void deleteEventHubConsumerGroup( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + deleteEventHubConsumerGroupWithResponse( + resourceGroupName, resourceName, eventHubEndpointName, name, Context.NONE); } /** @@ -3476,14 +3469,16 @@ private Mono getJobAsync(String resourceGroupName, String reso * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param jobId The job identifier. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub. + * @return the details of a job from an IoT hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobResponseInner getJob(String resourceGroupName, String resourceName, String jobId) { - return getJobAsync(resourceGroupName, resourceName, jobId).block(); + public Response getJobWithResponse( + String resourceGroupName, String resourceName, String jobId, Context context) { + return getJobWithResponseAsync(resourceGroupName, resourceName, jobId, context).block(); } /** @@ -3496,16 +3491,14 @@ public JobResponseInner getJob(String resourceGroupName, String resourceName, St * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param jobId The job identifier. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub along with {@link Response}. + * @return the details of a job from an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getJobWithResponse( - String resourceGroupName, String resourceName, String jobId, Context context) { - return getJobWithResponseAsync(resourceGroupName, resourceName, jobId, context).block(); + public JobResponseInner getJob(String resourceGroupName, String resourceName, String jobId) { + return getJobWithResponse(resourceGroupName, resourceName, jobId, Context.NONE).getValue(); } /** @@ -4017,14 +4010,16 @@ private Mono checkNameAvailabilityAsync(Operati * * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT hub to * check. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available. + * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public IotHubNameAvailabilityInfoInner checkNameAvailability(OperationInputs operationInputs) { - return checkNameAvailabilityAsync(operationInputs).block(); + public Response checkNameAvailabilityWithResponse( + OperationInputs operationInputs, Context context) { + return checkNameAvailabilityWithResponseAsync(operationInputs, context).block(); } /** @@ -4034,16 +4029,14 @@ public IotHubNameAvailabilityInfoInner checkNameAvailability(OperationInputs ope * * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT hub to * check. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. + * @return the properties indicating whether a given IoT hub name is available. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse( - OperationInputs operationInputs, Context context) { - return checkNameAvailabilityWithResponseAsync(operationInputs, context).block(); + public IotHubNameAvailabilityInfoInner checkNameAvailability(OperationInputs operationInputs) { + return checkNameAvailabilityWithResponse(operationInputs, Context.NONE).getValue(); } /** @@ -4186,15 +4179,16 @@ private Mono testAllRoutesAsync( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Input for testing all routes. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing all routes. + * @return result of testing all routes along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TestAllRoutesResultInner testAllRoutes( - String iotHubName, String resourceGroupName, TestAllRoutesInput input) { - return testAllRoutesAsync(iotHubName, resourceGroupName, input).block(); + public Response testAllRoutesWithResponse( + String iotHubName, String resourceGroupName, TestAllRoutesInput input, Context context) { + return testAllRoutesWithResponseAsync(iotHubName, resourceGroupName, input, context).block(); } /** @@ -4205,16 +4199,15 @@ public TestAllRoutesResultInner testAllRoutes( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Input for testing all routes. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing all routes along with {@link Response}. + * @return result of testing all routes. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response testAllRoutesWithResponse( - String iotHubName, String resourceGroupName, TestAllRoutesInput input, Context context) { - return testAllRoutesWithResponseAsync(iotHubName, resourceGroupName, input, context).block(); + public TestAllRoutesResultInner testAllRoutes( + String iotHubName, String resourceGroupName, TestAllRoutesInput input) { + return testAllRoutesWithResponse(iotHubName, resourceGroupName, input, Context.NONE).getValue(); } /** @@ -4357,14 +4350,16 @@ private Mono testRouteAsync( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Route that needs to be tested. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing one route. + * @return result of testing one route along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TestRouteResultInner testRoute(String iotHubName, String resourceGroupName, TestRouteInput input) { - return testRouteAsync(iotHubName, resourceGroupName, input).block(); + public Response testRouteWithResponse( + String iotHubName, String resourceGroupName, TestRouteInput input, Context context) { + return testRouteWithResponseAsync(iotHubName, resourceGroupName, input, context).block(); } /** @@ -4375,16 +4370,14 @@ public TestRouteResultInner testRoute(String iotHubName, String resourceGroupNam * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Route that needs to be tested. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing one route along with {@link Response}. + * @return result of testing one route. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response testRouteWithResponse( - String iotHubName, String resourceGroupName, TestRouteInput input, Context context) { - return testRouteWithResponseAsync(iotHubName, resourceGroupName, input, context).block(); + public TestRouteResultInner testRoute(String iotHubName, String resourceGroupName, TestRouteInput input) { + return testRouteWithResponse(iotHubName, resourceGroupName, input, Context.NONE).getValue(); } /** @@ -4741,15 +4734,16 @@ private Mono getKeysForKeyNameAsync * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param keyName The name of the shared access policy. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub. + * @return a shared access policy by name from an IoT hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName( - String resourceGroupName, String resourceName, String keyName) { - return getKeysForKeyNameAsync(resourceGroupName, resourceName, keyName).block(); + public Response getKeysForKeyNameWithResponse( + String resourceGroupName, String resourceName, String keyName, Context context) { + return getKeysForKeyNameWithResponseAsync(resourceGroupName, resourceName, keyName, context).block(); } /** @@ -4762,16 +4756,15 @@ public SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param keyName The name of the shared access policy. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub along with {@link Response}. + * @return a shared access policy by name from an IoT hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getKeysForKeyNameWithResponse( - String resourceGroupName, String resourceName, String keyName, Context context) { - return getKeysForKeyNameWithResponseAsync(resourceGroupName, resourceName, keyName, context).block(); + public SharedAccessSignatureAuthorizationRuleInner getKeysForKeyName( + String resourceGroupName, String resourceName, String keyName) { + return getKeysForKeyNameWithResponse(resourceGroupName, resourceName, keyName, Context.NONE).getValue(); } /** @@ -4936,15 +4929,17 @@ private Mono exportDevicesAsync( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param exportDevicesParameters The parameters that specify the export devices operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. + * @return the properties of the Job Response object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobResponseInner exportDevices( - String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) { - return exportDevicesAsync(resourceGroupName, resourceName, exportDevicesParameters).block(); + public Response exportDevicesWithResponse( + String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters, Context context) { + return exportDevicesWithResponseAsync(resourceGroupName, resourceName, exportDevicesParameters, context) + .block(); } /** @@ -4959,17 +4954,16 @@ public JobResponseInner exportDevices( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. + * @return the properties of the Job Response object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response exportDevicesWithResponse( - String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters, Context context) { - return exportDevicesWithResponseAsync(resourceGroupName, resourceName, exportDevicesParameters, context) - .block(); + public JobResponseInner exportDevices( + String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) { + return exportDevicesWithResponse(resourceGroupName, resourceName, exportDevicesParameters, Context.NONE) + .getValue(); } /** @@ -5134,15 +5128,17 @@ private Mono importDevicesAsync( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param importDevicesParameters The parameters that specify the import devices operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. + * @return the properties of the Job Response object along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public JobResponseInner importDevices( - String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { - return importDevicesAsync(resourceGroupName, resourceName, importDevicesParameters).block(); + public Response importDevicesWithResponse( + String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, Context context) { + return importDevicesWithResponseAsync(resourceGroupName, resourceName, importDevicesParameters, context) + .block(); } /** @@ -5157,17 +5153,16 @@ public JobResponseInner importDevices( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param importDevicesParameters The parameters that specify the import devices operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. + * @return the properties of the Job Response object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response importDevicesWithResponse( - String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, Context context) { - return importDevicesWithResponseAsync(resourceGroupName, resourceName, importDevicesParameters, context) - .block(); + public JobResponseInner importDevices( + String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { + return importDevicesWithResponse(resourceGroupName, resourceName, importDevicesParameters, Context.NONE) + .getValue(); } /** 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 7e38b0c8edc4..46e33008ecd1 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 @@ -52,15 +52,6 @@ public IotHubResourcesImpl( this.serviceManager = serviceManager; } - public IotHubDescription getByResourceGroup(String resourceGroupName, String resourceName) { - IotHubDescriptionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); - if (inner != null) { - return new IotHubDescriptionImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByResourceGroupWithResponse( String resourceGroupName, String resourceName, Context context) { Response inner = @@ -76,6 +67,15 @@ public Response getByResourceGroupWithResponse( } } + public IotHubDescription getByResourceGroup(String resourceGroupName, String resourceName) { + IotHubDescriptionInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new IotHubDescriptionImpl(inner, this.manager()); + } else { + return null; + } + } + public IotHubDescription deleteByResourceGroup(String resourceGroupName, String resourceName) { IotHubDescriptionInner inner = this.serviceClient().delete(resourceGroupName, resourceName); if (inner != null) { @@ -115,15 +115,6 @@ public PagedIterable listByResourceGroup(String resourceGroup return Utils.mapPage(inner, inner1 -> new IotHubDescriptionImpl(inner1, this.manager())); } - public RegistryStatistics getStats(String resourceGroupName, String resourceName) { - RegistryStatisticsInner inner = this.serviceClient().getStats(resourceGroupName, resourceName); - if (inner != null) { - return new RegistryStatisticsImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getStatsWithResponse( String resourceGroupName, String resourceName, Context context) { Response inner = @@ -139,6 +130,15 @@ public Response getStatsWithResponse( } } + public RegistryStatistics getStats(String resourceGroupName, String resourceName) { + RegistryStatisticsInner inner = this.serviceClient().getStats(resourceGroupName, resourceName); + if (inner != null) { + return new RegistryStatisticsImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable getValidSkus(String resourceGroupName, String resourceName) { PagedIterable inner = this.serviceClient().getValidSkus(resourceGroupName, resourceName); @@ -168,17 +168,6 @@ public PagedIterable listEventHubConsumerGroups( return Utils.mapPage(inner, inner1 -> new EventHubConsumerGroupInfoImpl(inner1, this.manager())); } - public EventHubConsumerGroupInfo getEventHubConsumerGroup( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { - EventHubConsumerGroupInfoInner inner = - this.serviceClient().getEventHubConsumerGroup(resourceGroupName, resourceName, eventHubEndpointName, name); - if (inner != null) { - return new EventHubConsumerGroupInfoImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getEventHubConsumerGroupWithResponse( String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context) { Response inner = @@ -197,9 +186,15 @@ public Response getEventHubConsumerGroupWithResponse( } } - public void deleteEventHubConsumerGroup( + public EventHubConsumerGroupInfo getEventHubConsumerGroup( String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { - this.serviceClient().deleteEventHubConsumerGroup(resourceGroupName, resourceName, eventHubEndpointName, name); + EventHubConsumerGroupInfoInner inner = + this.serviceClient().getEventHubConsumerGroup(resourceGroupName, resourceName, eventHubEndpointName, name); + if (inner != null) { + return new EventHubConsumerGroupInfoImpl(inner, this.manager()); + } else { + return null; + } } public Response deleteEventHubConsumerGroupWithResponse( @@ -210,6 +205,11 @@ public Response deleteEventHubConsumerGroupWithResponse( resourceGroupName, resourceName, eventHubEndpointName, name, context); } + public void deleteEventHubConsumerGroup( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name) { + this.serviceClient().deleteEventHubConsumerGroup(resourceGroupName, resourceName, eventHubEndpointName, name); + } + public PagedIterable listJobs(String resourceGroupName, String resourceName) { PagedIterable inner = this.serviceClient().listJobs(resourceGroupName, resourceName); return Utils.mapPage(inner, inner1 -> new JobResponseImpl(inner1, this.manager())); @@ -220,15 +220,6 @@ public PagedIterable listJobs(String resourceGroupName, String reso return Utils.mapPage(inner, inner1 -> new JobResponseImpl(inner1, this.manager())); } - public JobResponse getJob(String resourceGroupName, String resourceName, String jobId) { - JobResponseInner inner = this.serviceClient().getJob(resourceGroupName, resourceName, jobId); - if (inner != null) { - return new JobResponseImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getJobWithResponse( String resourceGroupName, String resourceName, String jobId, Context context) { Response inner = @@ -244,6 +235,15 @@ public Response getJobWithResponse( } } + public JobResponse getJob(String resourceGroupName, String resourceName, String jobId) { + JobResponseInner inner = this.serviceClient().getJob(resourceGroupName, resourceName, jobId); + if (inner != null) { + return new JobResponseImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable getQuotaMetrics(String resourceGroupName, String resourceName) { PagedIterable inner = this.serviceClient().getQuotaMetrics(resourceGroupName, resourceName); @@ -270,15 +270,6 @@ public PagedIterable getEndpointHealth( return Utils.mapPage(inner, inner1 -> new EndpointHealthDataImpl(inner1, this.manager())); } - public IotHubNameAvailabilityInfo checkNameAvailability(OperationInputs operationInputs) { - IotHubNameAvailabilityInfoInner inner = this.serviceClient().checkNameAvailability(operationInputs); - if (inner != null) { - return new IotHubNameAvailabilityInfoImpl(inner, this.manager()); - } else { - return null; - } - } - public Response checkNameAvailabilityWithResponse( OperationInputs operationInputs, Context context) { Response inner = @@ -294,10 +285,10 @@ public Response checkNameAvailabilityWithResponse( } } - public TestAllRoutesResult testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input) { - TestAllRoutesResultInner inner = this.serviceClient().testAllRoutes(iotHubName, resourceGroupName, input); + public IotHubNameAvailabilityInfo checkNameAvailability(OperationInputs operationInputs) { + IotHubNameAvailabilityInfoInner inner = this.serviceClient().checkNameAvailability(operationInputs); if (inner != null) { - return new TestAllRoutesResultImpl(inner, this.manager()); + return new IotHubNameAvailabilityInfoImpl(inner, this.manager()); } else { return null; } @@ -318,10 +309,10 @@ public Response testAllRoutesWithResponse( } } - public TestRouteResult testRoute(String iotHubName, String resourceGroupName, TestRouteInput input) { - TestRouteResultInner inner = this.serviceClient().testRoute(iotHubName, resourceGroupName, input); + public TestAllRoutesResult testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input) { + TestAllRoutesResultInner inner = this.serviceClient().testAllRoutes(iotHubName, resourceGroupName, input); if (inner != null) { - return new TestRouteResultImpl(inner, this.manager()); + return new TestAllRoutesResultImpl(inner, this.manager()); } else { return null; } @@ -342,6 +333,15 @@ public Response testRouteWithResponse( } } + public TestRouteResult testRoute(String iotHubName, String resourceGroupName, TestRouteInput input) { + TestRouteResultInner inner = this.serviceClient().testRoute(iotHubName, resourceGroupName, input); + if (inner != null) { + return new TestRouteResultImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable listKeys( String resourceGroupName, String resourceName) { PagedIterable inner = @@ -356,17 +356,6 @@ public PagedIterable listKeys( return Utils.mapPage(inner, inner1 -> new SharedAccessSignatureAuthorizationRuleImpl(inner1, this.manager())); } - public SharedAccessSignatureAuthorizationRule getKeysForKeyName( - String resourceGroupName, String resourceName, String keyName) { - SharedAccessSignatureAuthorizationRuleInner inner = - this.serviceClient().getKeysForKeyName(resourceGroupName, resourceName, keyName); - if (inner != null) { - return new SharedAccessSignatureAuthorizationRuleImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getKeysForKeyNameWithResponse( String resourceGroupName, String resourceName, String keyName, Context context) { Response inner = @@ -382,12 +371,12 @@ public Response getKeysForKeyNameWithRes } } - public JobResponse exportDevices( - String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) { - JobResponseInner inner = - this.serviceClient().exportDevices(resourceGroupName, resourceName, exportDevicesParameters); + public SharedAccessSignatureAuthorizationRule getKeysForKeyName( + String resourceGroupName, String resourceName, String keyName) { + SharedAccessSignatureAuthorizationRuleInner inner = + this.serviceClient().getKeysForKeyName(resourceGroupName, resourceName, keyName); if (inner != null) { - return new JobResponseImpl(inner, this.manager()); + return new SharedAccessSignatureAuthorizationRuleImpl(inner, this.manager()); } else { return null; } @@ -410,10 +399,10 @@ public Response exportDevicesWithResponse( } } - public JobResponse importDevices( - String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { + public JobResponse exportDevices( + String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters) { JobResponseInner inner = - this.serviceClient().importDevices(resourceGroupName, resourceName, importDevicesParameters); + this.serviceClient().exportDevices(resourceGroupName, resourceName, exportDevicesParameters); if (inner != null) { return new JobResponseImpl(inner, this.manager()); } else { @@ -438,6 +427,17 @@ public Response importDevicesWithResponse( } } + public JobResponse importDevices( + String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters) { + JobResponseInner inner = + this.serviceClient().importDevices(resourceGroupName, resourceName, importDevicesParameters); + if (inner != null) { + return new JobResponseImpl(inner, this.manager()); + } else { + return null; + } + } + public IotHubDescription getById(String id) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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 faf390664a4c..fd5d5b771df1 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 @@ -55,11 +55,10 @@ public final class IotHubsClientImpl implements IotHubsClient { */ @Host("{$host}") @ServiceInterface(name = "IotHubClientIotHubs") - private interface IotHubsService { + public interface IotHubsService { @Headers({"Content-Type: application/json"}) @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs" - + "/{iotHubName}/failover") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono>> manualFailover( @@ -260,7 +259,7 @@ private PollerFlux, Void> beginManualFailoverAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginManualFailover( String iotHubName, String resourceGroupName, FailoverInput failoverInput) { - return beginManualFailoverAsync(iotHubName, resourceGroupName, failoverInput).getSyncPoller(); + return this.beginManualFailoverAsync(iotHubName, resourceGroupName, failoverInput).getSyncPoller(); } /** @@ -282,7 +281,7 @@ public SyncPoller, Void> beginManualFailover( @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(); + return this.beginManualFailoverAsync(iotHubName, resourceGroupName, failoverInput, context).getSyncPoller(); } /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java index 826cad030fe5..53d2f603dd23 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java @@ -55,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "IotHubClientOperatio") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.Devices/operations") @ExpectedResponses({200}) 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 5b42edcb4904..38b7cdbc703f 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 @@ -61,11 +61,10 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi */ @Host("{$host}") @ServiceInterface(name = "IotHubClientPrivateE") - private interface PrivateEndpointConnectionsService { + public interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs" - + "/{resourceName}/privateEndpointConnections") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono>> list( @@ -79,8 +78,7 @@ Mono>> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs" - + "/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> get( @@ -95,8 +93,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs" - + "/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200, 201}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono>> update( @@ -112,8 +109,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs" - + "/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({200, 202, 204}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono>> delete( @@ -251,14 +247,16 @@ private Mono> listAsync(String resourceGrou * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for an IotHub. + * @return the list of private endpoint connections for an IotHub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public List list(String resourceGroupName, String resourceName) { - return listAsync(resourceGroupName, resourceName).block(); + public Response> listWithResponse( + String resourceGroupName, String resourceName, Context context) { + return listWithResponseAsync(resourceGroupName, resourceName, context).block(); } /** @@ -268,16 +266,14 @@ public List list(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for an IotHub along with {@link Response}. + * @return the list of private endpoint connections for an IotHub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response> listWithResponse( - String resourceGroupName, String resourceName, Context context) { - return listWithResponseAsync(resourceGroupName, resourceName, context).block(); + public List list(String resourceGroupName, String resourceName) { + return listWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); } /** @@ -424,15 +420,16 @@ private Mono getAsync( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties. + * @return private endpoint connection properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionInner get( - String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - return getAsync(resourceGroupName, resourceName, privateEndpointConnectionName).block(); + public Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context).block(); } /** @@ -443,16 +440,15 @@ public PrivateEndpointConnectionInner get( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties along with {@link Response}. + * @return private endpoint connection properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context).block(); + public PrivateEndpointConnectionInner get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, resourceName, privateEndpointConnectionName, Context.NONE).getValue(); } /** @@ -687,8 +683,8 @@ public SyncPoller, PrivateEndpointCon String resourceName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { - return beginUpdateAsync( - resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection) + return this + .beginUpdateAsync(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection) .getSyncPoller(); } @@ -714,7 +710,8 @@ public SyncPoller, PrivateEndpointCon String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, Context context) { - return beginUpdateAsync( + return this + .beginUpdateAsync( resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, context) .getSyncPoller(); } @@ -1014,7 +1011,7 @@ private PollerFlux, PrivateEndpointCo @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName).getSyncPoller(); } /** @@ -1034,7 +1031,8 @@ public SyncPoller, PrivateEndpointCon @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, PrivateEndpointConnectionInner> beginDelete( String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) + return this + .beginDeleteAsync(resourceGroupName, resourceName, privateEndpointConnectionName, context) .getSyncPoller(); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java index bdabcbe41bf3..b913061337de 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java @@ -29,20 +29,6 @@ public PrivateEndpointConnectionsImpl( this.serviceManager = serviceManager; } - public List list(String resourceGroupName, String resourceName) { - List inner = this.serviceClient().list(resourceGroupName, resourceName); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - public Response> listWithResponse( String resourceGroupName, String resourceName, Context context) { Response> inner = @@ -62,14 +48,17 @@ public Response> listWithResponse( } } - public PrivateEndpointConnection get( - String resourceGroupName, String resourceName, String privateEndpointConnectionName) { - PrivateEndpointConnectionInner inner = - this.serviceClient().get(resourceGroupName, resourceName, privateEndpointConnectionName); + public List list(String resourceGroupName, String resourceName) { + List inner = this.serviceClient().list(resourceGroupName, resourceName); if (inner != null) { - return new PrivateEndpointConnectionImpl(inner, this.manager()); + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { - return null; + return Collections.emptyList(); } } @@ -90,6 +79,17 @@ public Response getWithResponse( } } + public PrivateEndpointConnection get( + String resourceGroupName, String resourceName, String privateEndpointConnectionName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(resourceGroupName, resourceName, privateEndpointConnectionName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + public PrivateEndpointConnection update( String resourceGroupName, String resourceName, diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java index 4ed518c7843a..c24b3fcb657f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java @@ -55,11 +55,10 @@ public final class PrivateLinkResourcesOperationsClientImpl implements PrivateLi */ @Host("{$host}") @ServiceInterface(name = "IotHubClientPrivateL") - private interface PrivateLinkResourcesOperationsService { + public interface PrivateLinkResourcesOperationsService { @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs" - + "/{resourceName}/privateLinkResources") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> list( @@ -73,8 +72,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs" - + "/{resourceName}/privateLinkResources/{groupId}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ErrorDetailsException.class) Mono> get( @@ -212,14 +210,16 @@ private Mono listAsync(String resourceGroupName, Stri * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for an IotHub. + * @return the available private link resources for an IotHub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourcesInner list(String resourceGroupName, String resourceName) { - return listAsync(resourceGroupName, resourceName).block(); + public Response listWithResponse( + String resourceGroupName, String resourceName, Context context) { + return listWithResponseAsync(resourceGroupName, resourceName, context).block(); } /** @@ -229,16 +229,14 @@ public PrivateLinkResourcesInner list(String resourceGroupName, String resourceN * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for an IotHub along with {@link Response}. + * @return the available private link resources for an IotHub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String resourceName, Context context) { - return listWithResponseAsync(resourceGroupName, resourceName, context).block(); + public PrivateLinkResourcesInner list(String resourceGroupName, String resourceName) { + return listWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); } /** @@ -378,14 +376,16 @@ private Mono getAsync(String resourceGroupName, String * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param groupId The name of the private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given IotHub. + * @return the specified private link resource for the given IotHub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GroupIdInformationInner get(String resourceGroupName, String resourceName, String groupId) { - return getAsync(resourceGroupName, resourceName, groupId).block(); + public Response getWithResponse( + String resourceGroupName, String resourceName, String groupId, Context context) { + return getWithResponseAsync(resourceGroupName, resourceName, groupId, context).block(); } /** @@ -396,15 +396,13 @@ public GroupIdInformationInner get(String resourceGroupName, String resourceName * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param groupId The name of the private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given IotHub along with {@link Response}. + * @return the specified private link resource for the given IotHub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String resourceName, String groupId, Context context) { - return getWithResponseAsync(resourceGroupName, resourceName, groupId, context).block(); + public GroupIdInformationInner get(String resourceGroupName, String resourceName, String groupId) { + return getWithResponse(resourceGroupName, resourceName, groupId, Context.NONE).getValue(); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java index b3bd0bf5ad1e..af520d0b0b32 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java @@ -29,15 +29,6 @@ public PrivateLinkResourcesOperationsImpl( this.serviceManager = serviceManager; } - public PrivateLinkResources list(String resourceGroupName, String resourceName) { - PrivateLinkResourcesInner inner = this.serviceClient().list(resourceGroupName, resourceName); - if (inner != null) { - return new PrivateLinkResourcesImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listWithResponse( String resourceGroupName, String resourceName, Context context) { Response inner = @@ -53,10 +44,10 @@ public Response listWithResponse( } } - public GroupIdInformation get(String resourceGroupName, String resourceName, String groupId) { - GroupIdInformationInner inner = this.serviceClient().get(resourceGroupName, resourceName, groupId); + public PrivateLinkResources list(String resourceGroupName, String resourceName) { + PrivateLinkResourcesInner inner = this.serviceClient().list(resourceGroupName, resourceName); if (inner != null) { - return new GroupIdInformationImpl(inner, this.manager()); + return new PrivateLinkResourcesImpl(inner, this.manager()); } else { return null; } @@ -77,6 +68,15 @@ public Response getWithResponse( } } + public GroupIdInformation get(String resourceGroupName, String resourceName, String groupId) { + GroupIdInformationInner inner = this.serviceClient().get(resourceGroupName, resourceName, groupId); + if (inner != null) { + return new GroupIdInformationImpl(inner, this.manager()); + } else { + return null; + } + } + private PrivateLinkResourcesOperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java index 1658f08ab728..420ecf7ba96a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java @@ -51,7 +51,7 @@ public final class ResourceProviderCommonsClientImpl implements ResourceProvider */ @Host("{$host}") @ServiceInterface(name = "IotHubClientResource") - private interface ResourceProviderCommonsService { + public interface ResourceProviderCommonsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages") @ExpectedResponses({200}) @@ -159,13 +159,15 @@ private Mono getSubscriptionQuotaAsync() { * *

Get the number of free and paid iot hubs in the subscription. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of free and paid iot hubs in the subscription. + * @return the number of free and paid iot hubs in the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserSubscriptionQuotaListResultInner getSubscriptionQuota() { - return getSubscriptionQuotaAsync().block(); + public Response getSubscriptionQuotaWithResponse(Context context) { + return getSubscriptionQuotaWithResponseAsync(context).block(); } /** @@ -173,14 +175,12 @@ public UserSubscriptionQuotaListResultInner getSubscriptionQuota() { * *

Get the number of free and paid iot hubs in the subscription. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorDetailsException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of free and paid iot hubs in the subscription along with {@link Response}. + * @return the number of free and paid iot hubs in the subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSubscriptionQuotaWithResponse(Context context) { - return getSubscriptionQuotaWithResponseAsync(context).block(); + public UserSubscriptionQuotaListResultInner getSubscriptionQuota() { + return getSubscriptionQuotaWithResponse(Context.NONE).getValue(); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java index 34c7ec7aa17d..52c9da09efa9 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java @@ -26,15 +26,6 @@ public ResourceProviderCommonsImpl( this.serviceManager = serviceManager; } - public UserSubscriptionQuotaListResult getSubscriptionQuota() { - UserSubscriptionQuotaListResultInner inner = this.serviceClient().getSubscriptionQuota(); - if (inner != null) { - return new UserSubscriptionQuotaListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getSubscriptionQuotaWithResponse(Context context) { Response inner = this.serviceClient().getSubscriptionQuotaWithResponse(context); @@ -49,6 +40,15 @@ public Response getSubscriptionQuotaWithRespons } } + public UserSubscriptionQuotaListResult getSubscriptionQuota() { + UserSubscriptionQuotaListResultInner inner = this.serviceClient().getSubscriptionQuota(); + if (inner != null) { + return new UserSubscriptionQuotaListResultImpl(inner, this.manager()); + } else { + return null; + } + } + private ResourceProviderCommonsClient serviceClient() { return this.innerClient; } 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 117d836dcbe0..d2beb9716add 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 @@ -11,7 +11,7 @@ /** The ArmIdentity model. */ @Fluent -public class ArmIdentity { +public final class ArmIdentity { /* * Principal Id */ @@ -39,6 +39,10 @@ public class ArmIdentity { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; + /** Creates an instance of ArmIdentity class. */ + public ArmIdentity() { + } + /** * Get the principalId property: Principal Id. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmUserIdentity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmUserIdentity.java index 0f3168890d73..683bc23beb94 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmUserIdentity.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ArmUserIdentity.java @@ -9,7 +9,7 @@ /** The ArmUserIdentity model. */ @Immutable -public class ArmUserIdentity { +public final class ArmUserIdentity { /* * The principalId property. */ @@ -22,6 +22,10 @@ public class ArmUserIdentity { @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private String clientId; + /** Creates an instance of ArmUserIdentity class. */ + public ArmUserIdentity() { + } + /** * Get the principalId property: The principalId property. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AuthenticationType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AuthenticationType.java index 3236b1c023e1..dc7942e303a0 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AuthenticationType.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/AuthenticationType.java @@ -16,6 +16,15 @@ public final class AuthenticationType extends ExpandableStringEnum { /** Static value DeviceManagement for Capabilities. */ public static final Capabilities DEVICE_MANAGEMENT = fromString("DeviceManagement"); + /** + * Creates a new instance of Capabilities value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Capabilities() { + } + /** * Creates or finds a Capabilities from its string representation. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateProperties.java index 8bff7fa6b4d2..fd0ecad59a5b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateProperties.java @@ -54,6 +54,10 @@ public final class CertificateProperties { @JsonProperty(value = "certificate") private String certificate; + /** Creates an instance of CertificateProperties class. */ + public CertificateProperties() { + } + /** * Get the subject property: The certificate's subject name. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificatePropertiesWithNonce.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificatePropertiesWithNonce.java index f5ef2386f839..502aba4aff9b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificatePropertiesWithNonce.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificatePropertiesWithNonce.java @@ -60,6 +60,10 @@ public final class CertificatePropertiesWithNonce { @JsonProperty(value = "certificate", access = JsonProperty.Access.WRITE_ONLY) private String certificate; + /** Creates an instance of CertificatePropertiesWithNonce class. */ + public CertificatePropertiesWithNonce() { + } + /** * Get the subject property: The certificate's subject name. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateVerificationDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateVerificationDescription.java index 86adc06ff918..fd3e8f4a26b4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateVerificationDescription.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateVerificationDescription.java @@ -16,6 +16,10 @@ public final class CertificateVerificationDescription { @JsonProperty(value = "certificate") private String certificate; + /** Creates an instance of CertificateVerificationDescription class. */ + public CertificateVerificationDescription() { + } + /** * Get the certificate property: base-64 representation of X509 certificate .cer file or just .pem file content. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Certificates.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Certificates.java index b6a32877c792..18cfe8ca8b33 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Certificates.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Certificates.java @@ -16,13 +16,15 @@ public interface Certificates { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the JSON-serialized array of Certificate objects. + * @return the JSON-serialized array of Certificate objects along with {@link Response}. */ - CertificateListDescription listByIotHub(String resourceGroupName, String resourceName); + Response listByIotHubWithResponse( + String resourceGroupName, String resourceName, Context context); /** * Get the certificate list. @@ -31,15 +33,13 @@ public interface Certificates { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the JSON-serialized array of Certificate objects along with {@link Response}. + * @return the JSON-serialized array of Certificate objects. */ - Response listByIotHubWithResponse( - String resourceGroupName, String resourceName, Context context); + CertificateListDescription listByIotHub(String resourceGroupName, String resourceName); /** * Get the certificate. @@ -49,13 +49,15 @@ Response listByIotHubWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ - CertificateDescription get(String resourceGroupName, String resourceName, String certificateName); + Response getWithResponse( + String resourceGroupName, String resourceName, String certificateName, Context context); /** * Get the certificate. @@ -65,15 +67,13 @@ Response listByIotHubWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ - Response getWithResponse( - String resourceGroupName, String resourceName, String certificateName, Context context); + CertificateDescription get(String resourceGroupName, String resourceName, String certificateName); /** * Delete an X509 certificate. @@ -84,12 +84,15 @@ Response getWithResponse( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch); + Response deleteWithResponse( + String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context); /** * Delete an X509 certificate. @@ -100,15 +103,12 @@ Response getWithResponse( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ - Response deleteWithResponse( - String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context); + void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch); /** * Generate verification code for proof of possession flow. @@ -120,14 +120,15 @@ Response deleteWithResponse( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ - CertificateWithNonceDescription generateVerificationCode( - String resourceGroupName, String resourceName, String certificateName, String ifMatch); + Response generateVerificationCodeWithResponse( + String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context); /** * Generate verification code for proof of possession flow. @@ -139,15 +140,14 @@ CertificateWithNonceDescription generateVerificationCode( * @param resourceName The name of the IoT hub. * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ - Response generateVerificationCodeWithResponse( - String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context); + CertificateWithNonceDescription generateVerificationCode( + String resourceGroupName, String resourceName, String certificateName, String ifMatch); /** * Verify certificate's private key possession. @@ -160,18 +160,20 @@ Response generateVerificationCodeWithResponse( * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. * @param certificateVerificationBody The name of the certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate. + * @return the X509 Certificate along with {@link Response}. */ - CertificateDescription verify( + Response verifyWithResponse( String resourceGroupName, String resourceName, String certificateName, String ifMatch, - CertificateVerificationDescription certificateVerificationBody); + CertificateVerificationDescription certificateVerificationBody, + Context context); /** * Verify certificate's private key possession. @@ -184,20 +186,18 @@ CertificateDescription verify( * @param certificateName The name of the certificate. * @param ifMatch ETag of the Certificate. * @param certificateVerificationBody The name of the certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the X509 Certificate along with {@link Response}. + * @return the X509 Certificate. */ - Response verifyWithResponse( + CertificateDescription verify( String resourceGroupName, String resourceName, String certificateName, String ifMatch, - CertificateVerificationDescription certificateVerificationBody, - Context context); + CertificateVerificationDescription certificateVerificationBody); /** * Get the certificate. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CloudToDeviceProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CloudToDeviceProperties.java index 83c5e1f04ed5..fd0bff5dd1da 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CloudToDeviceProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CloudToDeviceProperties.java @@ -31,6 +31,10 @@ public final class CloudToDeviceProperties { @JsonProperty(value = "feedback") private FeedbackProperties feedback; + /** Creates an instance of CloudToDeviceProperties class. */ + public CloudToDeviceProperties() { + } + /** * Get the maxDeliveryCount property: The max delivery count for cloud-to-device messages in the device queue. See: * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DefaultAction.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DefaultAction.java index 2d0677802a7c..9e90c717038c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DefaultAction.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/DefaultAction.java @@ -16,6 +16,15 @@ public final class DefaultAction extends ExpandableStringEnum { /** Static value Allow for DefaultAction. */ public static final DefaultAction ALLOW = fromString("Allow"); + /** + * Creates a new instance of DefaultAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DefaultAction() { + } + /** * Creates or finds a DefaultAction from its string representation. * 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 index 7ce66e44cdff..4b4405b8a2fc 100644 --- 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 @@ -23,6 +23,10 @@ public final class EncryptionPropertiesDescription { @JsonProperty(value = "keyVaultProperties") private List keyVaultProperties; + /** Creates an instance of EncryptionPropertiesDescription class. */ + public EncryptionPropertiesDescription() { + } + /** * Get the keySource property: The source of the key. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthDataListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthDataListResult.java index 2a5fbe87e3fb..3f700fb574d8 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthDataListResult.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthDataListResult.java @@ -24,6 +24,10 @@ public final class EndpointHealthDataListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of EndpointHealthDataListResult class. */ + public EndpointHealthDataListResult() { + } + /** * Get the value property: JSON-serialized array of Endpoint health data. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthStatus.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthStatus.java index 08f2d43cb781..5afffd92728a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthStatus.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EndpointHealthStatus.java @@ -33,6 +33,15 @@ public final class EndpointHealthStatus extends ExpandableStringEnum endpointNames; + /** Creates an instance of EnrichmentProperties class. */ + public EnrichmentProperties() { + } + /** * Get the key property: The key or name for the enrichment property. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetails.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetails.java index 5b5380289f69..6a601a5590d7 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetails.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ErrorDetails.java @@ -17,6 +17,10 @@ public final class ErrorDetails extends ManagementError { @JsonProperty(value = "httpStatusCode", access = JsonProperty.Access.WRITE_ONLY) private String httpStatusCode; + /** Creates an instance of ErrorDetails class. */ + public ErrorDetails() { + } + /** * Get the httpStatusCode property: The HTTP status code. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupBodyDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupBodyDescription.java index ce5cc0baf68a..2bfe498200a5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupBodyDescription.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupBodyDescription.java @@ -17,6 +17,10 @@ public final class EventHubConsumerGroupBodyDescription { @JsonProperty(value = "properties", required = true) private EventHubConsumerGroupName properties; + /** Creates an instance of EventHubConsumerGroupBodyDescription class. */ + public EventHubConsumerGroupBodyDescription() { + } + /** * Get the properties property: The EventHub consumer group name. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupName.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupName.java index eebf1977ebc8..b35a0f96c45f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupName.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupName.java @@ -17,6 +17,10 @@ public final class EventHubConsumerGroupName { @JsonProperty(value = "name", required = true) private String name; + /** Creates an instance of EventHubConsumerGroupName class. */ + public EventHubConsumerGroupName() { + } + /** * Get the name property: EventHub consumer group name. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupsListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupsListResult.java index 98ad18da5ff1..201441b4c9db 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupsListResult.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubConsumerGroupsListResult.java @@ -24,6 +24,10 @@ public final class EventHubConsumerGroupsListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of EventHubConsumerGroupsListResult class. */ + public EventHubConsumerGroupsListResult() { + } + /** * Get the value property: List of consumer groups objects. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubProperties.java index 25ed8dd04c9f..883d305adf1d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/EventHubProperties.java @@ -43,6 +43,10 @@ public final class EventHubProperties { @JsonProperty(value = "endpoint", access = JsonProperty.Access.WRITE_ONLY) private String endpoint; + /** Creates an instance of EventHubProperties class. */ + public EventHubProperties() { + } + /** * Get the retentionTimeInDays property: The retention time for device-to-cloud messages in days. See: * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ExportDevicesRequest.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ExportDevicesRequest.java index 58ddfb4b3503..82d05ca194f7 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ExportDevicesRequest.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ExportDevicesRequest.java @@ -55,6 +55,10 @@ public final class ExportDevicesRequest { @JsonProperty(value = "configurationsBlobName") private String configurationsBlobName; + /** Creates an instance of ExportDevicesRequest class. */ + public ExportDevicesRequest() { + } + /** * Get the exportBlobContainerUri property: The export blob container URI. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FailoverInput.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FailoverInput.java index ca0a620dbd79..797a5c1e05e1 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FailoverInput.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FailoverInput.java @@ -17,6 +17,10 @@ public final class FailoverInput { @JsonProperty(value = "failoverRegion", required = true) private String failoverRegion; + /** Creates an instance of FailoverInput class. */ + public FailoverInput() { + } + /** * Get the failoverRegion property: Region the hub will be failed over to. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FallbackRouteProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FallbackRouteProperties.java index 09a9ed51f4e6..7074946fa84d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FallbackRouteProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FallbackRouteProperties.java @@ -48,6 +48,10 @@ public final class FallbackRouteProperties { @JsonProperty(value = "isEnabled", required = true) private boolean isEnabled; + /** Creates an instance of FallbackRouteProperties class. */ + public FallbackRouteProperties() { + } + /** * Get the name property: The name of the route. The name can only include alphanumeric characters, periods, * underscores, hyphens, has a maximum length of 64 characters, and must be unique. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FeedbackProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FeedbackProperties.java index 61a0003ae153..f48d21461a2d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FeedbackProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/FeedbackProperties.java @@ -32,6 +32,10 @@ public final class FeedbackProperties { @JsonProperty(value = "maxDeliveryCount") private Integer maxDeliveryCount; + /** Creates an instance of FeedbackProperties class. */ + public FeedbackProperties() { + } + /** * Get the lockDurationAsIso8601 property: The lock duration for the feedback queue. See: * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformationProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformationProperties.java index aeecc813154e..e58439d1601f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformationProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GroupIdInformationProperties.java @@ -29,6 +29,10 @@ public final class GroupIdInformationProperties { @JsonProperty(value = "requiredZoneNames") private List requiredZoneNames; + /** Creates an instance of GroupIdInformationProperties class. */ + public GroupIdInformationProperties() { + } + /** * Get the groupId property: The group id. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ImportDevicesRequest.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ImportDevicesRequest.java index 6d04189902e5..384dcaa27034 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ImportDevicesRequest.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ImportDevicesRequest.java @@ -59,6 +59,10 @@ public final class ImportDevicesRequest { @JsonProperty(value = "configurationsBlobName") private String configurationsBlobName; + /** Creates an instance of ImportDevicesRequest class. */ + public ImportDevicesRequest() { + } + /** * Get the inputBlobContainerUri property: The input blob container URI. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubCapacity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubCapacity.java index 7593c3e437b9..a4c829d876cc 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubCapacity.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubCapacity.java @@ -34,6 +34,10 @@ public final class IotHubCapacity { @JsonProperty(value = "scaleType", access = JsonProperty.Access.WRITE_ONLY) private IotHubScaleType scaleType; + /** Creates an instance of IotHubCapacity class. */ + public IotHubCapacity() { + } + /** * Get the minimum property: The minimum number of units. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescription.java index 578e5d5b0195..8f09aef71b2d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescription.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescription.java @@ -336,13 +336,14 @@ interface WithTags { * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. * * @param exportDevicesParameters The parameters that specify the export devices operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. + * @return the properties of the Job Response object along with {@link Response}. */ - JobResponse exportDevices(ExportDevicesRequest exportDevicesParameters); + Response exportDevicesWithResponse(ExportDevicesRequest exportDevicesParameters, Context context); /** * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more @@ -354,14 +355,13 @@ interface WithTags { * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. * * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. + * @return the properties of the Job Response object. */ - Response exportDevicesWithResponse(ExportDevicesRequest exportDevicesParameters, Context context); + JobResponse exportDevices(ExportDevicesRequest exportDevicesParameters); /** * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, @@ -373,13 +373,14 @@ interface WithTags { * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. * * @param importDevicesParameters The parameters that specify the import devices operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. + * @return the properties of the Job Response object along with {@link Response}. */ - JobResponse importDevices(ImportDevicesRequest importDevicesParameters); + Response importDevicesWithResponse(ImportDevicesRequest importDevicesParameters, Context context); /** * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, @@ -391,12 +392,11 @@ interface WithTags { * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. * * @param importDevicesParameters The parameters that specify the import devices operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. + * @return the properties of the Job Response object. */ - Response importDevicesWithResponse(ImportDevicesRequest importDevicesParameters, Context context); + JobResponse importDevices(ImportDevicesRequest importDevicesParameters); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescriptionListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescriptionListResult.java index 5f26f87b4468..1229e5858bd2 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescriptionListResult.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDescriptionListResult.java @@ -24,6 +24,10 @@ public final class IotHubDescriptionListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of IotHubDescriptionListResult class. */ + public IotHubDescriptionListResult() { + } + /** * Get the value property: The array of IotHubDescription objects. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubLocationDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubLocationDescription.java index 27ccef2cb48c..cfb319b045dc 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubLocationDescription.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubLocationDescription.java @@ -24,6 +24,10 @@ public final class IotHubLocationDescription { @JsonProperty(value = "role") private IotHubReplicaRoleType role; + /** Creates an instance of IotHubLocationDescription class. */ + public IotHubLocationDescription() { + } + /** * Get the location property: The name of the Azure region. * 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 08a23a32c484..d9918847b688 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 @@ -188,6 +188,16 @@ public final class IotHubProperties { @JsonProperty(value = "rootCertificate") private RootCertificateProperties rootCertificate; + /* + * This property specifies the IP Version the hub is currently utilizing. + */ + @JsonProperty(value = "ipVersion") + private IpVersion ipVersion; + + /** Creates an instance of IotHubProperties class. */ + public IotHubProperties() { + } + /** * Get the authorizationPolicies property: The shared access policies you can use to secure a connection to the IoT * hub. @@ -710,6 +720,26 @@ public IotHubProperties withRootCertificate(RootCertificateProperties rootCertif return this; } + /** + * Get the ipVersion property: This property specifies the IP Version the hub is currently utilizing. + * + * @return the ipVersion value. + */ + public IpVersion ipVersion() { + return this.ipVersion; + } + + /** + * Set the ipVersion property: This property specifies the IP Version the hub is currently utilizing. + * + * @param ipVersion the ipVersion value to set. + * @return the IotHubProperties object itself. + */ + public IotHubProperties withIpVersion(IpVersion ipVersion) { + this.ipVersion = ipVersion; + return this; + } + /** * Validates the instance. * 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 index b27b3b0b99be..ace27da806e6 100644 --- 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 @@ -17,6 +17,10 @@ public final class IotHubPropertiesDeviceStreams { @JsonProperty(value = "streamingEndpoints") private List streamingEndpoints; + /** Creates an instance of IotHubPropertiesDeviceStreams class. */ + public IotHubPropertiesDeviceStreams() { + } + /** * Get the streamingEndpoints property: List of Device Streams Endpoints. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubQuotaMetricInfoListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubQuotaMetricInfoListResult.java index fd3c10602c39..49bc284ce2d5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubQuotaMetricInfoListResult.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubQuotaMetricInfoListResult.java @@ -24,6 +24,10 @@ public final class IotHubQuotaMetricInfoListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of IotHubQuotaMetricInfoListResult class. */ + public IotHubQuotaMetricInfoListResult() { + } + /** * Get the value property: The array of quota metrics objects. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubReplicaRoleType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubReplicaRoleType.java index 330daec923c0..d46d28d791e1 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubReplicaRoleType.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubReplicaRoleType.java @@ -20,6 +20,15 @@ public final class IotHubReplicaRoleType extends ExpandableStringEnum getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); /** * Get the non-security related metadata of an IoT hub @@ -32,15 +34,13 @@ public interface IotHubResources { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the non-security related metadata of an IoT hub along with {@link Response}. + * @return the non-security related metadata of an IoT hub. */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String resourceName, Context context); + IotHubDescription getByResourceGroup(String resourceGroupName, String resourceName); /** * Delete an IoT hub @@ -135,13 +135,14 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub. + * @return the statistics from an IoT hub along with {@link Response}. */ - RegistryStatistics getStats(String resourceGroupName, String resourceName); + Response getStatsWithResponse(String resourceGroupName, String resourceName, Context context); /** * Get the statistics from an IoT hub @@ -150,14 +151,13 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the statistics from an IoT hub along with {@link Response}. + * @return the statistics from an IoT hub. */ - Response getStatsWithResponse(String resourceGroupName, String resourceName, Context context); + RegistryStatistics getStats(String resourceGroupName, String resourceName); /** * Get the list of valid SKUs for an IoT hub @@ -236,14 +236,16 @@ PagedIterable listEventHubConsumerGroups( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to retrieve. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. + * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with {@link + * Response}. */ - EventHubConsumerGroupInfo getEventHubConsumerGroup( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name); + Response getEventHubConsumerGroupWithResponse( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context); /** * Get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub @@ -254,16 +256,14 @@ EventHubConsumerGroupInfo getEventHubConsumerGroup( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to retrieve. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub along with {@link - * Response}. + * @return a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. */ - Response getEventHubConsumerGroupWithResponse( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context); + EventHubConsumerGroupInfo getEventHubConsumerGroup( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name); /** * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub @@ -274,13 +274,15 @@ Response getEventHubConsumerGroupWithResponse( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to delete. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void deleteEventHubConsumerGroup( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name); + Response deleteEventHubConsumerGroupWithResponse( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context); /** * Delete a consumer group from an Event Hub-compatible endpoint in an IoT hub @@ -291,15 +293,13 @@ void deleteEventHubConsumerGroup( * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to delete. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. */ - Response deleteEventHubConsumerGroupWithResponse( - String resourceGroupName, String resourceName, String eventHubEndpointName, String name, Context context); + void deleteEventHubConsumerGroup( + String resourceGroupName, String resourceName, String eventHubEndpointName, String name); /** * Get a list of all the jobs in an IoT hub. For more information, see: @@ -346,13 +346,15 @@ Response deleteEventHubConsumerGroupWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param jobId The job identifier. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub. + * @return the details of a job from an IoT hub along with {@link Response}. */ - JobResponse getJob(String resourceGroupName, String resourceName, String jobId); + Response getJobWithResponse( + String resourceGroupName, String resourceName, String jobId, Context context); /** * Get the details of a job from an IoT hub. For more information, see: @@ -364,15 +366,13 @@ Response deleteEventHubConsumerGroupWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param jobId The job identifier. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the details of a job from an IoT hub along with {@link Response}. + * @return the details of a job from an IoT hub. */ - Response getJobWithResponse( - String resourceGroupName, String resourceName, String jobId, Context context); + JobResponse getJob(String resourceGroupName, String resourceName, String jobId); /** * Get the quota metrics for an IoT hub @@ -444,13 +444,15 @@ PagedIterable getQuotaMetrics( * * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT hub to * check. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available. + * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. */ - IotHubNameAvailabilityInfo checkNameAvailability(OperationInputs operationInputs); + Response checkNameAvailabilityWithResponse( + OperationInputs operationInputs, Context context); /** * Check if an IoT hub name is available @@ -459,15 +461,13 @@ PagedIterable getQuotaMetrics( * * @param operationInputs Set the name parameter in the OperationInputs structure to the name of the IoT hub to * check. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties indicating whether a given IoT hub name is available along with {@link Response}. + * @return the properties indicating whether a given IoT hub name is available. */ - Response checkNameAvailabilityWithResponse( - OperationInputs operationInputs, Context context); + IotHubNameAvailabilityInfo checkNameAvailability(OperationInputs operationInputs); /** * Test all routes @@ -477,13 +477,15 @@ Response checkNameAvailabilityWithResponse( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Input for testing all routes. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing all routes. + * @return result of testing all routes along with {@link Response}. */ - TestAllRoutesResult testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input); + Response testAllRoutesWithResponse( + String iotHubName, String resourceGroupName, TestAllRoutesInput input, Context context); /** * Test all routes @@ -493,15 +495,13 @@ Response checkNameAvailabilityWithResponse( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Input for testing all routes. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing all routes along with {@link Response}. + * @return result of testing all routes. */ - Response testAllRoutesWithResponse( - String iotHubName, String resourceGroupName, TestAllRoutesInput input, Context context); + TestAllRoutesResult testAllRoutes(String iotHubName, String resourceGroupName, TestAllRoutesInput input); /** * Test the new route @@ -511,13 +511,15 @@ Response testAllRoutesWithResponse( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Route that needs to be tested. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing one route. + * @return result of testing one route along with {@link Response}. */ - TestRouteResult testRoute(String iotHubName, String resourceGroupName, TestRouteInput input); + Response testRouteWithResponse( + String iotHubName, String resourceGroupName, TestRouteInput input, Context context); /** * Test the new route @@ -527,15 +529,13 @@ Response testAllRoutesWithResponse( * @param iotHubName IotHub to be tested. * @param resourceGroupName resource group which Iot Hub belongs to. * @param input Route that needs to be tested. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of testing one route along with {@link Response}. + * @return result of testing one route. */ - Response testRouteWithResponse( - String iotHubName, String resourceGroupName, TestRouteInput input, Context context); + TestRouteResult testRoute(String iotHubName, String resourceGroupName, TestRouteInput input); /** * Get the security metadata for an IoT hub. For more information, see: @@ -583,14 +583,15 @@ PagedIterable listKeys( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param keyName The name of the shared access policy. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub. + * @return a shared access policy by name from an IoT hub along with {@link Response}. */ - SharedAccessSignatureAuthorizationRule getKeysForKeyName( - String resourceGroupName, String resourceName, String keyName); + Response getKeysForKeyNameWithResponse( + String resourceGroupName, String resourceName, String keyName, Context context); /** * Get a shared access policy by name from an IoT hub. For more information, see: @@ -602,15 +603,14 @@ SharedAccessSignatureAuthorizationRule getKeysForKeyName( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param keyName The name of the shared access policy. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a shared access policy by name from an IoT hub along with {@link Response}. + * @return a shared access policy by name from an IoT hub. */ - Response getKeysForKeyNameWithResponse( - String resourceGroupName, String resourceName, String keyName, Context context); + SharedAccessSignatureAuthorizationRule getKeysForKeyName( + String resourceGroupName, String resourceName, String keyName); /** * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more @@ -624,14 +624,15 @@ Response getKeysForKeyNameWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param exportDevicesParameters The parameters that specify the export devices operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. + * @return the properties of the Job Response object along with {@link Response}. */ - JobResponse exportDevices( - String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters); + Response exportDevicesWithResponse( + String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters, Context context); /** * Exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. For more @@ -645,15 +646,14 @@ JobResponse exportDevices( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param exportDevicesParameters The parameters that specify the export devices operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. + * @return the properties of the Job Response object. */ - Response exportDevicesWithResponse( - String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters, Context context); + JobResponse exportDevices( + String resourceGroupName, String resourceName, ExportDevicesRequest exportDevicesParameters); /** * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, @@ -667,14 +667,15 @@ Response exportDevicesWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param importDevicesParameters The parameters that specify the import devices operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object. + * @return the properties of the Job Response object along with {@link Response}. */ - JobResponse importDevices( - String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters); + Response importDevicesWithResponse( + String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, Context context); /** * Import, update, or delete device identities in the IoT hub identity registry from a blob. For more information, @@ -688,15 +689,14 @@ JobResponse importDevices( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param importDevicesParameters The parameters that specify the import devices operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the properties of the Job Response object along with {@link Response}. + * @return the properties of the Job Response object. */ - Response importDevicesWithResponse( - String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters, Context context); + JobResponse importDevices( + String resourceGroupName, String resourceName, ImportDevicesRequest importDevicesParameters); /** * Get the non-security related metadata of an IoT hub diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSku.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSku.java index 16c63bf11ea4..ec217ddc298b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSku.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSku.java @@ -31,6 +31,15 @@ public final class IotHubSku extends ExpandableStringEnum { /** Static value B3 for IotHubSku. */ public static final IotHubSku B3 = fromString("B3"); + /** + * Creates a new instance of IotHubSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IotHubSku() { + } + /** * Creates or finds a IotHubSku from its string representation. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuDescriptionListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuDescriptionListResult.java index be242495174c..3c9e3212e5df 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuDescriptionListResult.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuDescriptionListResult.java @@ -24,6 +24,10 @@ public final class IotHubSkuDescriptionListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of IotHubSkuDescriptionListResult class. */ + public IotHubSkuDescriptionListResult() { + } + /** * Get the value property: The array of IotHubSkuDescription. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuInfo.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuInfo.java index c10197f7e7c6..ee45af7ece30 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuInfo.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubSkuInfo.java @@ -30,6 +30,10 @@ public final class IotHubSkuInfo { @JsonProperty(value = "capacity") private Long capacity; + /** Creates an instance of IotHubSkuInfo class. */ + public IotHubSkuInfo() { + } + /** * Get the name property: The name of the SKU. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterRule.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterRule.java index 5b4d37decc14..f3a38ad605ed 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterRule.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpFilterRule.java @@ -29,6 +29,10 @@ public final class IpFilterRule { @JsonProperty(value = "ipMask", required = true) private String ipMask; + /** Creates an instance of IpFilterRule class. */ + public IpFilterRule() { + } + /** * Get the filterName property: The name of the IP filter rule. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpVersion.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpVersion.java new file mode 100644 index 000000000000..496858e0f0b3 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IpVersion.java @@ -0,0 +1,50 @@ +// 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.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** This property specifies the IP Version the hub is currently utilizing. */ +public final class IpVersion extends ExpandableStringEnum { + /** Static value ipv4 for IpVersion. */ + public static final IpVersion IPV4 = fromString("ipv4"); + + /** Static value ipv6 for IpVersion. */ + public static final IpVersion IPV6 = fromString("ipv6"); + + /** Static value ipv4ipv6 for IpVersion. */ + public static final IpVersion IPV4IPV6 = fromString("ipv4ipv6"); + + /** + * Creates a new instance of IpVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpVersion() { + } + + /** + * Creates or finds a IpVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpVersion. + */ + @JsonCreator + public static IpVersion fromString(String name) { + return fromString(name, IpVersion.class); + } + + /** + * Gets known IpVersion values. + * + * @return known IpVersion values. + */ + public static Collection values() { + return values(IpVersion.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobResponseListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobResponseListResult.java index 7afc6d7bee45..796414d7b1af 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobResponseListResult.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobResponseListResult.java @@ -24,6 +24,10 @@ public final class JobResponseListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of JobResponseListResult class. */ + public JobResponseListResult() { + } + /** * Get the value property: The array of JobResponse objects. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobType.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobType.java index 6702aa09a26a..5f6dab2bf094 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobType.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/JobType.java @@ -40,6 +40,15 @@ public final class JobType extends ExpandableStringEnum { /** Static value firmwareUpdate for JobType. */ public static final JobType FIRMWARE_UPDATE = fromString("firmwareUpdate"); + /** + * Creates a new instance of JobType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public JobType() { + } + /** * Creates or finds a JobType from its string representation. * 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 index ad465980a165..f106a37fdc4a 100644 --- 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 @@ -22,6 +22,10 @@ public final class KeyVaultKeyProperties { @JsonProperty(value = "identity") private ManagedIdentity identity; + /** Creates an instance of KeyVaultKeyProperties class. */ + public KeyVaultKeyProperties() { + } + /** * Get the keyIdentifier property: The identifier of the key. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ManagedIdentity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ManagedIdentity.java index 9a1706f0fdde..fe49a0dc12ff 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ManagedIdentity.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/ManagedIdentity.java @@ -9,13 +9,17 @@ /** The properties of the Managed identity. */ @Fluent -public class ManagedIdentity { +public final class ManagedIdentity { /* * The user assigned identity. */ @JsonProperty(value = "userAssignedIdentity") private String userAssignedIdentity; + /** Creates an instance of ManagedIdentity class. */ + public ManagedIdentity() { + } + /** * Get the userAssignedIdentity property: The user assigned identity. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MatchedRoute.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MatchedRoute.java index 86c2bf096b44..8076d7b91c50 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MatchedRoute.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MatchedRoute.java @@ -16,6 +16,10 @@ public final class MatchedRoute { @JsonProperty(value = "properties") private RouteProperties properties; + /** Creates an instance of MatchedRoute class. */ + public MatchedRoute() { + } + /** * Get the properties property: Properties of routes that matched. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MessagingEndpointProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MessagingEndpointProperties.java index d84fcf607518..0facfbae6628 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MessagingEndpointProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/MessagingEndpointProperties.java @@ -31,6 +31,10 @@ public final class MessagingEndpointProperties { @JsonProperty(value = "maxDeliveryCount") private Integer maxDeliveryCount; + /** Creates an instance of MessagingEndpointProperties class. */ + public MessagingEndpointProperties() { + } + /** * Get the lockDurationAsIso8601 property: The lock duration. See: * https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Name.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Name.java index 8f9b4261c6d9..76721c04f0af 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Name.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/Name.java @@ -22,6 +22,10 @@ public final class Name { @JsonProperty(value = "localizedValue") private String localizedValue; + /** Creates an instance of Name class. */ + public Name() { + } + /** * Get the value property: IotHub type. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleIpAction.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleIpAction.java index 55ade2b77b27..cf6f0b0ed90e 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleIpAction.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/NetworkRuleIpAction.java @@ -13,6 +13,15 @@ public final class NetworkRuleIpAction extends ExpandableStringEnum ipRules; + /** Creates an instance of NetworkRuleSetProperties class. */ + public NetworkRuleSetProperties() { + } + /** * Get the defaultAction property: Default Action for Network Rule Set. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationDisplay.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationDisplay.java index 3c5633977ff8..e0ae246f5072 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationDisplay.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationDisplay.java @@ -34,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: Service provider: Microsoft Devices. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationInputs.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationInputs.java index 9492b03a654e..d61bab667380 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationInputs.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationInputs.java @@ -17,6 +17,10 @@ public final class OperationInputs { @JsonProperty(value = "name", required = true) private String name; + /** Creates an instance of OperationInputs class. */ + public OperationInputs() { + } + /** * Get the name property: The name of the IoT hub to check. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationListResult.java index cdce3e40088b..434b7df17515 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationListResult.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/OperationListResult.java @@ -27,6 +27,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: List of IoT Hub operations supported by the Microsoft.Devices resource provider. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpoint.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpoint.java index 208001d2fc8e..34fb31313cfc 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpoint.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpoint.java @@ -16,6 +16,10 @@ public final class PrivateEndpoint { @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; + /** Creates an instance of PrivateEndpoint class. */ + public PrivateEndpoint() { + } + /** * Get the id property: The resource identifier. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnectionProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnectionProperties.java index 585a2e72b586..e0ddcb697953 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnectionProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnectionProperties.java @@ -23,6 +23,10 @@ public final class PrivateEndpointConnectionProperties { @JsonProperty(value = "privateLinkServiceConnectionState", required = true) private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + /** Creates an instance of PrivateEndpointConnectionProperties class. */ + public PrivateEndpointConnectionProperties() { + } + /** * Get the privateEndpoint property: The private endpoint property of a private endpoint connection. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnections.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnections.java index c9bd4ce44b0e..41de8c4cc56f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnections.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateEndpointConnections.java @@ -18,13 +18,15 @@ public interface PrivateEndpointConnections { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for an IotHub. + * @return the list of private endpoint connections for an IotHub along with {@link Response}. */ - List list(String resourceGroupName, String resourceName); + Response> listWithResponse( + String resourceGroupName, String resourceName, Context context); /** * List private endpoint connections @@ -33,15 +35,13 @@ public interface PrivateEndpointConnections { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of private endpoint connections for an IotHub along with {@link Response}. + * @return the list of private endpoint connections for an IotHub. */ - Response> listWithResponse( - String resourceGroupName, String resourceName, Context context); + List list(String resourceGroupName, String resourceName); /** * Get private endpoint connection @@ -51,13 +51,15 @@ Response> listWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties. + * @return private endpoint connection properties along with {@link Response}. */ - PrivateEndpointConnection get(String resourceGroupName, String resourceName, String privateEndpointConnectionName); + Response getWithResponse( + String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); /** * Get private endpoint connection @@ -67,15 +69,13 @@ Response> listWithResponse( * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param privateEndpointConnectionName The name of the private endpoint connection. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private endpoint connection properties along with {@link Response}. + * @return private endpoint connection properties. */ - Response getWithResponse( - String resourceGroupName, String resourceName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnection get(String resourceGroupName, String resourceName, String privateEndpointConnectionName); /** * Update private endpoint connection diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResourcesOperations.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResourcesOperations.java index f6b357d131cc..7aa847cc6a18 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResourcesOperations.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkResourcesOperations.java @@ -16,13 +16,14 @@ public interface PrivateLinkResourcesOperations { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for an IotHub. + * @return the available private link resources for an IotHub along with {@link Response}. */ - PrivateLinkResources list(String resourceGroupName, String resourceName); + Response listWithResponse(String resourceGroupName, String resourceName, Context context); /** * List private link resources @@ -31,14 +32,13 @@ public interface PrivateLinkResourcesOperations { * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the available private link resources for an IotHub along with {@link Response}. + * @return the available private link resources for an IotHub. */ - Response listWithResponse(String resourceGroupName, String resourceName, Context context); + PrivateLinkResources list(String resourceGroupName, String resourceName); /** * Get the specified private link resource @@ -48,13 +48,15 @@ public interface PrivateLinkResourcesOperations { * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param groupId The name of the private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given IotHub. + * @return the specified private link resource for the given IotHub along with {@link Response}. */ - GroupIdInformation get(String resourceGroupName, String resourceName, String groupId); + Response getWithResponse( + String resourceGroupName, String resourceName, String groupId, Context context); /** * Get the specified private link resource @@ -64,13 +66,11 @@ public interface PrivateLinkResourcesOperations { * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param groupId The name of the private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private link resource for the given IotHub along with {@link Response}. + * @return the specified private link resource for the given IotHub. */ - Response getWithResponse( - String resourceGroupName, String resourceName, String groupId, Context context); + GroupIdInformation get(String resourceGroupName, String resourceName, String groupId); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionState.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionState.java index 43d671d7fd88..0210134ae6f0 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionState.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionState.java @@ -29,6 +29,10 @@ public final class PrivateLinkServiceConnectionState { @JsonProperty(value = "actionsRequired") private String actionsRequired; + /** Creates an instance of PrivateLinkServiceConnectionState class. */ + public PrivateLinkServiceConnectionState() { + } + /** * Get the status property: The status of a private endpoint connection. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionStatus.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionStatus.java index 62a5d08487ad..2199bffd3a5c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionStatus.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PrivateLinkServiceConnectionStatus.java @@ -22,6 +22,15 @@ public final class PrivateLinkServiceConnectionStatus extends ExpandableStringEn /** Static value Disconnected for PrivateLinkServiceConnectionStatus. */ public static final PrivateLinkServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + /** + * Creates a new instance of PrivateLinkServiceConnectionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PrivateLinkServiceConnectionStatus() { + } + /** * Creates or finds a PrivateLinkServiceConnectionStatus from its string representation. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PublicNetworkAccess.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PublicNetworkAccess.java index 51950226347c..17574ee3fd8f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PublicNetworkAccess.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/PublicNetworkAccess.java @@ -16,6 +16,15 @@ public final class PublicNetworkAccess extends ExpandableStringEnumGet the number of free and paid iot hubs in the subscription. * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of free and paid iot hubs in the subscription. + * @return the number of free and paid iot hubs in the subscription along with {@link Response}. */ - UserSubscriptionQuotaListResult getSubscriptionQuota(); + Response getSubscriptionQuotaWithResponse(Context context); /** * Get the number of iot hubs in the subscription * *

Get the number of free and paid iot hubs in the subscription. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by * server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the number of free and paid iot hubs in the subscription along with {@link Response}. + * @return the number of free and paid iot hubs in the subscription. */ - Response getSubscriptionQuotaWithResponse(Context context); + UserSubscriptionQuotaListResult getSubscriptionQuota(); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RootCertificateProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RootCertificateProperties.java index dea6719ef520..5966512f8c6d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RootCertificateProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RootCertificateProperties.java @@ -23,6 +23,10 @@ public final class RootCertificateProperties { @JsonProperty(value = "lastUpdatedTimeUtc", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime lastUpdatedTimeUtc; + /** Creates an instance of RootCertificateProperties class. */ + public RootCertificateProperties() { + } + /** * Get the enableRootCertificateV2 property: This property when set to true, hub will use G2 cert; while it's set to * false, hub uses Baltimore Cert. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteCompilationError.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteCompilationError.java index 32d0640a8db9..73feccc6c7bd 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteCompilationError.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteCompilationError.java @@ -28,6 +28,10 @@ public final class RouteCompilationError { @JsonProperty(value = "location") private RouteErrorRange location; + /** Creates an instance of RouteCompilationError class. */ + public RouteCompilationError() { + } + /** * Get the message property: Route error message. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorPosition.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorPosition.java index 58c43833be88..cfa726667a3a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorPosition.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorPosition.java @@ -22,6 +22,10 @@ public final class RouteErrorPosition { @JsonProperty(value = "column") private Integer column; + /** Creates an instance of RouteErrorPosition class. */ + public RouteErrorPosition() { + } + /** * Get the line property: Line where the route error happened. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorRange.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorRange.java index badcc3a39a7e..ed87b719384a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorRange.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorRange.java @@ -22,6 +22,10 @@ public final class RouteErrorRange { @JsonProperty(value = "end") private RouteErrorPosition end; + /** Creates an instance of RouteErrorRange class. */ + public RouteErrorRange() { + } + /** * Get the start property: Start where the route error happened. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorSeverity.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorSeverity.java index a050c7124499..5ac04e55ffdb 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorSeverity.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RouteErrorSeverity.java @@ -16,6 +16,15 @@ public final class RouteErrorSeverity extends ExpandableStringEnum cosmosDBSqlCollections; + /** Creates an instance of RoutingEndpoints class. */ + public RoutingEndpoints() { + } + /** * Get the serviceBusQueues property: The list of Service Bus queue endpoints that IoT hub routes the messages to, * based on the routing rules. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEventHubProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEventHubProperties.java index c0407b824d6b..eba6e7ec5760 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEventHubProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingEventHubProperties.java @@ -67,6 +67,10 @@ public final class RoutingEventHubProperties { @JsonProperty(value = "resourceGroup") private String resourceGroup; + /** Creates an instance of RoutingEventHubProperties class. */ + public RoutingEventHubProperties() { + } + /** * Get the id property: Id of the event hub endpoint. * 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 05ebe0e4174c..000535f0fb0d 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 @@ -32,6 +32,10 @@ public final class RoutingMessage { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map systemProperties; + /** Creates an instance of RoutingMessage class. */ + public RoutingMessage() { + } + /** * Get the body property: Body of routing message. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingProperties.java index bc1e0579a931..c02c18d8b4a1 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingProperties.java @@ -45,6 +45,10 @@ public final class RoutingProperties { @JsonProperty(value = "enrichments") private List enrichments; + /** Creates an instance of RoutingProperties class. */ + public RoutingProperties() { + } + /** * Get the endpoints property: The properties related to the custom endpoints to which your IoT hub routes messages * based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusQueueEndpointProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusQueueEndpointProperties.java index 2aa27d8e8a2b..0cf12ee2c23b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusQueueEndpointProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusQueueEndpointProperties.java @@ -68,6 +68,10 @@ public final class RoutingServiceBusQueueEndpointProperties { @JsonProperty(value = "resourceGroup") private String resourceGroup; + /** Creates an instance of RoutingServiceBusQueueEndpointProperties class. */ + public RoutingServiceBusQueueEndpointProperties() { + } + /** * Get the id property: Id of the service bus queue endpoint. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusTopicEndpointProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusTopicEndpointProperties.java index a339789d02eb..6800293aa046 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusTopicEndpointProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingServiceBusTopicEndpointProperties.java @@ -68,6 +68,10 @@ public final class RoutingServiceBusTopicEndpointProperties { @JsonProperty(value = "resourceGroup") private String resourceGroup; + /** Creates an instance of RoutingServiceBusTopicEndpointProperties class. */ + public RoutingServiceBusTopicEndpointProperties() { + } + /** * Get the id property: Id of the service bus topic endpoint. * 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 eff131d547dd..b7db729608af 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 @@ -34,6 +34,15 @@ public final class RoutingSource extends ExpandableStringEnum { /** Static value MqttBrokerMessages for RoutingSource. */ public static final RoutingSource MQTT_BROKER_MESSAGES = fromString("MqttBrokerMessages"); + /** + * Creates a new instance of RoutingSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoutingSource() { + } + /** * 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/RoutingStorageContainerProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerProperties.java index 71896ac85680..f1df2f158caa 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerProperties.java @@ -95,6 +95,10 @@ public final class RoutingStorageContainerProperties { @JsonProperty(value = "encoding") private RoutingStorageContainerPropertiesEncoding encoding; + /** Creates an instance of RoutingStorageContainerProperties class. */ + public RoutingStorageContainerProperties() { + } + /** * Get the id property: Id of the storage container endpoint. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerPropertiesEncoding.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerPropertiesEncoding.java index 35093d027801..1b9683e99a5a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerPropertiesEncoding.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingStorageContainerPropertiesEncoding.java @@ -23,6 +23,15 @@ public final class RoutingStorageContainerPropertiesEncoding /** Static value JSON for RoutingStorageContainerPropertiesEncoding. */ public static final RoutingStorageContainerPropertiesEncoding JSON = fromString("JSON"); + /** + * Creates a new instance of RoutingStorageContainerPropertiesEncoding value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoutingStorageContainerPropertiesEncoding() { + } + /** * Creates or finds a RoutingStorageContainerPropertiesEncoding from its string representation. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java index 5d14694e9bec..cb6b5dc4e618 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java @@ -22,6 +22,10 @@ public final class RoutingTwin { @JsonProperty(value = "properties") private RoutingTwinProperties properties; + /** Creates an instance of RoutingTwin class. */ + public RoutingTwin() { + } + /** * Get the tags property: Twin Tags. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java index c9b0ca000672..248c6f471d98 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java @@ -22,6 +22,10 @@ public final class RoutingTwinProperties { @JsonProperty(value = "reported") private Object reported; + /** Creates an instance of RoutingTwinProperties class. */ + public RoutingTwinProperties() { + } + /** * Get the desired property: Twin desired properties. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/SharedAccessSignatureAuthorizationRuleListResult.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/SharedAccessSignatureAuthorizationRuleListResult.java index 763f83f7c0c9..c3db98edd80b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/SharedAccessSignatureAuthorizationRuleListResult.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/SharedAccessSignatureAuthorizationRuleListResult.java @@ -24,6 +24,10 @@ public final class SharedAccessSignatureAuthorizationRuleListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of SharedAccessSignatureAuthorizationRuleListResult class. */ + public SharedAccessSignatureAuthorizationRuleListResult() { + } + /** * Get the value property: The list of shared access policies. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/StorageEndpointProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/StorageEndpointProperties.java index 2ccb5374dcfb..2799ac0bdf3d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/StorageEndpointProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/StorageEndpointProperties.java @@ -44,6 +44,10 @@ public final class StorageEndpointProperties { @JsonProperty(value = "identity") private ManagedIdentity identity; + /** Creates an instance of StorageEndpointProperties class. */ + public StorageEndpointProperties() { + } + /** * Get the sasTtlAsIso8601 property: The period of time for which the SAS URI generated by IoT Hub for file upload * is valid. See: 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 b4182756354e..aa5335fe0fea 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 @@ -19,6 +19,10 @@ public final class TagsResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of TagsResource class. */ + public TagsResource() { + } + /** * Get the tags property: Resource tags. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesInput.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesInput.java index 4cf94aa381c6..8b68846f9dc4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesInput.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestAllRoutesInput.java @@ -28,6 +28,10 @@ public final class TestAllRoutesInput { @JsonProperty(value = "twin") private RoutingTwin twin; + /** Creates an instance of TestAllRoutesInput class. */ + public TestAllRoutesInput() { + } + /** * Get the routingSource property: Routing source. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestResultStatus.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestResultStatus.java index 9b73d3b30ca6..8248d4f5e750 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestResultStatus.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/TestResultStatus.java @@ -19,6 +19,15 @@ public final class TestResultStatus extends ExpandableStringEnum compilationErrors; + /** Creates an instance of TestRouteResultDetails class. */ + public TestRouteResultDetails() { + } + /** * Get the compilationErrors property: JSON-serialized list of route compilation errors. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuota.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuota.java index 3d2abc6cd07f..c95425883ccc 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuota.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/UserSubscriptionQuota.java @@ -46,6 +46,10 @@ public final class UserSubscriptionQuota { @JsonProperty(value = "name") private Name name; + /** Creates an instance of UserSubscriptionQuota class. */ + public UserSubscriptionQuota() { + } + /** * Get the id property: IotHub type id. * diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java index 2cac0710fe9e..67c58c331f70 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java @@ -9,7 +9,7 @@ /** Samples for Certificates CreateOrUpdate. */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_certificatescreateorupdate.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certificatescreateorupdate.json */ /** * Sample code: Certificates_CreateOrUpdate. 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 index 0dd6678d052c..61ba2a5ca588 100644 --- 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 @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_certificatesdelete.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certificatesdelete.json */ /** * Sample code: Certificates_Delete. @@ -17,6 +15,8 @@ public final class CertificatesDeleteSamples { * @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); + manager + .certificates() + .deleteWithResponse("myResourceGroup", "myhub", "cert", "AAAAAAAADGk=", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java index 503fd5544a2d..5ec7905114f6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_generateverificationcode.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_generateverificationcode.json */ /** * Sample code: Certificates_GenerateVerificationCode. @@ -19,6 +17,7 @@ public final class CertificatesGenerateVerificationCodeSamples { public static void certificatesGenerateVerificationCode(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .certificates() - .generateVerificationCodeWithResponse("myResourceGroup", "testHub", "cert", "AAAAAAAADGk=", Context.NONE); + .generateVerificationCodeWithResponse( + "myResourceGroup", "testHub", "cert", "AAAAAAAADGk=", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java index 0d1de9e93d1d..0ee916a6f086 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_getcertificate.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getcertificate.json */ /** * Sample code: Certificates_Get. @@ -17,6 +15,6 @@ public final class CertificatesGetSamples { * @param manager Entry point to IotHubManager. */ public static void certificatesGet(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.certificates().getWithResponse("myResourceGroup", "testhub", "cert", Context.NONE); + manager.certificates().getWithResponse("myResourceGroup", "testhub", "cert", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java index ecc853035516..c2023a216ea9 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_listcertificates.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listcertificates.json */ /** * Sample code: Certificates_ListByIotHub. @@ -17,6 +15,6 @@ public final class CertificatesListByIotHubSamples { * @param manager Entry point to IotHubManager. */ public static void certificatesListByIotHub(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.certificates().listByIotHubWithResponse("myResourceGroup", "testhub", Context.NONE); + manager.certificates().listByIotHubWithResponse("myResourceGroup", "testhub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java index d35f9196ab78..8d60108f9d5f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java @@ -4,13 +4,12 @@ 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/2022-04-30-preview/examples/iothub_certverify.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_certverify.json */ /** * Sample code: Certificates_Verify. @@ -26,6 +25,6 @@ public static void certificatesVerify(com.azure.resourcemanager.iothub.IotHubMan "cert", "AAAAAAAADGk=", new CertificateVerificationDescription().withCertificate("#####################################"), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java index 175f6f93299d..eab64aa98e1f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java @@ -4,13 +4,12 @@ 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/2022-04-30-preview/examples/IotHub_ManualFailover.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/IotHub_ManualFailover.json */ /** * Sample code: IotHub_ManualFailover. @@ -21,6 +20,9 @@ public static void iotHubManualFailover(com.azure.resourcemanager.iothub.IotHubM manager .iotHubs() .manualFailover( - "testHub", "myResourceGroup", new FailoverInput().withFailoverRegion("testHub"), Context.NONE); + "testHub", + "myResourceGroup", + new FailoverInput().withFailoverRegion("testHub"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java index 6413aca9418b..0facb51a6a4b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java @@ -4,13 +4,12 @@ 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/2022-04-30-preview/examples/checkNameAvailability.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/checkNameAvailability.json */ /** * Sample code: IotHubResource_CheckNameAvailability. @@ -20,6 +19,7 @@ public final class IotHubResourceCheckNameAvailabilitySamples { public static void iotHubResourceCheckNameAvailability(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .iotHubResources() - .checkNameAvailabilityWithResponse(new OperationInputs().withName("test-request"), Context.NONE); + .checkNameAvailabilityWithResponse( + new OperationInputs().withName("test-request"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java index 203999b7d0cb..36c0715687a0 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java @@ -9,7 +9,7 @@ /** Samples for IotHubResource CreateEventHubConsumerGroup. */ public final class IotHubResourceCreateEventHubConsumerGroupSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_createconsumergroup.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_createconsumergroup.json */ /** * Sample code: IotHubResource_CreateEventHubConsumerGroup. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java index 95d833666969..ea4d482473b4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java @@ -13,6 +13,7 @@ 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.IpVersion; import com.azure.resourcemanager.iothub.models.MessagingEndpointProperties; import com.azure.resourcemanager.iothub.models.NetworkRuleIpAction; import com.azure.resourcemanager.iothub.models.NetworkRuleSetIpRule; @@ -30,7 +31,7 @@ /** Samples for IotHubResource CreateOrUpdate. */ public final class IotHubResourceCreateOrUpdateSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_createOrUpdate.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_createOrUpdate.json */ /** * Sample code: IotHubResource_CreateOrUpdate. @@ -109,7 +110,8 @@ public static void iotHubResourceCreateOrUpdate(com.azure.resourcemanager.iothub .withMaxDeliveryCount(10))) .withFeatures(Capabilities.NONE) .withEnableDataResidency(true) - .withRootCertificate(new RootCertificateProperties().withEnableRootCertificateV2(true))) + .withRootCertificate(new RootCertificateProperties().withEnableRootCertificateV2(true)) + .withIpVersion(IpVersion.IPV4IPV6)) .create(); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java index 78a67207bb4f..e06756470975 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_deleteconsumergroup.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_deleteconsumergroup.json */ /** * Sample code: IotHubResource_DeleteEventHubConsumerGroup. @@ -20,6 +18,7 @@ public static void iotHubResourceDeleteEventHubConsumerGroup( com.azure.resourcemanager.iothub.IotHubManager manager) { manager .iotHubResources() - .deleteEventHubConsumerGroupWithResponse("myResourceGroup", "testHub", "events", "test", Context.NONE); + .deleteEventHubConsumerGroupWithResponse( + "myResourceGroup", "testHub", "events", "test", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java index dbdd3c24b6ff..4417738a281b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_delete.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_delete.json */ /** * Sample code: IotHubResource_Delete. @@ -17,6 +15,6 @@ public final class IotHubResourceDeleteSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().delete("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().delete("myResourceGroup", "testHub", com.azure.core.util.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 index 248c5e28738a..49d384d55dab 100644 --- 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 @@ -4,7 +4,6 @@ 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; @@ -12,7 +11,7 @@ /** Samples for IotHubResource ExportDevices. */ public final class IotHubResourceExportDevicesSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_exportdevices.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_exportdevices.json */ /** * Sample code: IotHubResource_ExportDevices. @@ -33,6 +32,6 @@ public static void iotHubResourceExportDevices(com.azure.resourcemanager.iothub. new ManagedIdentity() .withUserAssignedIdentity( "/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1")), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java index e934769d48ba..ea558057aada 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_get.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_get.json */ /** * Sample code: IotHubResource_Get. @@ -17,6 +15,8 @@ public final class IotHubResourceGetByResourceGroupSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGet(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getByResourceGroupWithResponse("myResourceGroup", "testHub", Context.NONE); + manager + .iotHubResources() + .getByResourceGroupWithResponse("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java index 0b211660e3a2..a0dd12653cd4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_routingendpointhealth.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_routingendpointhealth.json */ /** * Sample code: IotHubResource_GetEndpointHealth. @@ -17,6 +15,6 @@ public final class IotHubResourceGetEndpointHealthSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetEndpointHealth(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getEndpointHealth("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().getEndpointHealth("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java index e4832f6df322..3cc209523a72 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_getconsumergroup.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getconsumergroup.json */ /** * Sample code: IotHubResource_ListEventHubConsumerGroups. @@ -20,6 +18,7 @@ public static void iotHubResourceListEventHubConsumerGroups( com.azure.resourcemanager.iothub.IotHubManager manager) { manager .iotHubResources() - .getEventHubConsumerGroupWithResponse("myResourceGroup", "testHub", "events", "test", Context.NONE); + .getEventHubConsumerGroupWithResponse( + "myResourceGroup", "testHub", "events", "test", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java index d3b8d9b66023..f9f1433d3857 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_getjob.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getjob.json */ /** * Sample code: IotHubResource_GetJob. @@ -17,6 +15,8 @@ public final class IotHubResourceGetJobSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetJob(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getJobWithResponse("myResourceGroup", "testHub", "test", Context.NONE); + manager + .iotHubResources() + .getJobWithResponse("myResourceGroup", "testHub", "test", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java index c310e03d1d53..11dffec06eab 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_getkey.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getkey.json */ /** * Sample code: IotHubResource_GetKeysForKeyName. @@ -19,6 +17,7 @@ public final class IotHubResourceGetKeysForKeyNameSamples { public static void iotHubResourceGetKeysForKeyName(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .iotHubResources() - .getKeysForKeyNameWithResponse("myResourceGroup", "testHub", "iothubowner", Context.NONE); + .getKeysForKeyNameWithResponse( + "myResourceGroup", "testHub", "iothubowner", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java index bef02fa66e97..775e10695bb5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_quotametrics.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_quotametrics.json */ /** * Sample code: IotHubResource_GetQuotaMetrics. @@ -17,6 +15,6 @@ public final class IotHubResourceGetQuotaMetricsSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetQuotaMetrics(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getQuotaMetrics("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().getQuotaMetrics("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java index 4847a321c825..dcc8d008d25d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_stats.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_stats.json */ /** * Sample code: IotHubResource_GetStats. @@ -17,6 +15,6 @@ public final class IotHubResourceGetStatsSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetStats(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getStatsWithResponse("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().getStatsWithResponse("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java index e9db936fd0eb..bfe42046f6a4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_getskus.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getskus.json */ /** * Sample code: IotHubResource_GetValidSkus. @@ -17,6 +15,6 @@ public final class IotHubResourceGetValidSkusSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceGetValidSkus(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().getValidSkus("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().getValidSkus("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java index 0221066f0651..79cd595c5497 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java @@ -4,13 +4,12 @@ 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/2022-04-30-preview/examples/iothub_importdevices.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_importdevices.json */ /** * Sample code: IotHubResource_ImportDevices. @@ -24,6 +23,6 @@ public static void iotHubResourceImportDevices(com.azure.resourcemanager.iothub. "myResourceGroup", "testHub", new ImportDevicesRequest().withInputBlobContainerUri("testBlob").withOutputBlobContainerUri("testBlob"), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java index 2fa382f5daf4..fe778d1ed072 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_listbyrg.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listbyrg.json */ /** * Sample code: IotHubResource_ListByResourceGroup. @@ -17,6 +15,6 @@ public final class IotHubResourceListByResourceGroupSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListByResourceGroup(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().listByResourceGroup("myResourceGroup", Context.NONE); + manager.iotHubResources().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java index f6af1c0392d6..a8dad23085ab 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_listehgroups.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listehgroups.json */ /** * Sample code: IotHubResource_ListEventHubConsumerGroups. @@ -18,6 +16,8 @@ public final class IotHubResourceListEventHubConsumerGroupsSamples { */ public static void iotHubResourceListEventHubConsumerGroups( com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().listEventHubConsumerGroups("myResourceGroup", "testHub", "events", Context.NONE); + manager + .iotHubResources() + .listEventHubConsumerGroups("myResourceGroup", "testHub", "events", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java index 7fff0e2b7b6a..04018569eddb 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_listjobs.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listjobs.json */ /** * Sample code: IotHubResource_ListJobs. @@ -17,6 +15,6 @@ public final class IotHubResourceListJobsSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListJobs(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().listJobs("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().listJobs("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java index ab1b19f3cbde..bdf5149ef1e8 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_listkeys.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listkeys.json */ /** * Sample code: IotHubResource_ListKeys. @@ -17,6 +15,6 @@ public final class IotHubResourceListKeysSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListKeys(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().listKeys("myResourceGroup", "testHub", Context.NONE); + manager.iotHubResources().listKeys("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java index d0c789619f79..7a5d05862b02 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_listbysubscription.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listbysubscription.json */ /** * Sample code: IotHubResource_ListBySubscription. @@ -17,6 +15,6 @@ public final class IotHubResourceListSamples { * @param manager Entry point to IotHubManager. */ public static void iotHubResourceListBySubscription(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.iotHubResources().list(Context.NONE); + manager.iotHubResources().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java index be9aff8697f7..99e3f501bb25 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.generated; -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; @@ -14,7 +13,7 @@ /** Samples for IotHubResource TestAllRoutes. */ public final class IotHubResourceTestAllRoutesSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_testallroutes.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_testallroutes.json */ /** * Sample code: IotHubResource_TestAllRoutes. @@ -34,7 +33,7 @@ public static void iotHubResourceTestAllRoutes(com.azure.resourcemanager.iothub. .withBody("Body of message") .withAppProperties(mapOf("key1", "value1")) .withSystemProperties(mapOf("key1", "value1"))), - Context.NONE); + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java index a83ad207ce52..f789024375da 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.generated; -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; @@ -16,7 +15,7 @@ /** Samples for IotHubResource TestRoute. */ public final class IotHubResourceTestRouteSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_testnewroute.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_testnewroute.json */ /** * Sample code: IotHubResource_TestRoute. @@ -41,7 +40,7 @@ public static void iotHubResourceTestRoute(com.azure.resourcemanager.iothub.IotH .withSource(RoutingSource.DEVICE_MESSAGES) .withEndpointNames(Arrays.asList("id1")) .withIsEnabled(true)), - Context.NONE); + com.azure.core.util.Context.NONE); } @SuppressWarnings("unchecked") diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java index c6ce29a603ad..be13f9a3482c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.iothub.models.IotHubDescription; import java.util.HashMap; import java.util.Map; @@ -12,7 +11,7 @@ /** Samples for IotHubResource Update. */ public final class IotHubResourceUpdateSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_patch.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_patch.json */ /** * Sample code: IotHubResource_Update. @@ -23,7 +22,7 @@ public static void iotHubResourceUpdate(com.azure.resourcemanager.iothub.IotHubM IotHubDescription resource = manager .iotHubResources() - .getByResourceGroupWithResponse("myResourceGroup", "myHub", Context.NONE) + .getByResourceGroupWithResponse("myResourceGroup", "myHub", com.azure.core.util.Context.NONE) .getValue(); resource.update().withTags(mapOf("foo", "bar")).apply(); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java index 4d063b1b1452..c93d77c1a4e5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_operations.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_operations.json */ /** * Sample code: Operations_List. @@ -17,6 +15,6 @@ public final class OperationsListSamples { * @param manager Entry point to IotHubManager. */ public static void operationsList(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.operations().list(Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java index c5603fa554dd..dc62553134aa 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_deleteprivateendpointconnection.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_deleteprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Delete. @@ -19,6 +17,6 @@ public final class PrivateEndpointConnectionsDeleteSamples { public static void privateEndpointConnectionDelete(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .privateEndpointConnections() - .delete("myResourceGroup", "testHub", "myPrivateEndpointConnection", Context.NONE); + .delete("myResourceGroup", "testHub", "myPrivateEndpointConnection", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java index 3ed2b13d3921..92f0726359de 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_getprivateendpointconnection.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Get. @@ -19,6 +17,7 @@ public final class PrivateEndpointConnectionsGetSamples { public static void privateEndpointConnectionGet(com.azure.resourcemanager.iothub.IotHubManager manager) { manager .privateEndpointConnections() - .getWithResponse("myResourceGroup", "testHub", "myPrivateEndpointConnection", Context.NONE); + .getWithResponse( + "myResourceGroup", "testHub", "myPrivateEndpointConnection", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java index c8701c58c23a..9d8e94e9e8a2 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_listprivateendpointconnections.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listprivateendpointconnections.json */ /** * Sample code: PrivateEndpointConnections_List. @@ -17,6 +15,8 @@ public final class PrivateEndpointConnectionsListSamples { * @param manager Entry point to IotHubManager. */ public static void privateEndpointConnectionsList(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.privateEndpointConnections().listWithResponse("myResourceGroup", "testHub", Context.NONE); + manager + .privateEndpointConnections() + .listWithResponse("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java index 21339bef56e0..3602c49e0651 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.generated; -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; @@ -13,7 +12,7 @@ /** Samples for PrivateEndpointConnections Update. */ public final class PrivateEndpointConnectionsUpdateSamples { /* - * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-04-30-preview/examples/iothub_updateprivateendpointconnection.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_updateprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Update. @@ -34,6 +33,6 @@ public static void privateEndpointConnectionUpdate(com.azure.resourcemanager.iot new PrivateLinkServiceConnectionState() .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) .withDescription("Approved by johndoe@contoso.com"))), - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java index b613ac82b36b..91b76b03ae03 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_getprivatelinkresources.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_getprivatelinkresources.json */ /** * Sample code: PrivateLinkResources_List. @@ -17,6 +15,8 @@ public final class PrivateLinkResourcesOperationGetSamples { * @param manager Entry point to IotHubManager. */ public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.privateLinkResourcesOperations().getWithResponse("myResourceGroup", "testHub", "iotHub", Context.NONE); + manager + .privateLinkResourcesOperations() + .getWithResponse("myResourceGroup", "testHub", "iotHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java index 64f90d95ed1d..c29dca7b0181 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_listprivatelinkresources.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_listprivatelinkresources.json */ /** * Sample code: PrivateLinkResources_List. @@ -17,6 +15,8 @@ public final class PrivateLinkResourcesOperationListSamples { * @param manager Entry point to IotHubManager. */ public static void privateLinkResourcesList(com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.privateLinkResourcesOperations().listWithResponse("myResourceGroup", "testHub", Context.NONE); + manager + .privateLinkResourcesOperations() + .listWithResponse("myResourceGroup", "testHub", com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java index ad2f2a66734f..4c164be4dd8f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java @@ -4,12 +4,10 @@ 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/2022-04-30-preview/examples/iothub_usages.json + * x-ms-original-file: specification/iothub/resource-manager/Microsoft.Devices/preview/2022-11-15-preview/examples/iothub_usages.json */ /** * Sample code: ResourceProviderCommon_GetSubscriptionQuota. @@ -18,6 +16,6 @@ public final class ResourceProviderCommonGetSubscriptionQuotaSamples { */ public static void resourceProviderCommonGetSubscriptionQuota( com.azure.resourcemanager.iothub.IotHubManager manager) { - manager.resourceProviderCommons().getSubscriptionQuotaWithResponse(Context.NONE); + manager.resourceProviderCommons().getSubscriptionQuotaWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ArmIdentityTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ArmIdentityTests.java new file mode 100644 index 000000000000..03bcc450e730 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ArmIdentityTests.java @@ -0,0 +1,56 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.ArmIdentity; +import com.azure.resourcemanager.iothub.models.ArmUserIdentity; +import com.azure.resourcemanager.iothub.models.ResourceIdentityType; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ArmIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ArmIdentity model = + BinaryData + .fromString( + "{\"principalId\":\"ec\",\"tenantId\":\"odebfqkkrbmpu\",\"type\":\"SystemAssigned," + + " UserAssigned\",\"userAssignedIdentities\":{\"y\":{\"principalId\":\"lzlfbxzpuz\",\"clientId\":\"ispnqzahmgkbrp\"},\"buynhijggm\":{\"principalId\":\"ibnuqqkpik\",\"clientId\":\"rgvtqag\"},\"jrunmpxtt\":{\"principalId\":\"fsiarbutr\",\"clientId\":\"pnazzm\"},\"qidybyx\":{\"principalId\":\"hrbnlankxmyskpbh\",\"clientId\":\"btkcxywnytnrsyn\"}}}") + .toObject(ArmIdentity.class); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ArmIdentity model = + new ArmIdentity() + .withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf( + "y", + new ArmUserIdentity(), + "buynhijggm", + new ArmUserIdentity(), + "jrunmpxtt", + new ArmUserIdentity(), + "qidybyx", + new ArmUserIdentity())); + model = BinaryData.fromObject(model).toObject(ArmIdentity.class); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ArmUserIdentityTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ArmUserIdentityTests.java new file mode 100644 index 000000000000..61113032d11e --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ArmUserIdentityTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.ArmUserIdentity; + +public final class ArmUserIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ArmUserIdentity model = + BinaryData + .fromString("{\"principalId\":\"fclhaaxdbabphlwr\",\"clientId\":\"fkts\"}") + .toObject(ArmUserIdentity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ArmUserIdentity model = new ArmUserIdentity(); + model = BinaryData.fromObject(model).toObject(ArmUserIdentity.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateDescriptionInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateDescriptionInnerTests.java new file mode 100644 index 000000000000..0365d2c4987c --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateDescriptionInnerTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; +import com.azure.resourcemanager.iothub.models.CertificateProperties; +import org.junit.jupiter.api.Assertions; + +public final class CertificateDescriptionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CertificateDescriptionInner model = + BinaryData + .fromString( + "{\"properties\":{\"subject\":\"mond\",\"expiry\":\"Thu, 01 Apr 2021 23:21:50" + + " GMT\",\"thumbprint\":\"xvy\",\"isVerified\":false,\"created\":\"Fri, 01 Oct 2021 02:55:48" + + " GMT\",\"updated\":\"Mon, 25 Jan 2021 05:21:40" + + " GMT\",\"certificate\":\"whojvp\"},\"etag\":\"qgxy\",\"id\":\"mocmbqfqvmk\",\"name\":\"xozap\",\"type\":\"helxprglya\"}") + .toObject(CertificateDescriptionInner.class); + Assertions.assertEquals(false, model.properties().isVerified()); + Assertions.assertEquals("whojvp", model.properties().certificate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CertificateDescriptionInner model = + new CertificateDescriptionInner() + .withProperties(new CertificateProperties().withIsVerified(false).withCertificate("whojvp")); + model = BinaryData.fromObject(model).toObject(CertificateDescriptionInner.class); + Assertions.assertEquals(false, model.properties().isVerified()); + Assertions.assertEquals("whojvp", model.properties().certificate()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateListDescriptionInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateListDescriptionInnerTests.java new file mode 100644 index 000000000000..68f25228db7d --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateListDescriptionInnerTests.java @@ -0,0 +1,43 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; +import com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner; +import com.azure.resourcemanager.iothub.models.CertificateProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CertificateListDescriptionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CertificateListDescriptionInner model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"subject\":\"uoegrpkhjwniyqs\",\"expiry\":\"Mon, 01 Mar 2021" + + " 06:19:30 GMT\",\"thumbprint\":\"pdggkzzlvm\",\"isVerified\":true,\"created\":\"Fri, 04 Jun" + + " 2021 21:38:56 GMT\",\"updated\":\"Wed, 28 Apr 2021 10:55:20" + + " GMT\",\"certificate\":\"fv\"},\"etag\":\"fy\",\"id\":\"sbpfvmwyhr\",\"name\":\"ouyftaakc\",\"type\":\"wiyzvqtmnubexkp\"}]}") + .toObject(CertificateListDescriptionInner.class); + Assertions.assertEquals(true, model.value().get(0).properties().isVerified()); + Assertions.assertEquals("fv", model.value().get(0).properties().certificate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CertificateListDescriptionInner model = + new CertificateListDescriptionInner() + .withValue( + Arrays + .asList( + new CertificateDescriptionInner() + .withProperties( + new CertificateProperties().withIsVerified(true).withCertificate("fv")))); + model = BinaryData.fromObject(model).toObject(CertificateListDescriptionInner.class); + Assertions.assertEquals(true, model.value().get(0).properties().isVerified()); + Assertions.assertEquals("fv", model.value().get(0).properties().certificate()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatePropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatePropertiesTests.java new file mode 100644 index 000000000000..7a6a118d66a2 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatePropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.CertificateProperties; +import org.junit.jupiter.api.Assertions; + +public final class CertificatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CertificateProperties model = + BinaryData + .fromString( + "{\"subject\":\"dckcbc\",\"expiry\":\"Thu, 29 Jul 2021 04:12:00" + + " GMT\",\"thumbprint\":\"jxgciqibrh\",\"isVerified\":true,\"created\":\"Tue, 01 Jun 2021" + + " 12:21:20 GMT\",\"updated\":\"Thu, 04 Feb 2021 15:03:28" + + " GMT\",\"certificate\":\"zoymibmrqyibahw\"}") + .toObject(CertificateProperties.class); + Assertions.assertEquals(true, model.isVerified()); + Assertions.assertEquals("zoymibmrqyibahw", model.certificate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CertificateProperties model = + new CertificateProperties().withIsVerified(true).withCertificate("zoymibmrqyibahw"); + model = BinaryData.fromObject(model).toObject(CertificateProperties.class); + Assertions.assertEquals(true, model.isVerified()); + Assertions.assertEquals("zoymibmrqyibahw", model.certificate()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateVerificationDescriptionTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateVerificationDescriptionTests.java new file mode 100644 index 000000000000..9cc236144213 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificateVerificationDescriptionTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.CertificateVerificationDescription; +import org.junit.jupiter.api.Assertions; + +public final class CertificateVerificationDescriptionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CertificateVerificationDescription model = + BinaryData.fromString("{\"certificate\":\"pqlpq\"}").toObject(CertificateVerificationDescription.class); + Assertions.assertEquals("pqlpq", model.certificate()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CertificateVerificationDescription model = new CertificateVerificationDescription().withCertificate("pqlpq"); + model = BinaryData.fromObject(model).toObject(CertificateVerificationDescription.class); + Assertions.assertEquals("pqlpq", model.certificate()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..fd1ac1ed46d5 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,78 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.CertificateDescription; +import com.azure.resourcemanager.iothub.models.CertificateProperties; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CertificatesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"subject\":\"rpdsof\",\"expiry\":\"Mon, 03 May 2021 16:15:22" + + " GMT\",\"thumbprint\":\"nsvbuswdv\",\"isVerified\":true,\"created\":\"Mon, 22 Feb 2021 05:56:13" + + " GMT\",\"updated\":\"Tue, 06 Apr 2021 20:50:40" + + " GMT\",\"certificate\":\"nvjsrtkfa\"},\"etag\":\"opqgikyzirtxdyux\",\"id\":\"ejnt\",\"name\":\"sewgioilqukr\",\"type\":\"dxtqmieoxo\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CertificateDescription response = + manager + .certificates() + .define("mqnrojlpijnkr") + .withExistingIotHub("knpirgnepttwq", "sniffc") + .withProperties(new CertificateProperties().withIsVerified(false).withCertificate("f")) + .withIfMatch("jbdhqxvc") + .create(); + + Assertions.assertEquals(true, response.properties().isVerified()); + Assertions.assertEquals("nvjsrtkfa", response.properties().certificate()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..06719c642438 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteWithResponseMockTests.java @@ -0,0 +1,63 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CertificatesDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .certificates() + .deleteWithResponse("azpxdtnkdmkqjjl", "uenvrkp", "ou", "ibreb", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesGetWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesGetWithResponseMockTests.java new file mode 100644 index 000000000000..23ea834c27a5 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesGetWithResponseMockTests.java @@ -0,0 +1,74 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.CertificateDescription; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CertificatesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"subject\":\"lmv\",\"expiry\":\"Sun, 26 Sep 2021 11:18:34" + + " GMT\",\"thumbprint\":\"ktgplcr\",\"isVerified\":true,\"created\":\"Fri, 19 Nov 2021 13:53:17" + + " GMT\",\"updated\":\"Fri, 05 Mar 2021 15:11:27" + + " GMT\",\"certificate\":\"igbrnjw\"},\"etag\":\"kpnb\",\"id\":\"azej\",\"name\":\"oqkag\",\"type\":\"hsxttaugzxnf\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CertificateDescription response = + manager + .certificates() + .getWithResponse("waekrrjreafxtsgu", "hjglikk", "wslolbqp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(true, response.properties().isVerified()); + Assertions.assertEquals("igbrnjw", response.properties().certificate()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubWithResponseMockTests.java new file mode 100644 index 000000000000..f29712dd56cd --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubWithResponseMockTests.java @@ -0,0 +1,64 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.CertificateListDescription; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CertificatesListByIotHubWithResponseMockTests { + @Test + public void testListByIotHubWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"etag\":\"l\",\"id\":\"dn\",\"name\":\"itvgbmhrixkwm\",\"type\":\"ijejvegrhbpn\"},{\"etag\":\"exccbdreaxhcexd\",\"id\":\"rvqahqkghtpwi\",\"name\":\"nhyjsv\",\"type\":\"ycxzbfvoo\"},{\"etag\":\"vmtgjqppy\",\"id\":\"s\",\"name\":\"ronzmyhgfip\",\"type\":\"sxkm\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CertificateListDescription response = + manager.certificates().listByIotHubWithResponse("xuvw", "fbn", com.azure.core.util.Context.NONE).getValue(); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifyWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifyWithResponseMockTests.java new file mode 100644 index 000000000000..813bfa9725f9 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifyWithResponseMockTests.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.CertificateDescription; +import com.azure.resourcemanager.iothub.models.CertificateVerificationDescription; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class CertificatesVerifyWithResponseMockTests { + @Test + public void testVerifyWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"subject\":\"iithtywu\",\"expiry\":\"Sat, 06 Mar 2021 07:21:05" + + " GMT\",\"thumbprint\":\"ihwqknfdntwjchr\",\"isVerified\":true,\"created\":\"Tue, 05 Oct 2021" + + " 08:32:44 GMT\",\"updated\":\"Fri, 19 Mar 2021 07:37:05" + + " GMT\",\"certificate\":\"wct\"},\"etag\":\"dzjlu\",\"id\":\"dfdlwggyts\",\"name\":\"wtovvtgsein\",\"type\":\"fiufx\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CertificateDescription response = + manager + .certificates() + .verifyWithResponse( + "hfstotxhojujbyp", + "lmcuvhixb", + "xyfwnylrcool", + "ttpkiwkkbnujrywv", + new CertificateVerificationDescription().withCertificate("lbfpncurd"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(true, response.properties().isVerified()); + Assertions.assertEquals("wct", response.properties().certificate()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CloudToDevicePropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CloudToDevicePropertiesTests.java new file mode 100644 index 000000000000..4e65ca2aa4e7 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/CloudToDevicePropertiesTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.CloudToDeviceProperties; +import com.azure.resourcemanager.iothub.models.FeedbackProperties; +import java.time.Duration; +import org.junit.jupiter.api.Assertions; + +public final class CloudToDevicePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CloudToDeviceProperties model = + BinaryData + .fromString( + "{\"maxDeliveryCount\":1121109847,\"defaultTtlAsIso8601\":\"PT84H30M6S\",\"feedback\":{\"lockDurationAsIso8601\":\"PT9H8M5S\",\"ttlAsIso8601\":\"PT205H49M51S\",\"maxDeliveryCount\":1139583555}}") + .toObject(CloudToDeviceProperties.class); + Assertions.assertEquals(1121109847, model.maxDeliveryCount()); + Assertions.assertEquals(Duration.parse("PT84H30M6S"), model.defaultTtlAsIso8601()); + Assertions.assertEquals(Duration.parse("PT9H8M5S"), model.feedback().lockDurationAsIso8601()); + Assertions.assertEquals(Duration.parse("PT205H49M51S"), model.feedback().ttlAsIso8601()); + Assertions.assertEquals(1139583555, model.feedback().maxDeliveryCount()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CloudToDeviceProperties model = + new CloudToDeviceProperties() + .withMaxDeliveryCount(1121109847) + .withDefaultTtlAsIso8601(Duration.parse("PT84H30M6S")) + .withFeedback( + new FeedbackProperties() + .withLockDurationAsIso8601(Duration.parse("PT9H8M5S")) + .withTtlAsIso8601(Duration.parse("PT205H49M51S")) + .withMaxDeliveryCount(1139583555)); + model = BinaryData.fromObject(model).toObject(CloudToDeviceProperties.class); + Assertions.assertEquals(1121109847, model.maxDeliveryCount()); + Assertions.assertEquals(Duration.parse("PT84H30M6S"), model.defaultTtlAsIso8601()); + Assertions.assertEquals(Duration.parse("PT9H8M5S"), model.feedback().lockDurationAsIso8601()); + Assertions.assertEquals(Duration.parse("PT205H49M51S"), model.feedback().ttlAsIso8601()); + Assertions.assertEquals(1139583555, model.feedback().maxDeliveryCount()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EndpointHealthDataInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EndpointHealthDataInnerTests.java new file mode 100644 index 000000000000..9998aeb0495c --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EndpointHealthDataInnerTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; +import com.azure.resourcemanager.iothub.models.EndpointHealthStatus; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class EndpointHealthDataInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EndpointHealthDataInner model = + BinaryData + .fromString( + "{\"endpointId\":\"p\",\"healthStatus\":\"unknown\",\"lastKnownError\":\"ofd\",\"lastKnownErrorTime\":\"Sun," + + " 25 Apr 2021 06:48:17 GMT\",\"lastSuccessfulSendAttemptTime\":\"Tue, 15 Jun 2021 07:35:54" + + " GMT\",\"lastSendAttemptTime\":\"Fri, 22 Jan 2021 23:23:23 GMT\"}") + .toObject(EndpointHealthDataInner.class); + Assertions.assertEquals("p", model.endpointId()); + Assertions.assertEquals(EndpointHealthStatus.UNKNOWN, model.healthStatus()); + Assertions.assertEquals("ofd", model.lastKnownError()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T06:48:17Z"), model.lastKnownErrorTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T07:35:54Z"), model.lastSuccessfulSendAttemptTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T23:23:23Z"), model.lastSendAttemptTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EndpointHealthDataInner model = + new EndpointHealthDataInner() + .withEndpointId("p") + .withHealthStatus(EndpointHealthStatus.UNKNOWN) + .withLastKnownError("ofd") + .withLastKnownErrorTime(OffsetDateTime.parse("2021-04-25T06:48:17Z")) + .withLastSuccessfulSendAttemptTime(OffsetDateTime.parse("2021-06-15T07:35:54Z")) + .withLastSendAttemptTime(OffsetDateTime.parse("2021-01-22T23:23:23Z")); + model = BinaryData.fromObject(model).toObject(EndpointHealthDataInner.class); + Assertions.assertEquals("p", model.endpointId()); + Assertions.assertEquals(EndpointHealthStatus.UNKNOWN, model.healthStatus()); + Assertions.assertEquals("ofd", model.lastKnownError()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T06:48:17Z"), model.lastKnownErrorTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-15T07:35:54Z"), model.lastSuccessfulSendAttemptTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T23:23:23Z"), model.lastSendAttemptTime()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EndpointHealthDataListResultTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EndpointHealthDataListResultTests.java new file mode 100644 index 000000000000..49f43091d4ea --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EndpointHealthDataListResultTests.java @@ -0,0 +1,93 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; +import com.azure.resourcemanager.iothub.models.EndpointHealthDataListResult; +import com.azure.resourcemanager.iothub.models.EndpointHealthStatus; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class EndpointHealthDataListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EndpointHealthDataListResult model = + BinaryData + .fromString( + "{\"value\":[{\"endpointId\":\"zvahapjy\",\"healthStatus\":\"dead\",\"lastKnownError\":\"gqzcjr\",\"lastKnownErrorTime\":\"Sat," + + " 03 Apr 2021 19:52:37 GMT\",\"lastSuccessfulSendAttemptTime\":\"Sat, 05 Jun 2021 18:59:27" + + " GMT\",\"lastSendAttemptTime\":\"Sat, 04 Sep 2021 18:51:43" + + " GMT\"},{\"endpointId\":\"lxkvu\",\"healthStatus\":\"degraded\",\"lastKnownError\":\"ovawjvzunlu\",\"lastKnownErrorTime\":\"Thu," + + " 05 Aug 2021 22:08:57 GMT\",\"lastSuccessfulSendAttemptTime\":\"Thu, 21 Jan 2021 11:08:17" + + " GMT\",\"lastSendAttemptTime\":\"Thu, 11 Mar 2021 05:06:45" + + " GMT\"},{\"endpointId\":\"i\",\"healthStatus\":\"healthy\",\"lastKnownError\":\"pjzu\",\"lastKnownErrorTime\":\"Tue," + + " 12 Oct 2021 12:24:32 GMT\",\"lastSuccessfulSendAttemptTime\":\"Mon, 21 Jun 2021 03:54:01" + + " GMT\",\"lastSendAttemptTime\":\"Wed, 03 Nov 2021 21:00:46" + + " GMT\"},{\"endpointId\":\"skzbb\",\"healthStatus\":\"dead\",\"lastKnownError\":\"mv\",\"lastKnownErrorTime\":\"Wed," + + " 24 Feb 2021 15:47:12 GMT\",\"lastSuccessfulSendAttemptTime\":\"Mon, 22 Mar 2021 15:40:44" + + " GMT\",\"lastSendAttemptTime\":\"Thu, 01 Jul 2021 08:04:50 GMT\"}],\"nextLink\":\"uh\"}") + .toObject(EndpointHealthDataListResult.class); + Assertions.assertEquals("zvahapjy", model.value().get(0).endpointId()); + Assertions.assertEquals(EndpointHealthStatus.DEAD, model.value().get(0).healthStatus()); + Assertions.assertEquals("gqzcjr", model.value().get(0).lastKnownError()); + Assertions + .assertEquals(OffsetDateTime.parse("2021-04-03T19:52:37Z"), model.value().get(0).lastKnownErrorTime()); + Assertions + .assertEquals( + OffsetDateTime.parse("2021-06-05T18:59:27Z"), model.value().get(0).lastSuccessfulSendAttemptTime()); + Assertions + .assertEquals(OffsetDateTime.parse("2021-09-04T18:51:43Z"), model.value().get(0).lastSendAttemptTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EndpointHealthDataListResult model = + new EndpointHealthDataListResult() + .withValue( + Arrays + .asList( + new EndpointHealthDataInner() + .withEndpointId("zvahapjy") + .withHealthStatus(EndpointHealthStatus.DEAD) + .withLastKnownError("gqzcjr") + .withLastKnownErrorTime(OffsetDateTime.parse("2021-04-03T19:52:37Z")) + .withLastSuccessfulSendAttemptTime(OffsetDateTime.parse("2021-06-05T18:59:27Z")) + .withLastSendAttemptTime(OffsetDateTime.parse("2021-09-04T18:51:43Z")), + new EndpointHealthDataInner() + .withEndpointId("lxkvu") + .withHealthStatus(EndpointHealthStatus.DEGRADED) + .withLastKnownError("ovawjvzunlu") + .withLastKnownErrorTime(OffsetDateTime.parse("2021-08-05T22:08:57Z")) + .withLastSuccessfulSendAttemptTime(OffsetDateTime.parse("2021-01-21T11:08:17Z")) + .withLastSendAttemptTime(OffsetDateTime.parse("2021-03-11T05:06:45Z")), + new EndpointHealthDataInner() + .withEndpointId("i") + .withHealthStatus(EndpointHealthStatus.HEALTHY) + .withLastKnownError("pjzu") + .withLastKnownErrorTime(OffsetDateTime.parse("2021-10-12T12:24:32Z")) + .withLastSuccessfulSendAttemptTime(OffsetDateTime.parse("2021-06-21T03:54:01Z")) + .withLastSendAttemptTime(OffsetDateTime.parse("2021-11-03T21:00:46Z")), + new EndpointHealthDataInner() + .withEndpointId("skzbb") + .withHealthStatus(EndpointHealthStatus.DEAD) + .withLastKnownError("mv") + .withLastKnownErrorTime(OffsetDateTime.parse("2021-02-24T15:47:12Z")) + .withLastSuccessfulSendAttemptTime(OffsetDateTime.parse("2021-03-22T15:40:44Z")) + .withLastSendAttemptTime(OffsetDateTime.parse("2021-07-01T08:04:50Z")))); + model = BinaryData.fromObject(model).toObject(EndpointHealthDataListResult.class); + Assertions.assertEquals("zvahapjy", model.value().get(0).endpointId()); + Assertions.assertEquals(EndpointHealthStatus.DEAD, model.value().get(0).healthStatus()); + Assertions.assertEquals("gqzcjr", model.value().get(0).lastKnownError()); + Assertions + .assertEquals(OffsetDateTime.parse("2021-04-03T19:52:37Z"), model.value().get(0).lastKnownErrorTime()); + Assertions + .assertEquals( + OffsetDateTime.parse("2021-06-05T18:59:27Z"), model.value().get(0).lastSuccessfulSendAttemptTime()); + Assertions + .assertEquals(OffsetDateTime.parse("2021-09-04T18:51:43Z"), model.value().get(0).lastSendAttemptTime()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupBodyDescriptionTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupBodyDescriptionTests.java new file mode 100644 index 000000000000..729d558bbb31 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupBodyDescriptionTests.java @@ -0,0 +1,29 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupBodyDescription; +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupName; +import org.junit.jupiter.api.Assertions; + +public final class EventHubConsumerGroupBodyDescriptionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EventHubConsumerGroupBodyDescription model = + BinaryData + .fromString("{\"properties\":{\"name\":\"it\"}}") + .toObject(EventHubConsumerGroupBodyDescription.class); + Assertions.assertEquals("it", model.properties().name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EventHubConsumerGroupBodyDescription model = + new EventHubConsumerGroupBodyDescription().withProperties(new EventHubConsumerGroupName().withName("it")); + model = BinaryData.fromObject(model).toObject(EventHubConsumerGroupBodyDescription.class); + Assertions.assertEquals("it", model.properties().name()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupInfoInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupInfoInnerTests.java new file mode 100644 index 000000000000..96256a33881c --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupInfoInnerTests.java @@ -0,0 +1,39 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; +import java.util.HashMap; +import java.util.Map; + +public final class EventHubConsumerGroupInfoInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EventHubConsumerGroupInfoInner model = + BinaryData + .fromString( + "{\"properties\":{\"cjooxdjebwpucwwf\":\"dataxcug\"},\"etag\":\"vbvmeu\",\"id\":\"civyhzceuo\",\"name\":\"gjrwjueiotwmcdyt\",\"type\":\"x\"}") + .toObject(EventHubConsumerGroupInfoInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EventHubConsumerGroupInfoInner model = + new EventHubConsumerGroupInfoInner().withProperties(mapOf("cjooxdjebwpucwwf", "dataxcug")); + model = BinaryData.fromObject(model).toObject(EventHubConsumerGroupInfoInner.class); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupNameTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupNameTests.java new file mode 100644 index 000000000000..a7fbaf96b95e --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupNameTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupName; +import org.junit.jupiter.api.Assertions; + +public final class EventHubConsumerGroupNameTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EventHubConsumerGroupName model = + BinaryData.fromString("{\"name\":\"nrjawgqwg\"}").toObject(EventHubConsumerGroupName.class); + Assertions.assertEquals("nrjawgqwg", model.name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EventHubConsumerGroupName model = new EventHubConsumerGroupName().withName("nrjawgqwg"); + model = BinaryData.fromObject(model).toObject(EventHubConsumerGroupName.class); + Assertions.assertEquals("nrjawgqwg", model.name()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupsListResultTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupsListResultTests.java new file mode 100644 index 000000000000..b673ae7d3890 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubConsumerGroupsListResultTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupsListResult; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +public final class EventHubConsumerGroupsListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EventHubConsumerGroupsListResult model = + BinaryData + .fromString( + "{\"value\":[{\"properties\":{\"aex\":\"datamdua\",\"vxpvgomz\":\"datapvfadmwsrcr\"},\"etag\":\"misgwbnb\",\"id\":\"e\",\"name\":\"dawkzbali\",\"type\":\"urqhaka\"}],\"nextLink\":\"ashsfwxos\"}") + .toObject(EventHubConsumerGroupsListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EventHubConsumerGroupsListResult model = + new EventHubConsumerGroupsListResult() + .withValue( + Arrays + .asList( + new EventHubConsumerGroupInfoInner() + .withProperties(mapOf("aex", "datamdua", "vxpvgomz", "datapvfadmwsrcr")))); + model = BinaryData.fromObject(model).toObject(EventHubConsumerGroupsListResult.class); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubPropertiesTests.java new file mode 100644 index 000000000000..93555a6db058 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/EventHubPropertiesTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.EventHubProperties; +import org.junit.jupiter.api.Assertions; + +public final class EventHubPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + EventHubProperties model = + BinaryData + .fromString( + "{\"retentionTimeInDays\":6730920882568093114,\"partitionCount\":230645799,\"partitionIds\":[\"ej\"],\"path\":\"vwryoqpso\",\"endpoint\":\"ctazakljlahbcryf\"}") + .toObject(EventHubProperties.class); + Assertions.assertEquals(6730920882568093114L, model.retentionTimeInDays()); + Assertions.assertEquals(230645799, model.partitionCount()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + EventHubProperties model = + new EventHubProperties().withRetentionTimeInDays(6730920882568093114L).withPartitionCount(230645799); + model = BinaryData.fromObject(model).toObject(EventHubProperties.class); + Assertions.assertEquals(6730920882568093114L, model.retentionTimeInDays()); + Assertions.assertEquals(230645799, model.partitionCount()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FailoverInputTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FailoverInputTests.java new file mode 100644 index 000000000000..d30fdbc939ec --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FailoverInputTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.FailoverInput; +import org.junit.jupiter.api.Assertions; + +public final class FailoverInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FailoverInput model = + BinaryData.fromString("{\"failoverRegion\":\"cciuqgbdbutau\"}").toObject(FailoverInput.class); + Assertions.assertEquals("cciuqgbdbutau", model.failoverRegion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FailoverInput model = new FailoverInput().withFailoverRegion("cciuqgbdbutau"); + model = BinaryData.fromObject(model).toObject(FailoverInput.class); + Assertions.assertEquals("cciuqgbdbutau", model.failoverRegion()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FallbackRoutePropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FallbackRoutePropertiesTests.java new file mode 100644 index 000000000000..3d9d9c2605af --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FallbackRoutePropertiesTests.java @@ -0,0 +1,44 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.FallbackRouteProperties; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class FallbackRoutePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FallbackRouteProperties model = + BinaryData + .fromString( + "{\"name\":\"lyaxuc\",\"source\":\"DeviceJobLifecycleEvents\",\"condition\":\"qszf\",\"endpointNames\":[\"eyp\",\"wrmjmwvvjektc\",\"senhwlrs\"],\"isEnabled\":true}") + .toObject(FallbackRouteProperties.class); + Assertions.assertEquals("lyaxuc", model.name()); + Assertions.assertEquals(RoutingSource.DEVICE_JOB_LIFECYCLE_EVENTS, model.source()); + Assertions.assertEquals("qszf", model.condition()); + Assertions.assertEquals("eyp", model.endpointNames().get(0)); + Assertions.assertEquals(true, model.isEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FallbackRouteProperties model = + new FallbackRouteProperties() + .withName("lyaxuc") + .withSource(RoutingSource.DEVICE_JOB_LIFECYCLE_EVENTS) + .withCondition("qszf") + .withEndpointNames(Arrays.asList("eyp", "wrmjmwvvjektc", "senhwlrs")) + .withIsEnabled(true); + model = BinaryData.fromObject(model).toObject(FallbackRouteProperties.class); + Assertions.assertEquals("lyaxuc", model.name()); + Assertions.assertEquals(RoutingSource.DEVICE_JOB_LIFECYCLE_EVENTS, model.source()); + Assertions.assertEquals("qszf", model.condition()); + Assertions.assertEquals("eyp", model.endpointNames().get(0)); + Assertions.assertEquals(true, model.isEnabled()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FeedbackPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FeedbackPropertiesTests.java new file mode 100644 index 000000000000..4f02379b21b8 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/FeedbackPropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.FeedbackProperties; +import java.time.Duration; +import org.junit.jupiter.api.Assertions; + +public final class FeedbackPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FeedbackProperties model = + BinaryData + .fromString( + "{\"lockDurationAsIso8601\":\"PT19H28M11S\",\"ttlAsIso8601\":\"PT104H38M10S\",\"maxDeliveryCount\":1236632858}") + .toObject(FeedbackProperties.class); + Assertions.assertEquals(Duration.parse("PT19H28M11S"), model.lockDurationAsIso8601()); + Assertions.assertEquals(Duration.parse("PT104H38M10S"), model.ttlAsIso8601()); + Assertions.assertEquals(1236632858, model.maxDeliveryCount()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FeedbackProperties model = + new FeedbackProperties() + .withLockDurationAsIso8601(Duration.parse("PT19H28M11S")) + .withTtlAsIso8601(Duration.parse("PT104H38M10S")) + .withMaxDeliveryCount(1236632858); + model = BinaryData.fromObject(model).toObject(FeedbackProperties.class); + Assertions.assertEquals(Duration.parse("PT19H28M11S"), model.lockDurationAsIso8601()); + Assertions.assertEquals(Duration.parse("PT104H38M10S"), model.ttlAsIso8601()); + Assertions.assertEquals(1236632858, model.maxDeliveryCount()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/GroupIdInformationInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/GroupIdInformationInnerTests.java new file mode 100644 index 000000000000..aebfbfba5552 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/GroupIdInformationInnerTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; +import com.azure.resourcemanager.iothub.models.GroupIdInformationProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GroupIdInformationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GroupIdInformationInner model = + BinaryData + .fromString( + "{\"id\":\"nzar\",\"name\":\"lquuijfqkacewii\",\"type\":\"pubjibw\",\"properties\":{\"groupId\":\"f\",\"requiredMembers\":[\"qkvpuvksgplsakn\",\"n\",\"synljphuopxodl\",\"iyntorzihle\"],\"requiredZoneNames\":[\"swsrms\",\"yzrpzbchckqqzq\",\"ox\"]}}") + .toObject(GroupIdInformationInner.class); + Assertions.assertEquals("f", model.properties().groupId()); + Assertions.assertEquals("qkvpuvksgplsakn", model.properties().requiredMembers().get(0)); + Assertions.assertEquals("swsrms", model.properties().requiredZoneNames().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GroupIdInformationInner model = + new GroupIdInformationInner() + .withProperties( + new GroupIdInformationProperties() + .withGroupId("f") + .withRequiredMembers(Arrays.asList("qkvpuvksgplsakn", "n", "synljphuopxodl", "iyntorzihle")) + .withRequiredZoneNames(Arrays.asList("swsrms", "yzrpzbchckqqzq", "ox"))); + model = BinaryData.fromObject(model).toObject(GroupIdInformationInner.class); + Assertions.assertEquals("f", model.properties().groupId()); + Assertions.assertEquals("qkvpuvksgplsakn", model.properties().requiredMembers().get(0)); + Assertions.assertEquals("swsrms", model.properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/GroupIdInformationPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/GroupIdInformationPropertiesTests.java new file mode 100644 index 000000000000..706bb7733ff4 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/GroupIdInformationPropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.GroupIdInformationProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class GroupIdInformationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GroupIdInformationProperties model = + BinaryData + .fromString( + "{\"groupId\":\"suiizynkedyat\",\"requiredMembers\":[\"hqmibzyhwit\",\"mypyynpcdpu\",\"nzgmwznmabik\"],\"requiredZoneNames\":[\"rgjhxb\",\"dtlwwrlkd\",\"tncvokot\"]}") + .toObject(GroupIdInformationProperties.class); + Assertions.assertEquals("suiizynkedyat", model.groupId()); + Assertions.assertEquals("hqmibzyhwit", model.requiredMembers().get(0)); + Assertions.assertEquals("rgjhxb", model.requiredZoneNames().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GroupIdInformationProperties model = + new GroupIdInformationProperties() + .withGroupId("suiizynkedyat") + .withRequiredMembers(Arrays.asList("hqmibzyhwit", "mypyynpcdpu", "nzgmwznmabik")) + .withRequiredZoneNames(Arrays.asList("rgjhxb", "dtlwwrlkd", "tncvokot")); + model = BinaryData.fromObject(model).toObject(GroupIdInformationProperties.class); + Assertions.assertEquals("suiizynkedyat", model.groupId()); + Assertions.assertEquals("hqmibzyhwit", model.requiredMembers().get(0)); + Assertions.assertEquals("rgjhxb", model.requiredZoneNames().get(0)); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ImportDevicesRequestTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ImportDevicesRequestTests.java new file mode 100644 index 000000000000..ff9c5af048d5 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ImportDevicesRequestTests.java @@ -0,0 +1,53 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; +import org.junit.jupiter.api.Assertions; + +public final class ImportDevicesRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ImportDevicesRequest model = + BinaryData + .fromString( + "{\"inputBlobContainerUri\":\"fcnihgwq\",\"outputBlobContainerUri\":\"pnedgf\",\"inputBlobName\":\"vkcvqvpkeqd\",\"outputBlobName\":\"drhvoodsotbo\",\"authenticationType\":\"identityBased\",\"identity\":{\"userAssignedIdentity\":\"cjwvn\"},\"includeConfigurations\":false,\"configurationsBlobName\":\"wmgxcxrsl\"}") + .toObject(ImportDevicesRequest.class); + Assertions.assertEquals("fcnihgwq", model.inputBlobContainerUri()); + Assertions.assertEquals("pnedgf", model.outputBlobContainerUri()); + Assertions.assertEquals("vkcvqvpkeqd", model.inputBlobName()); + Assertions.assertEquals("drhvoodsotbo", model.outputBlobName()); + Assertions.assertEquals(AuthenticationType.IDENTITY_BASED, model.authenticationType()); + Assertions.assertEquals("cjwvn", model.identity().userAssignedIdentity()); + Assertions.assertEquals(false, model.includeConfigurations()); + Assertions.assertEquals("wmgxcxrsl", model.configurationsBlobName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ImportDevicesRequest model = + new ImportDevicesRequest() + .withInputBlobContainerUri("fcnihgwq") + .withOutputBlobContainerUri("pnedgf") + .withInputBlobName("vkcvqvpkeqd") + .withOutputBlobName("drhvoodsotbo") + .withAuthenticationType(AuthenticationType.IDENTITY_BASED) + .withIdentity(new ManagedIdentity().withUserAssignedIdentity("cjwvn")) + .withIncludeConfigurations(false) + .withConfigurationsBlobName("wmgxcxrsl"); + model = BinaryData.fromObject(model).toObject(ImportDevicesRequest.class); + Assertions.assertEquals("fcnihgwq", model.inputBlobContainerUri()); + Assertions.assertEquals("pnedgf", model.outputBlobContainerUri()); + Assertions.assertEquals("vkcvqvpkeqd", model.inputBlobName()); + Assertions.assertEquals("drhvoodsotbo", model.outputBlobName()); + Assertions.assertEquals(AuthenticationType.IDENTITY_BASED, model.authenticationType()); + Assertions.assertEquals("cjwvn", model.identity().userAssignedIdentity()); + Assertions.assertEquals(false, model.includeConfigurations()); + Assertions.assertEquals("wmgxcxrsl", model.configurationsBlobName()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubCapacityTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubCapacityTests.java new file mode 100644 index 000000000000..3e9f46fecce5 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubCapacityTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.IotHubCapacity; + +public final class IotHubCapacityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubCapacity model = + BinaryData + .fromString( + "{\"minimum\":2874780118088744582,\"maximum\":9144697658006681867,\"default\":8641218324516083606,\"scaleType\":\"Manual\"}") + .toObject(IotHubCapacity.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubCapacity model = new IotHubCapacity(); + model = BinaryData.fromObject(model).toObject(IotHubCapacity.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubDescriptionListResultTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubDescriptionListResultTests.java new file mode 100644 index 000000000000..198063445ee5 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubDescriptionListResultTests.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; +import com.azure.resourcemanager.iothub.models.ArmIdentity; +import com.azure.resourcemanager.iothub.models.Capabilities; +import com.azure.resourcemanager.iothub.models.IotHubDescriptionListResult; +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.IpVersion; +import com.azure.resourcemanager.iothub.models.PublicNetworkAccess; +import com.azure.resourcemanager.iothub.models.ResourceIdentityType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class IotHubDescriptionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubDescriptionListResult model = + BinaryData + .fromString( + "{\"value\":[{\"etag\":\"gnxytxhpzxbz\",\"properties\":{\"authorizationPolicies\":[],\"disableLocalAuth\":false,\"disableDeviceSAS\":true,\"disableModuleSAS\":true,\"restrictOutboundNetworkAccess\":true,\"allowedFqdnList\":[],\"publicNetworkAccess\":\"Enabled\",\"ipFilterRules\":[],\"minTlsVersion\":\"iklbbovpl\",\"privateEndpointConnections\":[],\"provisioningState\":\"hvgyuguosvmk\",\"state\":\"sxqu\",\"hostName\":\"fpl\",\"eventHubEndpoints\":{},\"storageEndpoints\":{},\"messagingEndpoints\":{},\"enableFileUploadNotifications\":false,\"comments\":\"kde\",\"features\":\"DeviceManagement\",\"locations\":[],\"enableDataResidency\":true,\"ipVersion\":\"ipv4ipv6\"},\"sku\":{\"name\":\"S3\",\"tier\":\"Free\",\"capacity\":8474633220472193573},\"identity\":{\"principalId\":\"baiuebbaumny\",\"tenantId\":\"ped\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{}},\"location\":\"bckhsmtxpsi\",\"tags\":{\"rdqmhjjdhtldwkyz\":\"fhvpesaps\",\"cwsvlxotog\":\"uutkncw\",\"o\":\"wrupqsxvnmicykvc\",\"vnotyfjfcnj\":\"eil\"},\"id\":\"k\",\"name\":\"nxdhbt\",\"type\":\"kphywpnvjto\"}],\"nextLink\":\"ermclfplphoxuscr\"}") + .toObject(IotHubDescriptionListResult.class); + Assertions.assertEquals("bckhsmtxpsi", model.value().get(0).location()); + Assertions.assertEquals("fhvpesaps", model.value().get(0).tags().get("rdqmhjjdhtldwkyz")); + Assertions.assertEquals("gnxytxhpzxbz", model.value().get(0).etag()); + Assertions.assertEquals(false, model.value().get(0).properties().disableLocalAuth()); + Assertions.assertEquals(true, model.value().get(0).properties().disableDeviceSas()); + Assertions.assertEquals(true, model.value().get(0).properties().disableModuleSas()); + Assertions.assertEquals(true, model.value().get(0).properties().restrictOutboundNetworkAccess()); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).properties().publicNetworkAccess()); + Assertions.assertEquals("iklbbovpl", model.value().get(0).properties().minTlsVersion()); + Assertions.assertEquals(false, model.value().get(0).properties().enableFileUploadNotifications()); + Assertions.assertEquals("kde", model.value().get(0).properties().comments()); + Assertions.assertEquals(Capabilities.DEVICE_MANAGEMENT, model.value().get(0).properties().features()); + Assertions.assertEquals(true, model.value().get(0).properties().enableDataResidency()); + Assertions.assertEquals(IpVersion.IPV4IPV6, model.value().get(0).properties().ipVersion()); + Assertions.assertEquals(IotHubSku.S3, model.value().get(0).sku().name()); + Assertions.assertEquals(8474633220472193573L, model.value().get(0).sku().capacity()); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubDescriptionListResult model = + new IotHubDescriptionListResult() + .withValue( + Arrays + .asList( + new IotHubDescriptionInner() + .withLocation("bckhsmtxpsi") + .withTags( + mapOf( + "rdqmhjjdhtldwkyz", + "fhvpesaps", + "cwsvlxotog", + "uutkncw", + "o", + "wrupqsxvnmicykvc", + "vnotyfjfcnj", + "eil")) + .withEtag("gnxytxhpzxbz") + .withProperties( + new IotHubProperties() + .withAuthorizationPolicies(Arrays.asList()) + .withDisableLocalAuth(false) + .withDisableDeviceSas(true) + .withDisableModuleSas(true) + .withRestrictOutboundNetworkAccess(true) + .withAllowedFqdnList(Arrays.asList()) + .withPublicNetworkAccess(PublicNetworkAccess.ENABLED) + .withIpFilterRules(Arrays.asList()) + .withMinTlsVersion("iklbbovpl") + .withPrivateEndpointConnections(Arrays.asList()) + .withEventHubEndpoints(mapOf()) + .withStorageEndpoints(mapOf()) + .withMessagingEndpoints(mapOf()) + .withEnableFileUploadNotifications(false) + .withComments("kde") + .withFeatures(Capabilities.DEVICE_MANAGEMENT) + .withEnableDataResidency(true) + .withIpVersion(IpVersion.IPV4IPV6)) + .withSku(new IotHubSkuInfo().withName(IotHubSku.S3).withCapacity(8474633220472193573L)) + .withIdentity( + new ArmIdentity() + .withType(ResourceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf())))); + model = BinaryData.fromObject(model).toObject(IotHubDescriptionListResult.class); + Assertions.assertEquals("bckhsmtxpsi", model.value().get(0).location()); + Assertions.assertEquals("fhvpesaps", model.value().get(0).tags().get("rdqmhjjdhtldwkyz")); + Assertions.assertEquals("gnxytxhpzxbz", model.value().get(0).etag()); + Assertions.assertEquals(false, model.value().get(0).properties().disableLocalAuth()); + Assertions.assertEquals(true, model.value().get(0).properties().disableDeviceSas()); + Assertions.assertEquals(true, model.value().get(0).properties().disableModuleSas()); + Assertions.assertEquals(true, model.value().get(0).properties().restrictOutboundNetworkAccess()); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, model.value().get(0).properties().publicNetworkAccess()); + Assertions.assertEquals("iklbbovpl", model.value().get(0).properties().minTlsVersion()); + Assertions.assertEquals(false, model.value().get(0).properties().enableFileUploadNotifications()); + Assertions.assertEquals("kde", model.value().get(0).properties().comments()); + Assertions.assertEquals(Capabilities.DEVICE_MANAGEMENT, model.value().get(0).properties().features()); + Assertions.assertEquals(true, model.value().get(0).properties().enableDataResidency()); + Assertions.assertEquals(IpVersion.IPV4IPV6, model.value().get(0).properties().ipVersion()); + Assertions.assertEquals(IotHubSku.S3, model.value().get(0).sku().name()); + Assertions.assertEquals(8474633220472193573L, model.value().get(0).sku().capacity()); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubLocationDescriptionTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubLocationDescriptionTests.java new file mode 100644 index 000000000000..c0c8bb8600d4 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubLocationDescriptionTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.IotHubLocationDescription; +import com.azure.resourcemanager.iothub.models.IotHubReplicaRoleType; +import org.junit.jupiter.api.Assertions; + +public final class IotHubLocationDescriptionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubLocationDescription model = + BinaryData + .fromString("{\"location\":\"ijhtxf\",\"role\":\"primary\"}") + .toObject(IotHubLocationDescription.class); + Assertions.assertEquals("ijhtxf", model.location()); + Assertions.assertEquals(IotHubReplicaRoleType.PRIMARY, model.role()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubLocationDescription model = + new IotHubLocationDescription().withLocation("ijhtxf").withRole(IotHubReplicaRoleType.PRIMARY); + model = BinaryData.fromObject(model).toObject(IotHubLocationDescription.class); + Assertions.assertEquals("ijhtxf", model.location()); + Assertions.assertEquals(IotHubReplicaRoleType.PRIMARY, model.role()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubNameAvailabilityInfoInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubNameAvailabilityInfoInnerTests.java new file mode 100644 index 000000000000..9fa8712a2535 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubNameAvailabilityInfoInnerTests.java @@ -0,0 +1,27 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.IotHubNameAvailabilityInfoInner; +import org.junit.jupiter.api.Assertions; + +public final class IotHubNameAvailabilityInfoInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubNameAvailabilityInfoInner model = + BinaryData + .fromString("{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"vbxwyjsflhh\"}") + .toObject(IotHubNameAvailabilityInfoInner.class); + Assertions.assertEquals("vbxwyjsflhh", model.message()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubNameAvailabilityInfoInner model = new IotHubNameAvailabilityInfoInner().withMessage("vbxwyjsflhh"); + model = BinaryData.fromObject(model).toObject(IotHubNameAvailabilityInfoInner.class); + Assertions.assertEquals("vbxwyjsflhh", model.message()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubPropertiesDeviceStreamsTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubPropertiesDeviceStreamsTests.java new file mode 100644 index 000000000000..023e53084d2d --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubPropertiesDeviceStreamsTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.IotHubPropertiesDeviceStreams; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class IotHubPropertiesDeviceStreamsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubPropertiesDeviceStreams model = + BinaryData + .fromString("{\"streamingEndpoints\":[\"pcyvahfnljkyqx\",\"vuujq\",\"idokgjlj\"]}") + .toObject(IotHubPropertiesDeviceStreams.class); + Assertions.assertEquals("pcyvahfnljkyqx", model.streamingEndpoints().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubPropertiesDeviceStreams model = + new IotHubPropertiesDeviceStreams() + .withStreamingEndpoints(Arrays.asList("pcyvahfnljkyqx", "vuujq", "idokgjlj")); + model = BinaryData.fromObject(model).toObject(IotHubPropertiesDeviceStreams.class); + Assertions.assertEquals("pcyvahfnljkyqx", model.streamingEndpoints().get(0)); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubQuotaMetricInfoInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubQuotaMetricInfoInnerTests.java new file mode 100644 index 000000000000..94c7bf06abad --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubQuotaMetricInfoInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; + +public final class IotHubQuotaMetricInfoInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubQuotaMetricInfoInner model = + BinaryData + .fromString("{\"name\":\"ibycno\",\"currentValue\":4247317532240790185,\"maxValue\":35726863806871709}") + .toObject(IotHubQuotaMetricInfoInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubQuotaMetricInfoInner model = new IotHubQuotaMetricInfoInner(); + model = BinaryData.fromObject(model).toObject(IotHubQuotaMetricInfoInner.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubQuotaMetricInfoListResultTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubQuotaMetricInfoListResultTests.java new file mode 100644 index 000000000000..199f26c2b0a1 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubQuotaMetricInfoListResultTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; +import com.azure.resourcemanager.iothub.models.IotHubQuotaMetricInfoListResult; +import java.util.Arrays; + +public final class IotHubQuotaMetricInfoListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubQuotaMetricInfoListResult model = + BinaryData + .fromString( + "{\"value\":[{\"name\":\"vlvqhjkbegi\",\"currentValue\":7757966335492850327,\"maxValue\":8168827985153452849},{\"name\":\"wwaloayqcgwrt\",\"currentValue\":1503893081288679809,\"maxValue\":203566108787836432},{\"name\":\"mhtxongmtsavjcb\",\"currentValue\":4203274454921698643,\"maxValue\":273530932074575825},{\"name\":\"nftguvriuhpr\",\"currentValue\":4550073852873606939,\"maxValue\":2697266994096414506}],\"nextLink\":\"ayriwwroyqbexrm\"}") + .toObject(IotHubQuotaMetricInfoListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubQuotaMetricInfoListResult model = + new IotHubQuotaMetricInfoListResult() + .withValue( + Arrays + .asList( + new IotHubQuotaMetricInfoInner(), + new IotHubQuotaMetricInfoInner(), + new IotHubQuotaMetricInfoInner(), + new IotHubQuotaMetricInfoInner())); + model = BinaryData.fromObject(model).toObject(IotHubQuotaMetricInfoListResult.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesCheckNameAvailabilityWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesCheckNameAvailabilityWithResponseMockTests.java new file mode 100644 index 000000000000..a1e5554d9051 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesCheckNameAvailabilityWithResponseMockTests.java @@ -0,0 +1,71 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.IotHubNameAvailabilityInfo; +import com.azure.resourcemanager.iothub.models.OperationInputs; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesCheckNameAvailabilityWithResponseMockTests { + @Test + public void testCheckNameAvailabilityWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"uslfead\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + IotHubNameAvailabilityInfo response = + manager + .iotHubResources() + .checkNameAvailabilityWithResponse( + new OperationInputs().withName("dtclusiypb"), com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("uslfead", response.message()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesCreateEventHubConsumerGroupWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesCreateEventHubConsumerGroupWithResponseMockTests.java new file mode 100644 index 000000000000..54e510be0fdc --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesCreateEventHubConsumerGroupWithResponseMockTests.java @@ -0,0 +1,70 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupInfo; +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupName; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesCreateEventHubConsumerGroupWithResponseMockTests { + @Test + public void testCreateEventHubConsumerGroupWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"dhtmdvypgikd\":\"datangwfqatm\"},\"etag\":\"zywkb\",\"id\":\"rryuzhlhkjo\",\"name\":\"rvqqaatj\",\"type\":\"nrvgoupmfiibfgg\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + EventHubConsumerGroupInfo response = + manager + .iotHubResources() + .defineEventHubConsumerGroup("csnjvcdwxlpqekft") + .withExistingEventHubEndpoint("opgxedkowepb", "pc", "fkbw") + .withProperties(new EventHubConsumerGroupName().withName("khtj")) + .create(); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesDeleteEventHubConsumerGroupWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesDeleteEventHubConsumerGroupWithResponseMockTests.java new file mode 100644 index 000000000000..5b4001c8d852 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesDeleteEventHubConsumerGroupWithResponseMockTests.java @@ -0,0 +1,64 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesDeleteEventHubConsumerGroupWithResponseMockTests { + @Test + public void testDeleteEventHubConsumerGroupWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .iotHubResources() + .deleteEventHubConsumerGroupWithResponse( + "qgsfraoyzkoow", "lmnguxaw", "aldsy", "uximerqfobw", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetEndpointHealthMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetEndpointHealthMockTests.java new file mode 100644 index 000000000000..3e334d389cef --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetEndpointHealthMockTests.java @@ -0,0 +1,83 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.EndpointHealthData; +import com.azure.resourcemanager.iothub.models.EndpointHealthStatus; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesGetEndpointHealthMockTests { + @Test + public void testGetEndpointHealth() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"endpointId\":\"gicccnxqhuex\",\"healthStatus\":\"healthy\",\"lastKnownError\":\"lstvlzywe\",\"lastKnownErrorTime\":\"Fri," + + " 10 Dec 2021 13:38:49 GMT\",\"lastSuccessfulSendAttemptTime\":\"Tue, 25 May 2021 03:52:53" + + " GMT\",\"lastSendAttemptTime\":\"Wed, 07 Apr 2021 16:00:46 GMT\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.iotHubResources().getEndpointHealth("swe", "pqwd", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("gicccnxqhuex", response.iterator().next().endpointId()); + Assertions.assertEquals(EndpointHealthStatus.HEALTHY, response.iterator().next().healthStatus()); + Assertions.assertEquals("lstvlzywe", response.iterator().next().lastKnownError()); + Assertions + .assertEquals( + OffsetDateTime.parse("2021-12-10T13:38:49Z"), response.iterator().next().lastKnownErrorTime()); + Assertions + .assertEquals( + OffsetDateTime.parse("2021-05-25T03:52:53Z"), + response.iterator().next().lastSuccessfulSendAttemptTime()); + Assertions + .assertEquals( + OffsetDateTime.parse("2021-04-07T16:00:46Z"), response.iterator().next().lastSendAttemptTime()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetEventHubConsumerGroupWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetEventHubConsumerGroupWithResponseMockTests.java new file mode 100644 index 000000000000..a9a3c87be377 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetEventHubConsumerGroupWithResponseMockTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupInfo; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesGetEventHubConsumerGroupWithResponseMockTests { + @Test + public void testGetEventHubConsumerGroupWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"ujmqlgkfbtndoa\":\"datau\",\"bjcntujitc\":\"datan\",\"twwaezkojvdcpzf\":\"dataed\",\"foxciq\":\"dataqouicybxarzgsz\"},\"etag\":\"idoamciodhkha\",\"id\":\"xkhnzbonlwnto\",\"name\":\"gokdwbwhks\",\"type\":\"zcmrvexztvb\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + EventHubConsumerGroupInfo response = + manager + .iotHubResources() + .getEventHubConsumerGroupWithResponse( + "wjue", "aeburuvdmo", "s", "zlxwabmqoefkifr", com.azure.core.util.Context.NONE) + .getValue(); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetJobWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetJobWithResponseMockTests.java new file mode 100644 index 000000000000..cbb47a86f79b --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetJobWithResponseMockTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.JobResponse; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesGetJobWithResponseMockTests { + @Test + public void testGetJobWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"jobId\":\"fozbhdmsmlmzqhof\",\"startTimeUtc\":\"Wed, 05 May 2021 04:42:21 GMT\",\"endTimeUtc\":\"Tue," + + " 16 Nov 2021 17:43:34" + + " GMT\",\"type\":\"readDeviceProperties\",\"status\":\"failed\",\"failureReason\":\"xicslfao\",\"statusMessage\":\"piyylhalnswhccsp\",\"parentJobId\":\"aivwitqscywu\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + JobResponse response = + manager + .iotHubResources() + .getJobWithResponse("enuuzkopbm", "nrfdw", "yuhhziu", com.azure.core.util.Context.NONE) + .getValue(); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetQuotaMetricsMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetQuotaMetricsMockTests.java new file mode 100644 index 000000000000..3658c9401382 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetQuotaMetricsMockTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.IotHubQuotaMetricInfo; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesGetQuotaMetricsMockTests { + @Test + public void testGetQuotaMetrics() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"name\":\"bwemhairs\",\"currentValue\":2396598992556522813,\"maxValue\":1910924176223083649}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.iotHubResources().getQuotaMetrics("gwol", "h", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetStatsWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetStatsWithResponseMockTests.java new file mode 100644 index 000000000000..403f7571037d --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetStatsWithResponseMockTests.java @@ -0,0 +1,67 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.RegistryStatistics; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesGetStatsWithResponseMockTests { + @Test + public void testGetStatsWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"totalDeviceCount\":1881000145918379423,\"enabledDeviceCount\":5500271153534098761,\"disabledDeviceCount\":6702265057684474491}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + RegistryStatistics response = + manager + .iotHubResources() + .getStatsWithResponse("ofncckwyfzqwhxxb", "yq", com.azure.core.util.Context.NONE) + .getValue(); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetValidSkusMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetValidSkusMockTests.java new file mode 100644 index 000000000000..006754707ca6 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesGetValidSkusMockTests.java @@ -0,0 +1,70 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.IotHubSku; +import com.azure.resourcemanager.iothub.models.IotHubSkuDescription; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesGetValidSkusMockTests { + @Test + public void testGetValidSkus() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"resourceType\":\"bqwcsdbnwdcf\",\"sku\":{\"name\":\"S2\",\"tier\":\"Standard\",\"capacity\":3846405596035643939},\"capacity\":{\"minimum\":1028769978978951070,\"maximum\":4684256943455156597,\"default\":6093345050470116807,\"scaleType\":\"Manual\"}}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.iotHubResources().getValidSkus("riolxorjalt", "lmncw", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(IotHubSku.S2, response.iterator().next().sku().name()); + Assertions.assertEquals(3846405596035643939L, response.iterator().next().sku().capacity()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesImportDevicesWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesImportDevicesWithResponseMockTests.java new file mode 100644 index 000000000000..6419a1058e68 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesImportDevicesWithResponseMockTests.java @@ -0,0 +1,84 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; +import com.azure.resourcemanager.iothub.models.JobResponse; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesImportDevicesWithResponseMockTests { + @Test + public void testImportDevicesWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"jobId\":\"kvtvsexso\",\"startTimeUtc\":\"Sat, 09 Jan 2021 15:20:12 GMT\",\"endTimeUtc\":\"Thu, 28 Jan" + + " 2021 09:30:25" + + " GMT\",\"type\":\"readDeviceProperties\",\"status\":\"completed\",\"failureReason\":\"hxvrhmzkwpjg\",\"statusMessage\":\"spughftqsxhq\",\"parentJobId\":\"j\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + JobResponse response = + manager + .iotHubResources() + .importDevicesWithResponse( + "gzpfrla", + "szrnwo", + new ImportDevicesRequest() + .withInputBlobContainerUri("indfpwpjyl") + .withOutputBlobContainerUri("bt") + .withInputBlobName("flsjc") + .withOutputBlobName("szfjvfbgofelja") + .withAuthenticationType(AuthenticationType.IDENTITY_BASED) + .withIdentity(new ManagedIdentity().withUserAssignedIdentity("hldvriii")) + .withIncludeConfigurations(true) + .withConfigurationsBlobName("lg"), + com.azure.core.util.Context.NONE) + .getValue(); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesListEventHubConsumerGroupsMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesListEventHubConsumerGroupsMockTests.java new file mode 100644 index 000000000000..5f7e916f7048 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesListEventHubConsumerGroupsMockTests.java @@ -0,0 +1,67 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupInfo; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesListEventHubConsumerGroupsMockTests { + @Test + public void testListEventHubConsumerGroups() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"properties\":{\"kgjubgdknnqvsazn\":\"datalxqtvcofudfl\"},\"etag\":\"tor\",\"id\":\"dsg\",\"name\":\"a\",\"type\":\"mkycgra\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager + .iotHubResources() + .listEventHubConsumerGroups("vxb", "t", "udutnco", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesListJobsMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesListJobsMockTests.java new file mode 100644 index 000000000000..029b1156ec60 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesListJobsMockTests.java @@ -0,0 +1,67 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.JobResponse; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesListJobsMockTests { + @Test + public void testListJobs() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"jobId\":\"dsnfdsdoakgtdl\",\"startTimeUtc\":\"Sat, 23 Oct 2021 18:05:06" + + " GMT\",\"endTimeUtc\":\"Mon, 21 Jun 2021 09:18:55" + + " GMT\",\"type\":\"writeDeviceProperties\",\"status\":\"enqueued\",\"failureReason\":\"wpusdsttwvogv\",\"statusMessage\":\"ejdcngqqmoakuf\",\"parentJobId\":\"jzrwrdgrtw\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = + manager.iotHubResources().listJobs("znkbykutwpfhpagm", "r", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesTestAllRoutesWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesTestAllRoutesWithResponseMockTests.java new file mode 100644 index 000000000000..94215f051155 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesTestAllRoutesWithResponseMockTests.java @@ -0,0 +1,101 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.RoutingMessage; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import com.azure.resourcemanager.iothub.models.RoutingTwin; +import com.azure.resourcemanager.iothub.models.RoutingTwinProperties; +import com.azure.resourcemanager.iothub.models.TestAllRoutesInput; +import com.azure.resourcemanager.iothub.models.TestAllRoutesResult; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesTestAllRoutesWithResponseMockTests { + @Test + public void testTestAllRoutesWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"routes\":[{}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + TestAllRoutesResult response = + manager + .iotHubResources() + .testAllRoutesWithResponse( + "ygqukyhejh", + "isxgfp", + new TestAllRoutesInput() + .withRoutingSource(RoutingSource.DEVICE_CONNECTION_STATE_EVENTS) + .withMessage( + new RoutingMessage() + .withBody("pv") + .withAppProperties(mapOf("swibyr", "pqvujzraehtwdwrf")) + .withSystemProperties(mapOf("hevxcced", "bhshfwpracstwity"))) + .withTwin( + new RoutingTwin() + .withTags("datamd") + .withProperties( + new RoutingTwinProperties() + .withDesired("datanwzxltjcv") + .withReported("dataltiugcxnavv"))), + com.azure.core.util.Context.NONE) + .getValue(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesTestRouteWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesTestRouteWithResponseMockTests.java new file mode 100644 index 000000000000..e62cb8cf08c8 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubResourcesTestRouteWithResponseMockTests.java @@ -0,0 +1,113 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +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.RoutingTwin; +import com.azure.resourcemanager.iothub.models.RoutingTwinProperties; +import com.azure.resourcemanager.iothub.models.TestResultStatus; +import com.azure.resourcemanager.iothub.models.TestRouteInput; +import com.azure.resourcemanager.iothub.models.TestRouteResult; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubResourcesTestRouteWithResponseMockTests { + @Test + public void testTestRouteWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{\"result\":\"undefined\",\"details\":{\"compilationErrors\":[]}}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + TestRouteResult response = + manager + .iotHubResources() + .testRouteWithResponse( + "byqunyow", + "wlmdjrkv", + new TestRouteInput() + .withMessage( + new RoutingMessage() + .withBody("vfvpdbodaciz") + .withAppProperties(mapOf("hvxndzwmkrefajpj", "lhkrribdeibqipqk")) + .withSystemProperties(mapOf("b", "kqnyh", "jivfxzsjabib", "j"))) + .withRoute( + new RouteProperties() + .withName("ystawfsdjpvkvp") + .withSource(RoutingSource.DIGITAL_TWIN_CHANGE_EVENTS) + .withCondition("bkzbzkd") + .withEndpointNames(Arrays.asList("cjabudurgkakmo")) + .withIsEnabled(true)) + .withTwin( + new RoutingTwin() + .withTags("datajk") + .withProperties( + new RoutingTwinProperties() + .withDesired("datahmouwqlgzrfze") + .withReported("dataebizikayuh"))), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(TestResultStatus.UNDEFINED, response.result()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuDescriptionInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuDescriptionInnerTests.java new file mode 100644 index 000000000000..1d052317f760 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuDescriptionInnerTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; +import com.azure.resourcemanager.iothub.models.IotHubCapacity; +import com.azure.resourcemanager.iothub.models.IotHubSku; +import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; +import org.junit.jupiter.api.Assertions; + +public final class IotHubSkuDescriptionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubSkuDescriptionInner model = + BinaryData + .fromString( + "{\"resourceType\":\"srtslhspkdeem\",\"sku\":{\"name\":\"S3\",\"tier\":\"Basic\",\"capacity\":1461011233299690621},\"capacity\":{\"minimum\":1611861407793999607,\"maximum\":5342331061504753909,\"default\":2936969663422181948,\"scaleType\":\"Automatic\"}}") + .toObject(IotHubSkuDescriptionInner.class); + Assertions.assertEquals(IotHubSku.S3, model.sku().name()); + Assertions.assertEquals(1461011233299690621L, model.sku().capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubSkuDescriptionInner model = + new IotHubSkuDescriptionInner() + .withSku(new IotHubSkuInfo().withName(IotHubSku.S3).withCapacity(1461011233299690621L)) + .withCapacity(new IotHubCapacity()); + model = BinaryData.fromObject(model).toObject(IotHubSkuDescriptionInner.class); + Assertions.assertEquals(IotHubSku.S3, model.sku().name()); + Assertions.assertEquals(1461011233299690621L, model.sku().capacity()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuDescriptionListResultTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuDescriptionListResultTests.java new file mode 100644 index 000000000000..f5610049f6e7 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuDescriptionListResultTests.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.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; +import com.azure.resourcemanager.iothub.models.IotHubCapacity; +import com.azure.resourcemanager.iothub.models.IotHubSku; +import com.azure.resourcemanager.iothub.models.IotHubSkuDescriptionListResult; +import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class IotHubSkuDescriptionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubSkuDescriptionListResult model = + BinaryData + .fromString( + "{\"value\":[{\"resourceType\":\"qugxywpmueefjzwf\",\"sku\":{\"name\":\"B1\",\"tier\":\"Free\",\"capacity\":2752624738826273376},\"capacity\":{\"minimum\":2895240290674738337,\"maximum\":722648832186407891,\"default\":5846205401797666469,\"scaleType\":\"Automatic\"}},{\"resourceType\":\"qxtccmgyudx\",\"sku\":{\"name\":\"B2\",\"tier\":\"Standard\",\"capacity\":5036022727729954665},\"capacity\":{\"minimum\":5697722366346871182,\"maximum\":328428173774055677,\"default\":1705151259952930874,\"scaleType\":\"None\"}},{\"resourceType\":\"hdzhlrqj\",\"sku\":{\"name\":\"B2\",\"tier\":\"Standard\",\"capacity\":6374623406138918990},\"capacity\":{\"minimum\":8781176229641624570,\"maximum\":5275318016138914703,\"default\":1967797899884280622,\"scaleType\":\"None\"}},{\"resourceType\":\"n\",\"sku\":{\"name\":\"S2\",\"tier\":\"Free\",\"capacity\":5373828477618369096},\"capacity\":{\"minimum\":739899630467630797,\"maximum\":574839923891984639,\"default\":6504833090063292182,\"scaleType\":\"Automatic\"}}],\"nextLink\":\"hhseyv\"}") + .toObject(IotHubSkuDescriptionListResult.class); + Assertions.assertEquals(IotHubSku.B1, model.value().get(0).sku().name()); + Assertions.assertEquals(2752624738826273376L, model.value().get(0).sku().capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubSkuDescriptionListResult model = + new IotHubSkuDescriptionListResult() + .withValue( + Arrays + .asList( + new IotHubSkuDescriptionInner() + .withSku(new IotHubSkuInfo().withName(IotHubSku.B1).withCapacity(2752624738826273376L)) + .withCapacity(new IotHubCapacity()), + new IotHubSkuDescriptionInner() + .withSku(new IotHubSkuInfo().withName(IotHubSku.B2).withCapacity(5036022727729954665L)) + .withCapacity(new IotHubCapacity()), + new IotHubSkuDescriptionInner() + .withSku(new IotHubSkuInfo().withName(IotHubSku.B2).withCapacity(6374623406138918990L)) + .withCapacity(new IotHubCapacity()), + new IotHubSkuDescriptionInner() + .withSku(new IotHubSkuInfo().withName(IotHubSku.S2).withCapacity(5373828477618369096L)) + .withCapacity(new IotHubCapacity()))); + model = BinaryData.fromObject(model).toObject(IotHubSkuDescriptionListResult.class); + Assertions.assertEquals(IotHubSku.B1, model.value().get(0).sku().name()); + Assertions.assertEquals(2752624738826273376L, model.value().get(0).sku().capacity()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuInfoTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuInfoTests.java new file mode 100644 index 000000000000..3fe350ea0473 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubSkuInfoTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.IotHubSku; +import com.azure.resourcemanager.iothub.models.IotHubSkuInfo; +import org.junit.jupiter.api.Assertions; + +public final class IotHubSkuInfoTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubSkuInfo model = + BinaryData + .fromString("{\"name\":\"F1\",\"tier\":\"Free\",\"capacity\":6629328138871723809}") + .toObject(IotHubSkuInfo.class); + Assertions.assertEquals(IotHubSku.F1, model.name()); + Assertions.assertEquals(6629328138871723809L, model.capacity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IotHubSkuInfo model = new IotHubSkuInfo().withName(IotHubSku.F1).withCapacity(6629328138871723809L); + model = BinaryData.fromObject(model).toObject(IotHubSkuInfo.class); + Assertions.assertEquals(IotHubSku.F1, model.name()); + Assertions.assertEquals(6629328138871723809L, model.capacity()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubsManualFailoverMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubsManualFailoverMockTests.java new file mode 100644 index 000000000000..6e80d396a3fc --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubsManualFailoverMockTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.FailoverInput; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class IotHubsManualFailoverMockTests { + @Test + public void testManualFailover() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = "{}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager + .iotHubs() + .manualFailover( + "ggufhyaomtb", + "hhavgrvkffovjz", + new FailoverInput().withFailoverRegion("pjbi"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IpFilterRuleTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IpFilterRuleTests.java new file mode 100644 index 000000000000..9e18bb2a6132 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IpFilterRuleTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.IpFilterActionType; +import com.azure.resourcemanager.iothub.models.IpFilterRule; +import org.junit.jupiter.api.Assertions; + +public final class IpFilterRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IpFilterRule model = + BinaryData + .fromString("{\"filterName\":\"git\",\"action\":\"Accept\",\"ipMask\":\"qhabifpikxwcz\"}") + .toObject(IpFilterRule.class); + Assertions.assertEquals("git", model.filterName()); + Assertions.assertEquals(IpFilterActionType.ACCEPT, model.action()); + Assertions.assertEquals("qhabifpikxwcz", model.ipMask()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IpFilterRule model = + new IpFilterRule().withFilterName("git").withAction(IpFilterActionType.ACCEPT).withIpMask("qhabifpikxwcz"); + model = BinaryData.fromObject(model).toObject(IpFilterRule.class); + Assertions.assertEquals("git", model.filterName()); + Assertions.assertEquals(IpFilterActionType.ACCEPT, model.action()); + Assertions.assertEquals("qhabifpikxwcz", model.ipMask()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/JobResponseInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/JobResponseInnerTests.java new file mode 100644 index 000000000000..f67fb5faa5c3 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/JobResponseInnerTests.java @@ -0,0 +1,27 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; + +public final class JobResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobResponseInner model = + BinaryData + .fromString( + "{\"jobId\":\"lupj\",\"startTimeUtc\":\"Wed, 21 Apr 2021 08:53:38 GMT\",\"endTimeUtc\":\"Mon, 26" + + " Apr 2021 22:12:21" + + " GMT\",\"type\":\"import\",\"status\":\"completed\",\"failureReason\":\"wsrtjriplrbpbe\",\"statusMessage\":\"ghfg\",\"parentJobId\":\"c\"}") + .toObject(JobResponseInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + JobResponseInner model = new JobResponseInner(); + model = BinaryData.fromObject(model).toObject(JobResponseInner.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/JobResponseListResultTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/JobResponseListResultTests.java new file mode 100644 index 000000000000..356fda77e2ad --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/JobResponseListResultTests.java @@ -0,0 +1,29 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; +import com.azure.resourcemanager.iothub.models.JobResponseListResult; +import java.util.Arrays; + +public final class JobResponseListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + JobResponseListResult model = + BinaryData + .fromString( + "{\"value\":[{\"jobId\":\"skxfbk\",\"startTimeUtc\":\"Fri, 05 Feb 2021 18:39:24" + + " GMT\",\"endTimeUtc\":\"Sun, 14 Feb 2021 18:57:00" + + " GMT\",\"type\":\"writeDeviceProperties\",\"status\":\"completed\",\"failureReason\":\"hjdauwhvylwz\",\"statusMessage\":\"dhxujznbmpo\",\"parentJobId\":\"wpr\"}],\"nextLink\":\"lve\"}") + .toObject(JobResponseListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + JobResponseListResult model = new JobResponseListResult().withValue(Arrays.asList(new JobResponseInner())); + model = BinaryData.fromObject(model).toObject(JobResponseListResult.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ManagedIdentityTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ManagedIdentityTests.java new file mode 100644 index 000000000000..ae9f03a5015c --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ManagedIdentityTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; +import org.junit.jupiter.api.Assertions; + +public final class ManagedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedIdentity model = + BinaryData.fromString("{\"userAssignedIdentity\":\"czvyifq\"}").toObject(ManagedIdentity.class); + Assertions.assertEquals("czvyifq", model.userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedIdentity model = new ManagedIdentity().withUserAssignedIdentity("czvyifq"); + model = BinaryData.fromObject(model).toObject(ManagedIdentity.class); + Assertions.assertEquals("czvyifq", model.userAssignedIdentity()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/MatchedRouteTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/MatchedRouteTests.java new file mode 100644 index 000000000000..935cf6b5d5b7 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/MatchedRouteTests.java @@ -0,0 +1,47 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.MatchedRoute; +import com.azure.resourcemanager.iothub.models.RouteProperties; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class MatchedRouteTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MatchedRoute model = + BinaryData + .fromString( + "{\"properties\":{\"name\":\"gynduha\",\"source\":\"DigitalTwinChangeEvents\",\"condition\":\"lkthu\",\"endpointNames\":[\"qolbgyc\",\"uie\",\"tgccymvaolpss\",\"qlfmmdnbb\"],\"isEnabled\":true}}") + .toObject(MatchedRoute.class); + Assertions.assertEquals("gynduha", model.properties().name()); + Assertions.assertEquals(RoutingSource.DIGITAL_TWIN_CHANGE_EVENTS, model.properties().source()); + Assertions.assertEquals("lkthu", model.properties().condition()); + Assertions.assertEquals("qolbgyc", model.properties().endpointNames().get(0)); + Assertions.assertEquals(true, model.properties().isEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MatchedRoute model = + new MatchedRoute() + .withProperties( + new RouteProperties() + .withName("gynduha") + .withSource(RoutingSource.DIGITAL_TWIN_CHANGE_EVENTS) + .withCondition("lkthu") + .withEndpointNames(Arrays.asList("qolbgyc", "uie", "tgccymvaolpss", "qlfmmdnbb")) + .withIsEnabled(true)); + model = BinaryData.fromObject(model).toObject(MatchedRoute.class); + Assertions.assertEquals("gynduha", model.properties().name()); + Assertions.assertEquals(RoutingSource.DIGITAL_TWIN_CHANGE_EVENTS, model.properties().source()); + Assertions.assertEquals("lkthu", model.properties().condition()); + Assertions.assertEquals("qolbgyc", model.properties().endpointNames().get(0)); + Assertions.assertEquals(true, model.properties().isEnabled()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/MessagingEndpointPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/MessagingEndpointPropertiesTests.java new file mode 100644 index 000000000000..012ac5d11736 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/MessagingEndpointPropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.MessagingEndpointProperties; +import java.time.Duration; +import org.junit.jupiter.api.Assertions; + +public final class MessagingEndpointPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MessagingEndpointProperties model = + BinaryData + .fromString( + "{\"lockDurationAsIso8601\":\"PT61H42M35S\",\"ttlAsIso8601\":\"PT18H25M44S\",\"maxDeliveryCount\":1688727412}") + .toObject(MessagingEndpointProperties.class); + Assertions.assertEquals(Duration.parse("PT61H42M35S"), model.lockDurationAsIso8601()); + Assertions.assertEquals(Duration.parse("PT18H25M44S"), model.ttlAsIso8601()); + Assertions.assertEquals(1688727412, model.maxDeliveryCount()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + MessagingEndpointProperties model = + new MessagingEndpointProperties() + .withLockDurationAsIso8601(Duration.parse("PT61H42M35S")) + .withTtlAsIso8601(Duration.parse("PT18H25M44S")) + .withMaxDeliveryCount(1688727412); + model = BinaryData.fromObject(model).toObject(MessagingEndpointProperties.class); + Assertions.assertEquals(Duration.parse("PT61H42M35S"), model.lockDurationAsIso8601()); + Assertions.assertEquals(Duration.parse("PT18H25M44S"), model.ttlAsIso8601()); + Assertions.assertEquals(1688727412, model.maxDeliveryCount()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NameTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NameTests.java new file mode 100644 index 000000000000..04edc5aef8cf --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NameTests.java @@ -0,0 +1,29 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.Name; +import org.junit.jupiter.api.Assertions; + +public final class NameTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Name model = + BinaryData + .fromString("{\"value\":\"gktrmgucnapkte\",\"localizedValue\":\"llwptfdy\"}") + .toObject(Name.class); + Assertions.assertEquals("gktrmgucnapkte", model.value()); + Assertions.assertEquals("llwptfdy", model.localizedValue()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + Name model = new Name().withValue("gktrmgucnapkte").withLocalizedValue("llwptfdy"); + model = BinaryData.fromObject(model).toObject(Name.class); + Assertions.assertEquals("gktrmgucnapkte", model.value()); + Assertions.assertEquals("llwptfdy", model.localizedValue()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NetworkRuleSetIpRuleTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NetworkRuleSetIpRuleTests.java new file mode 100644 index 000000000000..d311375f0218 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NetworkRuleSetIpRuleTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.NetworkRuleIpAction; +import com.azure.resourcemanager.iothub.models.NetworkRuleSetIpRule; +import org.junit.jupiter.api.Assertions; + +public final class NetworkRuleSetIpRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkRuleSetIpRule model = + BinaryData + .fromString("{\"filterName\":\"vd\",\"action\":\"Allow\",\"ipMask\":\"grtfwvu\"}") + .toObject(NetworkRuleSetIpRule.class); + Assertions.assertEquals("vd", model.filterName()); + Assertions.assertEquals(NetworkRuleIpAction.ALLOW, model.action()); + Assertions.assertEquals("grtfwvu", model.ipMask()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkRuleSetIpRule model = + new NetworkRuleSetIpRule().withFilterName("vd").withAction(NetworkRuleIpAction.ALLOW).withIpMask("grtfwvu"); + model = BinaryData.fromObject(model).toObject(NetworkRuleSetIpRule.class); + Assertions.assertEquals("vd", model.filterName()); + Assertions.assertEquals(NetworkRuleIpAction.ALLOW, model.action()); + Assertions.assertEquals("grtfwvu", model.ipMask()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NetworkRuleSetPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NetworkRuleSetPropertiesTests.java new file mode 100644 index 000000000000..3c5459998c87 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/NetworkRuleSetPropertiesTests.java @@ -0,0 +1,54 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.DefaultAction; +import com.azure.resourcemanager.iothub.models.NetworkRuleIpAction; +import com.azure.resourcemanager.iothub.models.NetworkRuleSetIpRule; +import com.azure.resourcemanager.iothub.models.NetworkRuleSetProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class NetworkRuleSetPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkRuleSetProperties model = + BinaryData + .fromString( + "{\"defaultAction\":\"Allow\",\"applyToBuiltInEventHubEndpoint\":true,\"ipRules\":[{\"filterName\":\"pqxu\",\"action\":\"Allow\",\"ipMask\":\"y\"},{\"filterName\":\"n\",\"action\":\"Allow\",\"ipMask\":\"ybrk\"}]}") + .toObject(NetworkRuleSetProperties.class); + Assertions.assertEquals(DefaultAction.ALLOW, model.defaultAction()); + Assertions.assertEquals(true, model.applyToBuiltInEventHubEndpoint()); + Assertions.assertEquals("pqxu", model.ipRules().get(0).filterName()); + Assertions.assertEquals(NetworkRuleIpAction.ALLOW, model.ipRules().get(0).action()); + Assertions.assertEquals("y", model.ipRules().get(0).ipMask()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkRuleSetProperties model = + new NetworkRuleSetProperties() + .withDefaultAction(DefaultAction.ALLOW) + .withApplyToBuiltInEventHubEndpoint(true) + .withIpRules( + Arrays + .asList( + new NetworkRuleSetIpRule() + .withFilterName("pqxu") + .withAction(NetworkRuleIpAction.ALLOW) + .withIpMask("y"), + new NetworkRuleSetIpRule() + .withFilterName("n") + .withAction(NetworkRuleIpAction.ALLOW) + .withIpMask("ybrk"))); + model = BinaryData.fromObject(model).toObject(NetworkRuleSetProperties.class); + Assertions.assertEquals(DefaultAction.ALLOW, model.defaultAction()); + Assertions.assertEquals(true, model.applyToBuiltInEventHubEndpoint()); + Assertions.assertEquals("pqxu", model.ipRules().get(0).filterName()); + Assertions.assertEquals(NetworkRuleIpAction.ALLOW, model.ipRules().get(0).action()); + Assertions.assertEquals("y", model.ipRules().get(0).ipMask()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationDisplayTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..15226929d47c --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationDisplayTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = + BinaryData + .fromString( + "{\"provider\":\"lx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"}") + .toObject(OperationDisplay.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationDisplay model = new OperationDisplay(); + model = BinaryData.fromObject(model).toObject(OperationDisplay.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationInnerTests.java new file mode 100644 index 000000000000..7760dba4fce2 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationInnerTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.OperationInner; +import com.azure.resourcemanager.iothub.models.OperationDisplay; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = + BinaryData + .fromString( + "{\"name\":\"nygj\",\"display\":{\"provider\":\"ddeqsrdeupewnwre\",\"resource\":\"jzyflu\",\"operation\":\"rh\",\"description\":\"fcqhsmyurkd\"}}") + .toObject(OperationInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); + model = BinaryData.fromObject(model).toObject(OperationInner.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationInputsTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationInputsTests.java new file mode 100644 index 000000000000..6ef78cd8ea4e --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationInputsTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.OperationInputs; +import org.junit.jupiter.api.Assertions; + +public final class OperationInputsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInputs model = BinaryData.fromString("{\"name\":\"touwaboekqv\"}").toObject(OperationInputs.class); + Assertions.assertEquals("touwaboekqv", model.name()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationInputs model = new OperationInputs().withName("touwaboekqv"); + model = BinaryData.fromObject(model).toObject(OperationInputs.class); + Assertions.assertEquals("touwaboekqv", model.name()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationListResultTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationListResultTests.java new file mode 100644 index 000000000000..df2d04c5f9a7 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.OperationListResult; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = + BinaryData + .fromString( + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"}},{\"name\":\"ownoizhw\",\"display\":{\"provider\":\"ybqsoqijg\",\"resource\":\"mbpazlobcufpdzn\",\"operation\":\"t\",\"description\":\"qjnqglhqgnufoooj\"}},{\"name\":\"ifsqesaagdfmg\",\"display\":{\"provider\":\"hjxri\",\"resource\":\"wmrvktsizntocipa\",\"operation\":\"ajpsquc\",\"description\":\"o\"}}],\"nextLink\":\"dkfo\"}") + .toObject(OperationListResult.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationListResult model = new OperationListResult(); + model = BinaryData.fromObject(model).toObject(OperationListResult.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationsListMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..4bbe3a9cb3fc --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/OperationsListMockTests.java @@ -0,0 +1,64 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.Operation; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"name\":\"xdy\",\"display\":{\"provider\":\"y\",\"resource\":\"ogjltdtbnnhad\",\"operation\":\"crkvcikhnv\",\"description\":\"mqg\"}}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionInnerTests.java new file mode 100644 index 000000000000..21ad1c1963ff --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionInnerTests.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.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.iothub.models.PrivateEndpoint; +import com.azure.resourcemanager.iothub.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionInner model = + BinaryData + .fromString( + "{\"properties\":{\"privateEndpoint\":{\"id\":\"audccsnhs\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"nyejhkryhtnap\",\"actionsRequired\":\"wlokjyem\"}},\"id\":\"kvnipjoxz\",\"name\":\"nchgej\",\"type\":\"podmailzydehojwy\"}") + .toObject(PrivateEndpointConnectionInner.class); + Assertions + .assertEquals( + PrivateLinkServiceConnectionStatus.DISCONNECTED, + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("nyejhkryhtnap", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("wlokjyem", model.properties().privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionInner model = + new PrivateEndpointConnectionInner() + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.DISCONNECTED) + .withDescription("nyejhkryhtnap") + .withActionsRequired("wlokjyem"))); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); + Assertions + .assertEquals( + PrivateLinkServiceConnectionStatus.DISCONNECTED, + model.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("nyejhkryhtnap", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("wlokjyem", model.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionPropertiesTests.java new file mode 100644 index 000000000000..b895a676db3d --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionPropertiesTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.PrivateEndpoint; +import com.azure.resourcemanager.iothub.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionProperties model = + BinaryData + .fromString( + "{\"privateEndpoint\":{\"id\":\"xinpmqnjaq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"xj\",\"actionsRequired\":\"r\"}}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions + .assertEquals( + PrivateLinkServiceConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xj", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("r", model.privateLinkServiceConnectionState().actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionProperties model = + new PrivateEndpointConnectionProperties() + .withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.DISCONNECTED) + .withDescription("xj") + .withActionsRequired("r")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); + Assertions + .assertEquals( + PrivateLinkServiceConnectionStatus.DISCONNECTED, model.privateLinkServiceConnectionState().status()); + Assertions.assertEquals("xj", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("r", model.privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteMockTests.java new file mode 100644 index 000000000000..5bdc17b521b9 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteMockTests.java @@ -0,0 +1,76 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.PrivateEndpointConnection; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionStatus; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsDeleteMockTests { + @Test + public void testDelete() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"privateEndpoint\":{\"id\":\"ubkwdle\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"d\",\"actionsRequired\":\"tujbazpju\"}},\"id\":\"hminyflnorwmduv\",\"name\":\"pklvxw\",\"type\":\"ygdxpgpqchis\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateEndpointConnection response = + manager + .privateEndpointConnections() + .delete("kahzo", "ajjziuxxpshne", "kulfg", com.azure.core.util.Context.NONE); + + Assertions + .assertEquals( + PrivateLinkServiceConnectionStatus.PENDING, + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("d", response.properties().privateLinkServiceConnectionState().description()); + Assertions + .assertEquals("tujbazpju", response.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..850119b6c093 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java @@ -0,0 +1,78 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.PrivateEndpointConnection; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionStatus; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"privateEndpoint\":{\"id\":\"tbaxk\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ywrckp\",\"actionsRequired\":\"lyhpluodpvruud\"}},\"id\":\"gzibthostgktstv\",\"name\":\"xeclzedqbcvhzlhp\",\"type\":\"odqkdlwwqfb\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateEndpointConnection response = + manager + .privateEndpointConnections() + .getWithResponse("sdshmkxmaehvb", "xu", "iplt", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions + .assertEquals( + PrivateLinkServiceConnectionStatus.PENDING, + response.properties().privateLinkServiceConnectionState().status()); + Assertions.assertEquals("ywrckp", response.properties().privateLinkServiceConnectionState().description()); + Assertions + .assertEquals( + "lyhpluodpvruud", response.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListWithResponseMockTests.java new file mode 100644 index 000000000000..750eac435338 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListWithResponseMockTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.PrivateEndpointConnection; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "[{\"properties\":{},\"id\":\"qgaifmviklbydv\",\"name\":\"hbejdznxcvdsrhnj\",\"type\":\"volvtn\"},{\"properties\":{},\"id\":\"qfzgemjdftul\",\"name\":\"ltducea\",\"type\":\"tmczuomejwcwwqi\"},{\"properties\":{},\"id\":\"nssxmojmsvpk\",\"name\":\"prvkwcfzqljyxgtc\",\"type\":\"heyd\"}]"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + List response = + manager + .privateEndpointConnections() + .listWithResponse("fmznba", "qphchqnrnrpxehuw", com.azure.core.util.Context.NONE) + .getValue(); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateMockTests.java new file mode 100644 index 000000000000..883a23e14bb3 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateMockTests.java @@ -0,0 +1,93 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.iothub.models.PrivateEndpoint; +import com.azure.resourcemanager.iothub.models.PrivateEndpointConnection; +import com.azure.resourcemanager.iothub.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionStatus; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsUpdateMockTests { + @Test + public void testUpdate() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"properties\":{\"privateEndpoint\":{\"id\":\"quwrbehwag\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"buffkmrqemvvhm\",\"actionsRequired\":\"drjf\"}},\"id\":\"tac\",\"name\":\"ebjvewzcjzn\",\"type\":\"wcpmguaadraufac\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateEndpointConnection response = + manager + .privateEndpointConnections() + .update( + "mlkxtrqjfs", + "lmbtxhwgfwsrt", + "wcoezbrhub", + new PrivateEndpointConnectionInner() + .withProperties( + new PrivateEndpointConnectionProperties() + .withPrivateEndpoint(new PrivateEndpoint()) + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.APPROVED) + .withDescription("qfqjbvleorfm") + .withActionsRequired("iqtqzfavyvnq"))), + com.azure.core.util.Context.NONE); + + Assertions + .assertEquals( + PrivateLinkServiceConnectionStatus.REJECTED, + response.properties().privateLinkServiceConnectionState().status()); + Assertions + .assertEquals("buffkmrqemvvhm", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("drjf", response.properties().privateLinkServiceConnectionState().actionsRequired()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointTests.java new file mode 100644 index 000000000000..13b1418d88a8 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointTests.java @@ -0,0 +1,21 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.PrivateEndpoint; + +public final class PrivateEndpointTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"vcputegj\"}").toObject(PrivateEndpoint.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpoint model = new PrivateEndpoint(); + model = BinaryData.fromObject(model).toObject(PrivateEndpoint.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesInnerTests.java new file mode 100644 index 000000000000..4a8acf0aec6a --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesInnerTests.java @@ -0,0 +1,47 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; +import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner; +import com.azure.resourcemanager.iothub.models.GroupIdInformationProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourcesInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourcesInner model = + BinaryData + .fromString( + "{\"value\":[{\"id\":\"kuwhh\",\"name\":\"ykojoxafnndlpic\",\"type\":\"o\",\"properties\":{\"groupId\":\"kcdyhbpk\",\"requiredMembers\":[],\"requiredZoneNames\":[]}},{\"id\":\"reqnovvqfov\",\"name\":\"xywsuws\",\"type\":\"s\",\"properties\":{\"groupId\":\"sytgadgvraea\",\"requiredMembers\":[],\"requiredZoneNames\":[]}}]}") + .toObject(PrivateLinkResourcesInner.class); + Assertions.assertEquals("kcdyhbpk", model.value().get(0).properties().groupId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkResourcesInner model = + new PrivateLinkResourcesInner() + .withValue( + Arrays + .asList( + new GroupIdInformationInner() + .withProperties( + new GroupIdInformationProperties() + .withGroupId("kcdyhbpk") + .withRequiredMembers(Arrays.asList()) + .withRequiredZoneNames(Arrays.asList())), + new GroupIdInformationInner() + .withProperties( + new GroupIdInformationProperties() + .withGroupId("sytgadgvraea") + .withRequiredMembers(Arrays.asList()) + .withRequiredZoneNames(Arrays.asList())))); + model = BinaryData.fromObject(model).toObject(PrivateLinkResourcesInner.class); + Assertions.assertEquals("kcdyhbpk", model.value().get(0).properties().groupId()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationsGetWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..92f619ee0810 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationsGetWithResponseMockTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.GroupIdInformation; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateLinkResourcesOperationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"id\":\"sutrgjup\",\"name\":\"utpwoqhihejqgw\",\"type\":\"nfqn\",\"properties\":{\"groupId\":\"ypsxjvfoim\",\"requiredMembers\":[\"lirc\",\"zjxvydfcea\"],\"requiredZoneNames\":[\"hvygdyftumr\",\"wnawjslbiw\",\"ojgcyzt\"]}}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + GroupIdInformation response = + manager + .privateLinkResourcesOperations() + .getWithResponse("amrsreuzv", "urisjnhnytxifqj", "gxmrhublwp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("ypsxjvfoim", response.properties().groupId()); + Assertions.assertEquals("lirc", response.properties().requiredMembers().get(0)); + Assertions.assertEquals("hvygdyftumr", response.properties().requiredZoneNames().get(0)); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationsListWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationsListWithResponseMockTests.java new file mode 100644 index 000000000000..15f380902b0b --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationsListWithResponseMockTests.java @@ -0,0 +1,67 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.PrivateLinkResources; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class PrivateLinkResourcesOperationsListWithResponseMockTests { + @Test + public void testListWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"id\":\"bkfezzxscyhwzdgi\",\"name\":\"jbzbomvzzbtdcq\",\"type\":\"niyujv\"},{\"id\":\"l\",\"name\":\"shfssnrbgyef\",\"type\":\"msgaoj\"},{\"id\":\"wncot\",\"name\":\"fhir\",\"type\":\"ymoxoftpipiwyczu\"},{\"id\":\"a\",\"name\":\"qjlihhyuspska\",\"type\":\"vlmfwdgzxulucv\"}]}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PrivateLinkResources response = + manager + .privateLinkResourcesOperations() + .listWithResponse("gjmfxumvfcl", "yo", com.azure.core.util.Context.NONE) + .getValue(); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkServiceConnectionStateTests.java new file mode 100644 index 000000000000..25c00e1d0d7b --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/PrivateLinkServiceConnectionStateTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.iothub.models.PrivateLinkServiceConnectionStatus; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkServiceConnectionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkServiceConnectionState model = + BinaryData + .fromString( + "{\"status\":\"Disconnected\",\"description\":\"mfdatscmdvpj\",\"actionsRequired\":\"lsuuvmkjozkrwfnd\"}") + .toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, model.status()); + Assertions.assertEquals("mfdatscmdvpj", model.description()); + Assertions.assertEquals("lsuuvmkjozkrwfnd", model.actionsRequired()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateLinkServiceConnectionState model = + new PrivateLinkServiceConnectionState() + .withStatus(PrivateLinkServiceConnectionStatus.DISCONNECTED) + .withDescription("mfdatscmdvpj") + .withActionsRequired("lsuuvmkjozkrwfnd"); + model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, model.status()); + Assertions.assertEquals("mfdatscmdvpj", model.description()); + Assertions.assertEquals("lsuuvmkjozkrwfnd", model.actionsRequired()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RegistryStatisticsInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RegistryStatisticsInnerTests.java new file mode 100644 index 000000000000..4c50c3f4fe7a --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RegistryStatisticsInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.RegistryStatisticsInner; + +public final class RegistryStatisticsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RegistryStatisticsInner model = + BinaryData + .fromString( + "{\"totalDeviceCount\":8751195016646991326,\"enabledDeviceCount\":1457030135916183053,\"disabledDeviceCount\":6300383751543557162}") + .toObject(RegistryStatisticsInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RegistryStatisticsInner model = new RegistryStatisticsInner(); + model = BinaryData.fromObject(model).toObject(RegistryStatisticsInner.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonsGetSubscriptionQuotaWithResponseMockTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonsGetSubscriptionQuotaWithResponseMockTests.java new file mode 100644 index 000000000000..72d210e21ceb --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonsGetSubscriptionQuotaWithResponseMockTests.java @@ -0,0 +1,74 @@ +// 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.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.profile.AzureProfile; +import com.azure.resourcemanager.iothub.IotHubManager; +import com.azure.resourcemanager.iothub.models.UserSubscriptionQuotaListResult; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public final class ResourceProviderCommonsGetSubscriptionQuotaWithResponseMockTests { + @Test + public void testGetSubscriptionQuotaWithResponse() throws Exception { + HttpClient httpClient = Mockito.mock(HttpClient.class); + HttpResponse httpResponse = Mockito.mock(HttpResponse.class); + ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + + String responseStr = + "{\"value\":[{\"id\":\"lvrwxkvtkk\",\"type\":\"lqwjygvjayvblm\",\"unit\":\"k\",\"currentValue\":2100624724,\"limit\":919724990}],\"nextLink\":\"yhgsopbyrqufe\"}"; + + Mockito.when(httpResponse.getStatusCode()).thenReturn(200); + Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); + Mockito + .when(httpResponse.getBody()) + .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); + Mockito + .when(httpResponse.getBodyAsByteArray()) + .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); + Mockito + .when(httpClient.send(httpRequest.capture(), Mockito.any())) + .thenReturn( + Mono + .defer( + () -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + IotHubManager manager = + IotHubManager + .configure() + .withHttpClient(httpClient) + .authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + UserSubscriptionQuotaListResult response = + manager + .resourceProviderCommons() + .getSubscriptionQuotaWithResponse(com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("lvrwxkvtkk", response.value().get(0).id()); + Assertions.assertEquals("lqwjygvjayvblm", response.value().get(0).type()); + Assertions.assertEquals("k", response.value().get(0).unit()); + Assertions.assertEquals(2100624724, response.value().get(0).currentValue()); + Assertions.assertEquals(919724990, response.value().get(0).limit()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RootCertificatePropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RootCertificatePropertiesTests.java new file mode 100644 index 000000000000..f448465f5771 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RootCertificatePropertiesTests.java @@ -0,0 +1,27 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.RootCertificateProperties; +import org.junit.jupiter.api.Assertions; + +public final class RootCertificatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RootCertificateProperties model = + BinaryData + .fromString("{\"enableRootCertificateV2\":false,\"lastUpdatedTimeUtc\":\"2021-01-10T16:47:02Z\"}") + .toObject(RootCertificateProperties.class); + Assertions.assertEquals(false, model.enableRootCertificateV2()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RootCertificateProperties model = new RootCertificateProperties().withEnableRootCertificateV2(false); + model = BinaryData.fromObject(model).toObject(RootCertificateProperties.class); + Assertions.assertEquals(false, model.enableRootCertificateV2()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteCompilationErrorTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteCompilationErrorTests.java new file mode 100644 index 000000000000..b46be8b5e637 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteCompilationErrorTests.java @@ -0,0 +1,48 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.RouteCompilationError; +import com.azure.resourcemanager.iothub.models.RouteErrorPosition; +import com.azure.resourcemanager.iothub.models.RouteErrorRange; +import com.azure.resourcemanager.iothub.models.RouteErrorSeverity; +import org.junit.jupiter.api.Assertions; + +public final class RouteCompilationErrorTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RouteCompilationError model = + BinaryData + .fromString( + "{\"message\":\"dsjnka\",\"severity\":\"warning\",\"location\":{\"start\":{\"line\":600848345,\"column\":1914741160},\"end\":{\"line\":1975902978,\"column\":2043531661}}}") + .toObject(RouteCompilationError.class); + Assertions.assertEquals("dsjnka", model.message()); + Assertions.assertEquals(RouteErrorSeverity.WARNING, model.severity()); + Assertions.assertEquals(600848345, model.location().start().line()); + Assertions.assertEquals(1914741160, model.location().start().column()); + Assertions.assertEquals(1975902978, model.location().end().line()); + Assertions.assertEquals(2043531661, model.location().end().column()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RouteCompilationError model = + new RouteCompilationError() + .withMessage("dsjnka") + .withSeverity(RouteErrorSeverity.WARNING) + .withLocation( + new RouteErrorRange() + .withStart(new RouteErrorPosition().withLine(600848345).withColumn(1914741160)) + .withEnd(new RouteErrorPosition().withLine(1975902978).withColumn(2043531661))); + model = BinaryData.fromObject(model).toObject(RouteCompilationError.class); + Assertions.assertEquals("dsjnka", model.message()); + Assertions.assertEquals(RouteErrorSeverity.WARNING, model.severity()); + Assertions.assertEquals(600848345, model.location().start().line()); + Assertions.assertEquals(1914741160, model.location().start().column()); + Assertions.assertEquals(1975902978, model.location().end().line()); + Assertions.assertEquals(2043531661, model.location().end().column()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteErrorPositionTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteErrorPositionTests.java new file mode 100644 index 000000000000..d88ccda0380d --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteErrorPositionTests.java @@ -0,0 +1,27 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.RouteErrorPosition; +import org.junit.jupiter.api.Assertions; + +public final class RouteErrorPositionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RouteErrorPosition model = + BinaryData.fromString("{\"line\":875285248,\"column\":1367629772}").toObject(RouteErrorPosition.class); + Assertions.assertEquals(875285248, model.line()); + Assertions.assertEquals(1367629772, model.column()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RouteErrorPosition model = new RouteErrorPosition().withLine(875285248).withColumn(1367629772); + model = BinaryData.fromObject(model).toObject(RouteErrorPosition.class); + Assertions.assertEquals(875285248, model.line()); + Assertions.assertEquals(1367629772, model.column()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteErrorRangeTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteErrorRangeTests.java new file mode 100644 index 000000000000..ee095b5ca31b --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RouteErrorRangeTests.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.BinaryData; +import com.azure.resourcemanager.iothub.models.RouteErrorPosition; +import com.azure.resourcemanager.iothub.models.RouteErrorRange; +import org.junit.jupiter.api.Assertions; + +public final class RouteErrorRangeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RouteErrorRange model = + BinaryData + .fromString( + "{\"start\":{\"line\":900444322,\"column\":1157139188},\"end\":{\"line\":2137392775,\"column\":1769895546}}") + .toObject(RouteErrorRange.class); + Assertions.assertEquals(900444322, model.start().line()); + Assertions.assertEquals(1157139188, model.start().column()); + Assertions.assertEquals(2137392775, model.end().line()); + Assertions.assertEquals(1769895546, model.end().column()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RouteErrorRange model = + new RouteErrorRange() + .withStart(new RouteErrorPosition().withLine(900444322).withColumn(1157139188)) + .withEnd(new RouteErrorPosition().withLine(2137392775).withColumn(1769895546)); + model = BinaryData.fromObject(model).toObject(RouteErrorRange.class); + Assertions.assertEquals(900444322, model.start().line()); + Assertions.assertEquals(1157139188, model.start().column()); + Assertions.assertEquals(2137392775, model.end().line()); + Assertions.assertEquals(1769895546, model.end().column()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutePropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutePropertiesTests.java new file mode 100644 index 000000000000..68207e7e9d52 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutePropertiesTests.java @@ -0,0 +1,44 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.RouteProperties; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RoutePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RouteProperties model = + BinaryData + .fromString( + "{\"name\":\"uzoqft\",\"source\":\"DeviceConnectionStateEvents\",\"condition\":\"zrnkcqvyxlwh\",\"endpointNames\":[\"sicohoqqnwvlry\",\"vwhheunmmqhgyx\",\"konocu\"],\"isEnabled\":true}") + .toObject(RouteProperties.class); + Assertions.assertEquals("uzoqft", model.name()); + Assertions.assertEquals(RoutingSource.DEVICE_CONNECTION_STATE_EVENTS, model.source()); + Assertions.assertEquals("zrnkcqvyxlwh", model.condition()); + Assertions.assertEquals("sicohoqqnwvlry", model.endpointNames().get(0)); + Assertions.assertEquals(true, model.isEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RouteProperties model = + new RouteProperties() + .withName("uzoqft") + .withSource(RoutingSource.DEVICE_CONNECTION_STATE_EVENTS) + .withCondition("zrnkcqvyxlwh") + .withEndpointNames(Arrays.asList("sicohoqqnwvlry", "vwhheunmmqhgyx", "konocu")) + .withIsEnabled(true); + model = BinaryData.fromObject(model).toObject(RouteProperties.class); + Assertions.assertEquals("uzoqft", model.name()); + Assertions.assertEquals(RoutingSource.DEVICE_CONNECTION_STATE_EVENTS, model.source()); + Assertions.assertEquals("zrnkcqvyxlwh", model.condition()); + Assertions.assertEquals("sicohoqqnwvlry", model.endpointNames().get(0)); + Assertions.assertEquals(true, model.isEnabled()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingEventHubPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingEventHubPropertiesTests.java new file mode 100644 index 000000000000..3fc1631b02bc --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingEventHubPropertiesTests.java @@ -0,0 +1,56 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; +import com.azure.resourcemanager.iothub.models.RoutingEventHubProperties; +import org.junit.jupiter.api.Assertions; + +public final class RoutingEventHubPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoutingEventHubProperties model = + BinaryData + .fromString( + "{\"id\":\"mjmvxieduugidyjr\",\"connectionString\":\"byao\",\"endpointUri\":\"e\",\"entityPath\":\"sonpclhocohs\",\"authenticationType\":\"keyBased\",\"identity\":{\"userAssignedIdentity\":\"eggzfb\"},\"name\":\"hfmvfaxkffe\",\"subscriptionId\":\"th\",\"resourceGroup\":\"m\"}") + .toObject(RoutingEventHubProperties.class); + Assertions.assertEquals("mjmvxieduugidyjr", model.id()); + Assertions.assertEquals("byao", model.connectionString()); + Assertions.assertEquals("e", model.endpointUri()); + Assertions.assertEquals("sonpclhocohs", model.entityPath()); + Assertions.assertEquals(AuthenticationType.KEY_BASED, model.authenticationType()); + Assertions.assertEquals("eggzfb", model.identity().userAssignedIdentity()); + Assertions.assertEquals("hfmvfaxkffe", model.name()); + Assertions.assertEquals("th", model.subscriptionId()); + Assertions.assertEquals("m", model.resourceGroup()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoutingEventHubProperties model = + new RoutingEventHubProperties() + .withId("mjmvxieduugidyjr") + .withConnectionString("byao") + .withEndpointUri("e") + .withEntityPath("sonpclhocohs") + .withAuthenticationType(AuthenticationType.KEY_BASED) + .withIdentity(new ManagedIdentity().withUserAssignedIdentity("eggzfb")) + .withName("hfmvfaxkffe") + .withSubscriptionId("th") + .withResourceGroup("m"); + model = BinaryData.fromObject(model).toObject(RoutingEventHubProperties.class); + Assertions.assertEquals("mjmvxieduugidyjr", model.id()); + Assertions.assertEquals("byao", model.connectionString()); + Assertions.assertEquals("e", model.endpointUri()); + Assertions.assertEquals("sonpclhocohs", model.entityPath()); + Assertions.assertEquals(AuthenticationType.KEY_BASED, model.authenticationType()); + Assertions.assertEquals("eggzfb", model.identity().userAssignedIdentity()); + Assertions.assertEquals("hfmvfaxkffe", model.name()); + Assertions.assertEquals("th", model.subscriptionId()); + Assertions.assertEquals("m", model.resourceGroup()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingMessageTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingMessageTests.java new file mode 100644 index 000000000000..ab3f5e9b4ecc --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingMessageTests.java @@ -0,0 +1,50 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.RoutingMessage; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RoutingMessageTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoutingMessage model = + BinaryData + .fromString( + "{\"body\":\"xoblytkbl\",\"appProperties\":{\"rn\":\"wwwfbkr\",\"bfovasrruvwbhsq\":\"vshqjohxcr\",\"gjb\":\"sub\",\"rfbjf\":\"rxbpyb\"},\"systemProperties\":{\"zbexilzznfqqnvw\":\"ssotftpv\"}}") + .toObject(RoutingMessage.class); + Assertions.assertEquals("xoblytkbl", model.body()); + Assertions.assertEquals("wwwfbkr", model.appProperties().get("rn")); + Assertions.assertEquals("ssotftpv", model.systemProperties().get("zbexilzznfqqnvw")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoutingMessage model = + new RoutingMessage() + .withBody("xoblytkbl") + .withAppProperties( + mapOf("rn", "wwwfbkr", "bfovasrruvwbhsq", "vshqjohxcr", "gjb", "sub", "rfbjf", "rxbpyb")) + .withSystemProperties(mapOf("zbexilzznfqqnvw", "ssotftpv")); + model = BinaryData.fromObject(model).toObject(RoutingMessage.class); + Assertions.assertEquals("xoblytkbl", model.body()); + Assertions.assertEquals("wwwfbkr", model.appProperties().get("rn")); + Assertions.assertEquals("ssotftpv", model.systemProperties().get("zbexilzznfqqnvw")); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingServiceBusQueueEndpointPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingServiceBusQueueEndpointPropertiesTests.java new file mode 100644 index 000000000000..c992353afbc0 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingServiceBusQueueEndpointPropertiesTests.java @@ -0,0 +1,56 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; +import com.azure.resourcemanager.iothub.models.RoutingServiceBusQueueEndpointProperties; +import org.junit.jupiter.api.Assertions; + +public final class RoutingServiceBusQueueEndpointPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoutingServiceBusQueueEndpointProperties model = + BinaryData + .fromString( + "{\"id\":\"aodsfcpkv\",\"connectionString\":\"dpuozmyz\",\"endpointUri\":\"agfuaxbezyiu\",\"entityPath\":\"ktwh\",\"authenticationType\":\"keyBased\",\"identity\":{\"userAssignedIdentity\":\"ywqsmbsurexim\"},\"name\":\"ryocfsfksymdd\",\"subscriptionId\":\"tki\",\"resourceGroup\":\"xhqyudxorrqnb\"}") + .toObject(RoutingServiceBusQueueEndpointProperties.class); + Assertions.assertEquals("aodsfcpkv", model.id()); + Assertions.assertEquals("dpuozmyz", model.connectionString()); + Assertions.assertEquals("agfuaxbezyiu", model.endpointUri()); + Assertions.assertEquals("ktwh", model.entityPath()); + Assertions.assertEquals(AuthenticationType.KEY_BASED, model.authenticationType()); + Assertions.assertEquals("ywqsmbsurexim", model.identity().userAssignedIdentity()); + Assertions.assertEquals("ryocfsfksymdd", model.name()); + Assertions.assertEquals("tki", model.subscriptionId()); + Assertions.assertEquals("xhqyudxorrqnb", model.resourceGroup()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoutingServiceBusQueueEndpointProperties model = + new RoutingServiceBusQueueEndpointProperties() + .withId("aodsfcpkv") + .withConnectionString("dpuozmyz") + .withEndpointUri("agfuaxbezyiu") + .withEntityPath("ktwh") + .withAuthenticationType(AuthenticationType.KEY_BASED) + .withIdentity(new ManagedIdentity().withUserAssignedIdentity("ywqsmbsurexim")) + .withName("ryocfsfksymdd") + .withSubscriptionId("tki") + .withResourceGroup("xhqyudxorrqnb"); + model = BinaryData.fromObject(model).toObject(RoutingServiceBusQueueEndpointProperties.class); + Assertions.assertEquals("aodsfcpkv", model.id()); + Assertions.assertEquals("dpuozmyz", model.connectionString()); + Assertions.assertEquals("agfuaxbezyiu", model.endpointUri()); + Assertions.assertEquals("ktwh", model.entityPath()); + Assertions.assertEquals(AuthenticationType.KEY_BASED, model.authenticationType()); + Assertions.assertEquals("ywqsmbsurexim", model.identity().userAssignedIdentity()); + Assertions.assertEquals("ryocfsfksymdd", model.name()); + Assertions.assertEquals("tki", model.subscriptionId()); + Assertions.assertEquals("xhqyudxorrqnb", model.resourceGroup()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingServiceBusTopicEndpointPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingServiceBusTopicEndpointPropertiesTests.java new file mode 100644 index 000000000000..bc7d4bd4a8e9 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingServiceBusTopicEndpointPropertiesTests.java @@ -0,0 +1,56 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; +import com.azure.resourcemanager.iothub.models.RoutingServiceBusTopicEndpointProperties; +import org.junit.jupiter.api.Assertions; + +public final class RoutingServiceBusTopicEndpointPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoutingServiceBusTopicEndpointProperties model = + BinaryData + .fromString( + "{\"id\":\"kdvjsll\",\"connectionString\":\"vvdfwatkpnpul\",\"endpointUri\":\"xbczwtruwiqz\",\"entityPath\":\"j\",\"authenticationType\":\"keyBased\",\"identity\":{\"userAssignedIdentity\":\"yokacspkw\"},\"name\":\"hzdobpxjmflbvvnc\",\"subscriptionId\":\"kcciwwzjuqkhr\",\"resourceGroup\":\"jiwkuofoskghsau\"}") + .toObject(RoutingServiceBusTopicEndpointProperties.class); + Assertions.assertEquals("kdvjsll", model.id()); + Assertions.assertEquals("vvdfwatkpnpul", model.connectionString()); + Assertions.assertEquals("xbczwtruwiqz", model.endpointUri()); + Assertions.assertEquals("j", model.entityPath()); + Assertions.assertEquals(AuthenticationType.KEY_BASED, model.authenticationType()); + Assertions.assertEquals("yokacspkw", model.identity().userAssignedIdentity()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.name()); + Assertions.assertEquals("kcciwwzjuqkhr", model.subscriptionId()); + Assertions.assertEquals("jiwkuofoskghsau", model.resourceGroup()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoutingServiceBusTopicEndpointProperties model = + new RoutingServiceBusTopicEndpointProperties() + .withId("kdvjsll") + .withConnectionString("vvdfwatkpnpul") + .withEndpointUri("xbczwtruwiqz") + .withEntityPath("j") + .withAuthenticationType(AuthenticationType.KEY_BASED) + .withIdentity(new ManagedIdentity().withUserAssignedIdentity("yokacspkw")) + .withName("hzdobpxjmflbvvnc") + .withSubscriptionId("kcciwwzjuqkhr") + .withResourceGroup("jiwkuofoskghsau"); + model = BinaryData.fromObject(model).toObject(RoutingServiceBusTopicEndpointProperties.class); + Assertions.assertEquals("kdvjsll", model.id()); + Assertions.assertEquals("vvdfwatkpnpul", model.connectionString()); + Assertions.assertEquals("xbczwtruwiqz", model.endpointUri()); + Assertions.assertEquals("j", model.entityPath()); + Assertions.assertEquals(AuthenticationType.KEY_BASED, model.authenticationType()); + Assertions.assertEquals("yokacspkw", model.identity().userAssignedIdentity()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.name()); + Assertions.assertEquals("kcciwwzjuqkhr", model.subscriptionId()); + Assertions.assertEquals("jiwkuofoskghsau", model.resourceGroup()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingStorageContainerPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingStorageContainerPropertiesTests.java new file mode 100644 index 000000000000..683a2d945386 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingStorageContainerPropertiesTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; +import com.azure.resourcemanager.iothub.models.RoutingStorageContainerProperties; +import com.azure.resourcemanager.iothub.models.RoutingStorageContainerPropertiesEncoding; +import org.junit.jupiter.api.Assertions; + +public final class RoutingStorageContainerPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoutingStorageContainerProperties model = + BinaryData + .fromString( + "{\"id\":\"yvshxmz\",\"connectionString\":\"bzoggigrx\",\"endpointUri\":\"ur\",\"authenticationType\":\"identityBased\",\"identity\":{\"userAssignedIdentity\":\"nspydptkoenkoukn\"},\"name\":\"udwtiukbl\",\"subscriptionId\":\"gkpocipazyxoe\",\"resourceGroup\":\"kgjn\",\"containerName\":\"iucgygevqzn\",\"fileNameFormat\":\"pmr\",\"batchFrequencyInSeconds\":129742346,\"maxChunkSizeInBytes\":173387394,\"encoding\":\"Avro\"}") + .toObject(RoutingStorageContainerProperties.class); + Assertions.assertEquals("yvshxmz", model.id()); + Assertions.assertEquals("bzoggigrx", model.connectionString()); + Assertions.assertEquals("ur", model.endpointUri()); + Assertions.assertEquals(AuthenticationType.IDENTITY_BASED, model.authenticationType()); + Assertions.assertEquals("nspydptkoenkoukn", model.identity().userAssignedIdentity()); + Assertions.assertEquals("udwtiukbl", model.name()); + Assertions.assertEquals("gkpocipazyxoe", model.subscriptionId()); + Assertions.assertEquals("kgjn", model.resourceGroup()); + Assertions.assertEquals("iucgygevqzn", model.containerName()); + Assertions.assertEquals("pmr", model.fileNameFormat()); + Assertions.assertEquals(129742346, model.batchFrequencyInSeconds()); + Assertions.assertEquals(173387394, model.maxChunkSizeInBytes()); + Assertions.assertEquals(RoutingStorageContainerPropertiesEncoding.AVRO, model.encoding()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoutingStorageContainerProperties model = + new RoutingStorageContainerProperties() + .withId("yvshxmz") + .withConnectionString("bzoggigrx") + .withEndpointUri("ur") + .withAuthenticationType(AuthenticationType.IDENTITY_BASED) + .withIdentity(new ManagedIdentity().withUserAssignedIdentity("nspydptkoenkoukn")) + .withName("udwtiukbl") + .withSubscriptionId("gkpocipazyxoe") + .withResourceGroup("kgjn") + .withContainerName("iucgygevqzn") + .withFileNameFormat("pmr") + .withBatchFrequencyInSeconds(129742346) + .withMaxChunkSizeInBytes(173387394) + .withEncoding(RoutingStorageContainerPropertiesEncoding.AVRO); + model = BinaryData.fromObject(model).toObject(RoutingStorageContainerProperties.class); + Assertions.assertEquals("yvshxmz", model.id()); + Assertions.assertEquals("bzoggigrx", model.connectionString()); + Assertions.assertEquals("ur", model.endpointUri()); + Assertions.assertEquals(AuthenticationType.IDENTITY_BASED, model.authenticationType()); + Assertions.assertEquals("nspydptkoenkoukn", model.identity().userAssignedIdentity()); + Assertions.assertEquals("udwtiukbl", model.name()); + Assertions.assertEquals("gkpocipazyxoe", model.subscriptionId()); + Assertions.assertEquals("kgjn", model.resourceGroup()); + Assertions.assertEquals("iucgygevqzn", model.containerName()); + Assertions.assertEquals("pmr", model.fileNameFormat()); + Assertions.assertEquals(129742346, model.batchFrequencyInSeconds()); + Assertions.assertEquals(173387394, model.maxChunkSizeInBytes()); + Assertions.assertEquals(RoutingStorageContainerPropertiesEncoding.AVRO, model.encoding()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingTwinPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingTwinPropertiesTests.java new file mode 100644 index 000000000000..037ecc960f20 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingTwinPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.RoutingTwinProperties; + +public final class RoutingTwinPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoutingTwinProperties model = + BinaryData + .fromString("{\"desired\":\"dataewgdrjervn\",\"reported\":\"datanqpeh\"}") + .toObject(RoutingTwinProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoutingTwinProperties model = + new RoutingTwinProperties().withDesired("dataewgdrjervn").withReported("datanqpeh"); + model = BinaryData.fromObject(model).toObject(RoutingTwinProperties.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingTwinTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingTwinTests.java new file mode 100644 index 000000000000..2798b1fa76ce --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/RoutingTwinTests.java @@ -0,0 +1,29 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.RoutingTwin; +import com.azure.resourcemanager.iothub.models.RoutingTwinProperties; + +public final class RoutingTwinTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoutingTwin model = + BinaryData + .fromString( + "{\"tags\":\"dataqtaruoujmkcjhwq\",\"properties\":{\"desired\":\"datar\",\"reported\":\"datan\"}}") + .toObject(RoutingTwin.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoutingTwin model = + new RoutingTwin() + .withTags("dataqtaruoujmkcjhwq") + .withProperties(new RoutingTwinProperties().withDesired("datar").withReported("datan")); + model = BinaryData.fromObject(model).toObject(RoutingTwin.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/StorageEndpointPropertiesTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/StorageEndpointPropertiesTests.java new file mode 100644 index 000000000000..9d9c0339af2f --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/StorageEndpointPropertiesTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.AuthenticationType; +import com.azure.resourcemanager.iothub.models.ManagedIdentity; +import com.azure.resourcemanager.iothub.models.StorageEndpointProperties; +import java.time.Duration; +import org.junit.jupiter.api.Assertions; + +public final class StorageEndpointPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + StorageEndpointProperties model = + BinaryData + .fromString( + "{\"sasTtlAsIso8601\":\"PT227H21M53S\",\"connectionString\":\"hkaetcktvfc\",\"containerName\":\"vf\",\"authenticationType\":\"identityBased\",\"identity\":{\"userAssignedIdentity\":\"uctqhjfbe\"}}") + .toObject(StorageEndpointProperties.class); + Assertions.assertEquals(Duration.parse("PT227H21M53S"), model.sasTtlAsIso8601()); + Assertions.assertEquals("hkaetcktvfc", model.connectionString()); + Assertions.assertEquals("vf", model.containerName()); + Assertions.assertEquals(AuthenticationType.IDENTITY_BASED, model.authenticationType()); + Assertions.assertEquals("uctqhjfbe", model.identity().userAssignedIdentity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + StorageEndpointProperties model = + new StorageEndpointProperties() + .withSasTtlAsIso8601(Duration.parse("PT227H21M53S")) + .withConnectionString("hkaetcktvfc") + .withContainerName("vf") + .withAuthenticationType(AuthenticationType.IDENTITY_BASED) + .withIdentity(new ManagedIdentity().withUserAssignedIdentity("uctqhjfbe")); + model = BinaryData.fromObject(model).toObject(StorageEndpointProperties.class); + Assertions.assertEquals(Duration.parse("PT227H21M53S"), model.sasTtlAsIso8601()); + Assertions.assertEquals("hkaetcktvfc", model.connectionString()); + Assertions.assertEquals("vf", model.containerName()); + Assertions.assertEquals(AuthenticationType.IDENTITY_BASED, model.authenticationType()); + Assertions.assertEquals("uctqhjfbe", model.identity().userAssignedIdentity()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TagsResourceTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TagsResourceTests.java new file mode 100644 index 000000000000..f5b21cb02db7 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TagsResourceTests.java @@ -0,0 +1,52 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.TagsResource; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class TagsResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TagsResource model = + BinaryData + .fromString( + "{\"tags\":{\"nyyazttbtwwrqpue\":\"ucoc\",\"xibxujwbhqwalm\":\"ckzywbiexzfeyue\",\"ux\":\"zyoxaepdkzjan\",\"zt\":\"hdwbavxbniwdjs\"}}") + .toObject(TagsResource.class); + Assertions.assertEquals("ucoc", model.tags().get("nyyazttbtwwrqpue")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TagsResource model = + new TagsResource() + .withTags( + mapOf( + "nyyazttbtwwrqpue", + "ucoc", + "xibxujwbhqwalm", + "ckzywbiexzfeyue", + "ux", + "zyoxaepdkzjan", + "zt", + "hdwbavxbniwdjs")); + model = BinaryData.fromObject(model).toObject(TagsResource.class); + Assertions.assertEquals("ucoc", model.tags().get("nyyazttbtwwrqpue")); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestAllRoutesInputTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestAllRoutesInputTests.java new file mode 100644 index 000000000000..ff56c98199e0 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestAllRoutesInputTests.java @@ -0,0 +1,66 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.RoutingMessage; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import com.azure.resourcemanager.iothub.models.RoutingTwin; +import com.azure.resourcemanager.iothub.models.RoutingTwinProperties; +import com.azure.resourcemanager.iothub.models.TestAllRoutesInput; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class TestAllRoutesInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TestAllRoutesInput model = + BinaryData + .fromString( + "{\"routingSource\":\"DigitalTwinChangeEvents\",\"message\":{\"body\":\"uaceopzfqrhhu\",\"appProperties\":{\"ahzxctobgbk\":\"ppcqeqxolz\",\"mgrcfbu\":\"moizpos\",\"mjh\":\"rmfqjhhkxbpvj\"},\"systemProperties\":{\"tswb\":\"yngudivk\"}},\"twin\":{\"tags\":\"datavszjfauvjfdxxi\",\"properties\":{\"desired\":\"datavtcqaqtdo\",\"reported\":\"datacbxvwvxyslqbh\"}}}") + .toObject(TestAllRoutesInput.class); + Assertions.assertEquals(RoutingSource.DIGITAL_TWIN_CHANGE_EVENTS, model.routingSource()); + Assertions.assertEquals("uaceopzfqrhhu", model.message().body()); + Assertions.assertEquals("ppcqeqxolz", model.message().appProperties().get("ahzxctobgbk")); + Assertions.assertEquals("yngudivk", model.message().systemProperties().get("tswb")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TestAllRoutesInput model = + new TestAllRoutesInput() + .withRoutingSource(RoutingSource.DIGITAL_TWIN_CHANGE_EVENTS) + .withMessage( + new RoutingMessage() + .withBody("uaceopzfqrhhu") + .withAppProperties( + mapOf("ahzxctobgbk", "ppcqeqxolz", "mgrcfbu", "moizpos", "mjh", "rmfqjhhkxbpvj")) + .withSystemProperties(mapOf("tswb", "yngudivk"))) + .withTwin( + new RoutingTwin() + .withTags("datavszjfauvjfdxxi") + .withProperties( + new RoutingTwinProperties() + .withDesired("datavtcqaqtdo") + .withReported("datacbxvwvxyslqbh"))); + model = BinaryData.fromObject(model).toObject(TestAllRoutesInput.class); + Assertions.assertEquals(RoutingSource.DIGITAL_TWIN_CHANGE_EVENTS, model.routingSource()); + Assertions.assertEquals("uaceopzfqrhhu", model.message().body()); + Assertions.assertEquals("ppcqeqxolz", model.message().appProperties().get("ahzxctobgbk")); + Assertions.assertEquals("yngudivk", model.message().systemProperties().get("tswb")); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestAllRoutesResultInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestAllRoutesResultInnerTests.java new file mode 100644 index 000000000000..c29252e0b7d8 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestAllRoutesResultInnerTests.java @@ -0,0 +1,50 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.TestAllRoutesResultInner; +import com.azure.resourcemanager.iothub.models.MatchedRoute; +import com.azure.resourcemanager.iothub.models.RouteProperties; +import com.azure.resourcemanager.iothub.models.RoutingSource; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TestAllRoutesResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TestAllRoutesResultInner model = + BinaryData + .fromString( + "{\"routes\":[{\"properties\":{\"name\":\"ygmi\",\"source\":\"TwinChangeEvents\",\"condition\":\"nzdndslgna\",\"endpointNames\":[],\"isEnabled\":false}}]}") + .toObject(TestAllRoutesResultInner.class); + Assertions.assertEquals("ygmi", model.routes().get(0).properties().name()); + Assertions.assertEquals(RoutingSource.TWIN_CHANGE_EVENTS, model.routes().get(0).properties().source()); + Assertions.assertEquals("nzdndslgna", model.routes().get(0).properties().condition()); + Assertions.assertEquals(false, model.routes().get(0).properties().isEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TestAllRoutesResultInner model = + new TestAllRoutesResultInner() + .withRoutes( + Arrays + .asList( + new MatchedRoute() + .withProperties( + new RouteProperties() + .withName("ygmi") + .withSource(RoutingSource.TWIN_CHANGE_EVENTS) + .withCondition("nzdndslgna") + .withEndpointNames(Arrays.asList()) + .withIsEnabled(false)))); + model = BinaryData.fromObject(model).toObject(TestAllRoutesResultInner.class); + Assertions.assertEquals("ygmi", model.routes().get(0).properties().name()); + Assertions.assertEquals(RoutingSource.TWIN_CHANGE_EVENTS, model.routes().get(0).properties().source()); + Assertions.assertEquals("nzdndslgna", model.routes().get(0).properties().condition()); + Assertions.assertEquals(false, model.routes().get(0).properties().isEnabled()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteInputTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteInputTests.java new file mode 100644 index 000000000000..5703ac8c25dd --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteInputTests.java @@ -0,0 +1,99 @@ +// 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.BinaryData; +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.RoutingTwin; +import com.azure.resourcemanager.iothub.models.RoutingTwinProperties; +import com.azure.resourcemanager.iothub.models.TestRouteInput; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class TestRouteInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TestRouteInput model = + BinaryData + .fromString( + "{\"message\":{\"body\":\"swiydmcwyhzdx\",\"appProperties\":{\"vdfznudaodvxzb\":\"dbzm\",\"dzu\":\"cblylpstdbhhxsr\",\"fiwjmygtdssls\":\"erscdntne\",\"emwabnet\":\"tmweriofzpyq\"},\"systemProperties\":{\"wubmwmbesldn\":\"szhedplvw\",\"lcxog\":\"wwtppj\",\"qqkdltfzxmhhvhgu\":\"okonzmnsikvmkqz\",\"xtibqdxbxwakbog\":\"eodkwobda\"}},\"route\":{\"name\":\"xndlkzgxhu\",\"source\":\"MqttBrokerMessages\",\"condition\":\"lbpodxunk\",\"endpointNames\":[\"bxmubyynt\",\"lrb\",\"tkoievseotgq\"],\"isEnabled\":false},\"twin\":{\"tags\":\"datamuwlauwzizxbm\",\"properties\":{\"desired\":\"datajefuzmuvpbttdumo\",\"reported\":\"datapxebmnzbt\"}}}") + .toObject(TestRouteInput.class); + Assertions.assertEquals("swiydmcwyhzdx", model.message().body()); + Assertions.assertEquals("dbzm", model.message().appProperties().get("vdfznudaodvxzb")); + Assertions.assertEquals("szhedplvw", model.message().systemProperties().get("wubmwmbesldn")); + Assertions.assertEquals("xndlkzgxhu", model.route().name()); + Assertions.assertEquals(RoutingSource.MQTT_BROKER_MESSAGES, model.route().source()); + Assertions.assertEquals("lbpodxunk", model.route().condition()); + Assertions.assertEquals("bxmubyynt", model.route().endpointNames().get(0)); + Assertions.assertEquals(false, model.route().isEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TestRouteInput model = + new TestRouteInput() + .withMessage( + new RoutingMessage() + .withBody("swiydmcwyhzdx") + .withAppProperties( + mapOf( + "vdfznudaodvxzb", + "dbzm", + "dzu", + "cblylpstdbhhxsr", + "fiwjmygtdssls", + "erscdntne", + "emwabnet", + "tmweriofzpyq")) + .withSystemProperties( + mapOf( + "wubmwmbesldn", + "szhedplvw", + "lcxog", + "wwtppj", + "qqkdltfzxmhhvhgu", + "okonzmnsikvmkqz", + "xtibqdxbxwakbog", + "eodkwobda"))) + .withRoute( + new RouteProperties() + .withName("xndlkzgxhu") + .withSource(RoutingSource.MQTT_BROKER_MESSAGES) + .withCondition("lbpodxunk") + .withEndpointNames(Arrays.asList("bxmubyynt", "lrb", "tkoievseotgq")) + .withIsEnabled(false)) + .withTwin( + new RoutingTwin() + .withTags("datamuwlauwzizxbm") + .withProperties( + new RoutingTwinProperties() + .withDesired("datajefuzmuvpbttdumo") + .withReported("datapxebmnzbt"))); + model = BinaryData.fromObject(model).toObject(TestRouteInput.class); + Assertions.assertEquals("swiydmcwyhzdx", model.message().body()); + Assertions.assertEquals("dbzm", model.message().appProperties().get("vdfznudaodvxzb")); + Assertions.assertEquals("szhedplvw", model.message().systemProperties().get("wubmwmbesldn")); + Assertions.assertEquals("xndlkzgxhu", model.route().name()); + Assertions.assertEquals(RoutingSource.MQTT_BROKER_MESSAGES, model.route().source()); + Assertions.assertEquals("lbpodxunk", model.route().condition()); + Assertions.assertEquals("bxmubyynt", model.route().endpointNames().get(0)); + Assertions.assertEquals(false, model.route().isEnabled()); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteResultDetailsTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteResultDetailsTests.java new file mode 100644 index 000000000000..5998c1664a5d --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteResultDetailsTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.RouteCompilationError; +import com.azure.resourcemanager.iothub.models.RouteErrorRange; +import com.azure.resourcemanager.iothub.models.RouteErrorSeverity; +import com.azure.resourcemanager.iothub.models.TestRouteResultDetails; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TestRouteResultDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TestRouteResultDetails model = + BinaryData + .fromString( + "{\"compilationErrors\":[{\"message\":\"ikdowwquuvx\",\"severity\":\"error\",\"location\":{}},{\"message\":\"hhqzonosgg\",\"severity\":\"error\",\"location\":{}}]}") + .toObject(TestRouteResultDetails.class); + Assertions.assertEquals("ikdowwquuvx", model.compilationErrors().get(0).message()); + Assertions.assertEquals(RouteErrorSeverity.ERROR, model.compilationErrors().get(0).severity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TestRouteResultDetails model = + new TestRouteResultDetails() + .withCompilationErrors( + Arrays + .asList( + new RouteCompilationError() + .withMessage("ikdowwquuvx") + .withSeverity(RouteErrorSeverity.ERROR) + .withLocation(new RouteErrorRange()), + new RouteCompilationError() + .withMessage("hhqzonosgg") + .withSeverity(RouteErrorSeverity.ERROR) + .withLocation(new RouteErrorRange()))); + model = BinaryData.fromObject(model).toObject(TestRouteResultDetails.class); + Assertions.assertEquals("ikdowwquuvx", model.compilationErrors().get(0).message()); + Assertions.assertEquals(RouteErrorSeverity.ERROR, model.compilationErrors().get(0).severity()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteResultInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteResultInnerTests.java new file mode 100644 index 000000000000..cadef67fcf41 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/TestRouteResultInnerTests.java @@ -0,0 +1,47 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.TestRouteResultInner; +import com.azure.resourcemanager.iothub.models.RouteCompilationError; +import com.azure.resourcemanager.iothub.models.RouteErrorSeverity; +import com.azure.resourcemanager.iothub.models.TestResultStatus; +import com.azure.resourcemanager.iothub.models.TestRouteResultDetails; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class TestRouteResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TestRouteResultInner model = + BinaryData + .fromString( + "{\"result\":\"true\",\"details\":{\"compilationErrors\":[{\"message\":\"fgohdneuelfphs\",\"severity\":\"warning\"}]}}") + .toObject(TestRouteResultInner.class); + Assertions.assertEquals(TestResultStatus.TRUE, model.result()); + Assertions.assertEquals("fgohdneuelfphs", model.details().compilationErrors().get(0).message()); + Assertions.assertEquals(RouteErrorSeverity.WARNING, model.details().compilationErrors().get(0).severity()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TestRouteResultInner model = + new TestRouteResultInner() + .withResult(TestResultStatus.TRUE) + .withDetails( + new TestRouteResultDetails() + .withCompilationErrors( + Arrays + .asList( + new RouteCompilationError() + .withMessage("fgohdneuelfphs") + .withSeverity(RouteErrorSeverity.WARNING)))); + model = BinaryData.fromObject(model).toObject(TestRouteResultInner.class); + Assertions.assertEquals(TestResultStatus.TRUE, model.result()); + Assertions.assertEquals("fgohdneuelfphs", model.details().compilationErrors().get(0).message()); + Assertions.assertEquals(RouteErrorSeverity.WARNING, model.details().compilationErrors().get(0).severity()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/UserSubscriptionQuotaListResultInnerTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/UserSubscriptionQuotaListResultInnerTests.java new file mode 100644 index 000000000000..20e695035587 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/UserSubscriptionQuotaListResultInnerTests.java @@ -0,0 +1,54 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner; +import com.azure.resourcemanager.iothub.models.Name; +import com.azure.resourcemanager.iothub.models.UserSubscriptionQuota; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class UserSubscriptionQuotaListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserSubscriptionQuotaListResultInner model = + BinaryData + .fromString( + "{\"value\":[{\"id\":\"n\",\"type\":\"xisxyawjoyaqcsl\",\"unit\":\"pkii\",\"currentValue\":983085062,\"limit\":1211885049,\"name\":{\"value\":\"eli\",\"localizedValue\":\"nr\"}}],\"nextLink\":\"folhbnxknal\"}") + .toObject(UserSubscriptionQuotaListResultInner.class); + Assertions.assertEquals("n", model.value().get(0).id()); + Assertions.assertEquals("xisxyawjoyaqcsl", model.value().get(0).type()); + Assertions.assertEquals("pkii", model.value().get(0).unit()); + Assertions.assertEquals(983085062, model.value().get(0).currentValue()); + Assertions.assertEquals(1211885049, model.value().get(0).limit()); + Assertions.assertEquals("eli", model.value().get(0).name().value()); + Assertions.assertEquals("nr", model.value().get(0).name().localizedValue()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserSubscriptionQuotaListResultInner model = + new UserSubscriptionQuotaListResultInner() + .withValue( + Arrays + .asList( + new UserSubscriptionQuota() + .withId("n") + .withType("xisxyawjoyaqcsl") + .withUnit("pkii") + .withCurrentValue(983085062) + .withLimit(1211885049) + .withName(new Name().withValue("eli").withLocalizedValue("nr")))); + model = BinaryData.fromObject(model).toObject(UserSubscriptionQuotaListResultInner.class); + Assertions.assertEquals("n", model.value().get(0).id()); + Assertions.assertEquals("xisxyawjoyaqcsl", model.value().get(0).type()); + Assertions.assertEquals("pkii", model.value().get(0).unit()); + Assertions.assertEquals(983085062, model.value().get(0).currentValue()); + Assertions.assertEquals(1211885049, model.value().get(0).limit()); + Assertions.assertEquals("eli", model.value().get(0).name().value()); + Assertions.assertEquals("nr", model.value().get(0).name().localizedValue()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/UserSubscriptionQuotaTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/UserSubscriptionQuotaTests.java new file mode 100644 index 000000000000..3cdb18b12679 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/UserSubscriptionQuotaTests.java @@ -0,0 +1,48 @@ +// 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.BinaryData; +import com.azure.resourcemanager.iothub.models.Name; +import com.azure.resourcemanager.iothub.models.UserSubscriptionQuota; +import org.junit.jupiter.api.Assertions; + +public final class UserSubscriptionQuotaTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UserSubscriptionQuota model = + BinaryData + .fromString( + "{\"id\":\"lp\",\"type\":\"gdtpnapnyiro\",\"unit\":\"hpigv\",\"currentValue\":2000011197,\"limit\":1573909011,\"name\":{\"value\":\"itxmedjvcslynqww\",\"localizedValue\":\"wzz\"}}") + .toObject(UserSubscriptionQuota.class); + Assertions.assertEquals("lp", model.id()); + Assertions.assertEquals("gdtpnapnyiro", model.type()); + Assertions.assertEquals("hpigv", model.unit()); + Assertions.assertEquals(2000011197, model.currentValue()); + Assertions.assertEquals(1573909011, model.limit()); + Assertions.assertEquals("itxmedjvcslynqww", model.name().value()); + Assertions.assertEquals("wzz", model.name().localizedValue()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UserSubscriptionQuota model = + new UserSubscriptionQuota() + .withId("lp") + .withType("gdtpnapnyiro") + .withUnit("hpigv") + .withCurrentValue(2000011197) + .withLimit(1573909011) + .withName(new Name().withValue("itxmedjvcslynqww").withLocalizedValue("wzz")); + model = BinaryData.fromObject(model).toObject(UserSubscriptionQuota.class); + Assertions.assertEquals("lp", model.id()); + Assertions.assertEquals("gdtpnapnyiro", model.type()); + Assertions.assertEquals("hpigv", model.unit()); + Assertions.assertEquals(2000011197, model.currentValue()); + Assertions.assertEquals(1573909011, model.limit()); + Assertions.assertEquals("itxmedjvcslynqww", model.name().value()); + Assertions.assertEquals("wzz", model.name().localizedValue()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdk/iothub/azure-resourcemanager-iothub/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 000000000000..1f0955d450f0 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline