diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/CHANGELOG.md b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/CHANGELOG.md index 20bc22df6448..8140d50df1c4 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/CHANGELOG.md +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/CHANGELOG.md @@ -1,6 +1,12 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.3 (2025-02-07) + +- Azure Resource Manager Device Registry client library for Java. This package contains Microsoft Azure SDK for Device Registry Management SDK. Microsoft.DeviceRegistry Resource Provider management API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## 1.0.0-beta.1 (2025-02-07) + +- Azure Resource Manager Device Registry client library for Java. This package contains Microsoft Azure SDK for Device Registry Management SDK. Microsoft.DeviceRegistry Resource Provider management API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/README.md b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/README.md index de2739da6ed8..bcc821da69c0 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/README.md +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-deviceregistry - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/SAMPLE.md b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/SAMPLE.md index 79279e2d46d7..c46a84377e44 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/SAMPLE.md +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/SAMPLE.md @@ -24,24 +24,6 @@ - [Get](#billingcontainers_get) - [List](#billingcontainers_list) -## DiscoveredAssetEndpointProfiles - -- [CreateOrReplace](#discoveredassetendpointprofiles_createorreplace) -- [Delete](#discoveredassetendpointprofiles_delete) -- [GetByResourceGroup](#discoveredassetendpointprofiles_getbyresourcegroup) -- [List](#discoveredassetendpointprofiles_list) -- [ListByResourceGroup](#discoveredassetendpointprofiles_listbyresourcegroup) -- [Update](#discoveredassetendpointprofiles_update) - -## DiscoveredAssets - -- [CreateOrReplace](#discoveredassets_createorreplace) -- [Delete](#discoveredassets_delete) -- [GetByResourceGroup](#discoveredassets_getbyresourcegroup) -- [List](#discoveredassets_list) -- [ListByResourceGroup](#discoveredassets_listbyresourcegroup) -- [Update](#discoveredassets_update) - ## OperationStatus - [Get](#operationstatus_get) @@ -49,29 +31,6 @@ ## Operations - [List](#operations_list) - -## SchemaRegistries - -- [CreateOrReplace](#schemaregistries_createorreplace) -- [Delete](#schemaregistries_delete) -- [GetByResourceGroup](#schemaregistries_getbyresourcegroup) -- [List](#schemaregistries_list) -- [ListByResourceGroup](#schemaregistries_listbyresourcegroup) -- [Update](#schemaregistries_update) - -## SchemaVersions - -- [CreateOrReplace](#schemaversions_createorreplace) -- [Delete](#schemaversions_delete) -- [Get](#schemaversions_get) -- [ListBySchema](#schemaversions_listbyschema) - -## Schemas - -- [CreateOrReplace](#schemas_createorreplace) -- [Delete](#schemas_delete) -- [Get](#schemas_get) -- [ListBySchemaRegistry](#schemas_listbyschemaregistry) ### AssetEndpointProfiles_CreateOrReplace ```java @@ -87,7 +46,7 @@ import java.util.Map; */ public final class AssetEndpointProfilesCreateOrReplaceSamples { /* - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile_With_DiscoveredAepRef.json */ /** * Sample code: Create_AssetEndpointProfile_With_DiscoveredAepRef. @@ -113,7 +72,7 @@ public final class AssetEndpointProfilesCreateOrReplaceSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json */ /** * Sample code: Create_AssetEndpointProfile. @@ -159,7 +118,7 @@ public final class AssetEndpointProfilesCreateOrReplaceSamples { */ public final class AssetEndpointProfilesDeleteSamples { /* - * x-ms-original-file: 2024-09-01-preview/Delete_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json */ /** * Sample code: Delete_AssetEndpointProfile. @@ -182,7 +141,7 @@ public final class AssetEndpointProfilesDeleteSamples { */ public final class AssetEndpointProfilesGetByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile.json */ /** * Sample code: Get_AssetEndpointProfile. @@ -196,7 +155,7 @@ public final class AssetEndpointProfilesGetByResourceGroupSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json */ /** * Sample code: Get_AssetEndpointProfile_With_SyncStatus. @@ -220,7 +179,7 @@ public final class AssetEndpointProfilesGetByResourceGroupSamples { */ public final class AssetEndpointProfilesListSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_Subscription.json */ /** * Sample code: List_AssetEndpointProfiles_Subscription. @@ -242,7 +201,7 @@ public final class AssetEndpointProfilesListSamples { */ public final class AssetEndpointProfilesListByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_ResourceGroup.json */ /** * Sample code: List_AssetEndpointProfiles_ResourceGroup. @@ -267,7 +226,7 @@ import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfileUpdat */ public final class AssetEndpointProfilesUpdateSamples { /* - * x-ms-original-file: 2024-09-01-preview/Update_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json */ /** * Sample code: Update_AssetEndpointProfile. @@ -309,7 +268,7 @@ import java.util.Map; */ public final class AssetsCreateOrReplaceSamples { /* - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_DiscoveredAssetRef.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_DiscoveredAssetRef.json */ /** * Sample code: Create_Asset_With_DiscoveredAssetRefs. @@ -376,7 +335,7 @@ public final class AssetsCreateOrReplaceSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_ExternalAssetId.json */ /** * Sample code: Create_Asset_Without_ExternalAssetId. @@ -441,7 +400,7 @@ public final class AssetsCreateOrReplaceSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_ExternalAssetId.json */ /** * Sample code: Create_Asset_With_ExternalAssetId. @@ -507,7 +466,7 @@ public final class AssetsCreateOrReplaceSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_DisplayName.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_DisplayName.json */ /** * Sample code: Create_Asset_Without_DisplayName. @@ -593,7 +552,7 @@ public final class AssetsCreateOrReplaceSamples { */ public final class AssetsDeleteSamples { /* - * x-ms-original-file: 2024-09-01-preview/Delete_Asset.json + * x-ms-original-file: 2024-11-01/Delete_Asset.json */ /** * Sample code: Delete_Asset. @@ -614,7 +573,7 @@ public final class AssetsDeleteSamples { */ public final class AssetsGetByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_Asset_With_SyncStatus.json */ /** * Sample code: Get_Asset_With_SyncStatus. @@ -627,7 +586,7 @@ public final class AssetsGetByResourceGroupSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Get_Asset.json + * x-ms-original-file: 2024-11-01/Get_Asset.json */ /** * Sample code: Get_Asset. @@ -649,7 +608,7 @@ public final class AssetsGetByResourceGroupSamples { */ public final class AssetsListSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_Assets_Subscription.json + * x-ms-original-file: 2024-11-01/List_Assets_Subscription.json */ /** * Sample code: List_Assets_Subscription. @@ -670,7 +629,7 @@ public final class AssetsListSamples { */ public final class AssetsListByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_Assets_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json */ /** * Sample code: List_Assets_ResourceGroup. @@ -694,7 +653,7 @@ import com.azure.resourcemanager.deviceregistry.models.AssetUpdateProperties; */ public final class AssetsUpdateSamples { /* - * x-ms-original-file: 2024-09-01-preview/Update_Asset.json + * x-ms-original-file: 2024-11-01/Update_Asset.json */ /** * Sample code: Update_Asset. @@ -720,7 +679,7 @@ public final class AssetsUpdateSamples { */ public final class BillingContainersGetSamples { /* - * x-ms-original-file: 2024-09-01-preview/Get_BillingContainer.json + * x-ms-original-file: 2024-11-01/Get_BillingContainer.json */ /** * Sample code: Get_BillingContainer. @@ -741,7 +700,7 @@ public final class BillingContainersGetSamples { */ public final class BillingContainersListSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_BillingContainers_Subscription.json + * x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json */ /** * Sample code: List_BillingContainers_Subscription. @@ -755,436 +714,40 @@ public final class BillingContainersListSamples { } ``` -### DiscoveredAssetEndpointProfiles_CreateOrReplace - -```java -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileProperties; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for DiscoveredAssetEndpointProfiles CreateOrReplace. - */ -public final class DiscoveredAssetEndpointProfilesCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAssetEndpointProfile.json - */ - /** - * Sample code: Create_DiscoveredAssetEndpointProfile. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - createDiscoveredAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles() - .define("my-discoveredassetendpointprofile") - .withRegion("West Europe") - .withExistingResourceGroup("myResourceGroup") - .withExtendedLocation(new ExtendedLocation().withType("CustomLocation") - .withName( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) - .withTags(mapOf("site", "building-1")) - .withProperties(new DiscoveredAssetEndpointProfileProperties() - .withTargetAddress("https://www.example.com/myTargetAddress") - .withAdditionalConfiguration("{\"foo\": \"bar\"}") - .withSupportedAuthenticationMethods(Arrays.asList(AuthenticationMethod.ANONYMOUS, - AuthenticationMethod.CERTIFICATE, AuthenticationMethod.USERNAME_PASSWORD)) - .withEndpointProfileType("myEndpointProfileType") - .withDiscoveryId("11111111-1111-1111-1111-111111111111") - .withVersion(73766L)) - .create(); - } - - // Use "Map.of" if available - @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; - } -} -``` - -### DiscoveredAssetEndpointProfiles_Delete - -```java -/** - * Samples for DiscoveredAssetEndpointProfiles Delete. - */ -public final class DiscoveredAssetEndpointProfilesDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAssetEndpointProfile.json - */ - /** - * Sample code: Delete_DiscoveredAssetEndpointProfile. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - deleteDiscoveredAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles() - .delete("myResourceGroup", "my-discoveredassetendpointprofile", com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredAssetEndpointProfiles_GetByResourceGroup - -```java -/** - * Samples for DiscoveredAssetEndpointProfiles GetByResourceGroup. - */ -public final class DiscoveredAssetEndpointProfilesGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json - */ - /** - * Sample code: Get_DiscoveredAssetEndpointProfile. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - getDiscoveredAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles() - .getByResourceGroupWithResponse("myResourceGroup", "my-discoveredassetendpointprofile", - com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredAssetEndpointProfiles_List - -```java -/** - * Samples for DiscoveredAssetEndpointProfiles List. - */ -public final class DiscoveredAssetEndpointProfilesListSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json - */ - /** - * Sample code: List_DiscoveredAssetEndpointProfiles_Subscription. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void listDiscoveredAssetEndpointProfilesSubscription( - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles().list(com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredAssetEndpointProfiles_ListByResourceGroup - -```java -/** - * Samples for DiscoveredAssetEndpointProfiles ListByResourceGroup. - */ -public final class DiscoveredAssetEndpointProfilesListByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_ResourceGroup.json - */ - /** - * Sample code: List_DiscoveredAssetEndpointProfiles_ResourceGroup. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void listDiscoveredAssetEndpointProfilesResourceGroup( - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles() - .listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredAssetEndpointProfiles_Update - -```java -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfile; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdateProperties; -import java.util.Arrays; - -/** - * Samples for DiscoveredAssetEndpointProfiles Update. - */ -public final class DiscoveredAssetEndpointProfilesUpdateSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAssetEndpointProfile.json - */ - /** - * Sample code: Update_DiscoveredAssetEndpointProfile. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - updateDiscoveredAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - DiscoveredAssetEndpointProfile resource = manager.discoveredAssetEndpointProfiles() - .getByResourceGroupWithResponse("myResourceGroup", "my-discoveredassetendpointprofile", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new DiscoveredAssetEndpointProfileUpdateProperties() - .withTargetAddress("https://www.example.com/myTargetAddress") - .withAdditionalConfiguration("{\"foo\": \"bar\"}") - .withSupportedAuthenticationMethods( - Arrays.asList(AuthenticationMethod.ANONYMOUS, AuthenticationMethod.CERTIFICATE)) - .withEndpointProfileType("myEndpointProfileType") - .withDiscoveryId("11111111-1111-1111-1111-111111111111") - .withVersion(73766L)) - .apply(); - } -} -``` - -### DiscoveredAssets_CreateOrReplace - -```java -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetProperties; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredDataPoint; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredDataset; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredEvent; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import com.azure.resourcemanager.deviceregistry.models.Topic; -import com.azure.resourcemanager.deviceregistry.models.TopicRetainType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for DiscoveredAssets CreateOrReplace. - */ -public final class DiscoveredAssetsCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAsset.json - */ - /** - * Sample code: Create_DiscoveredAsset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void createDiscoveredAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets() - .define("my-discoveredasset") - .withRegion("West Europe") - .withExistingResourceGroup("myResourceGroup") - .withExtendedLocation(new ExtendedLocation().withType("CustomLocation") - .withName( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) - .withTags(mapOf("site", "building-1")) - .withProperties(new DiscoveredAssetProperties().withAssetEndpointProfileRef("myAssetEndpointProfile") - .withDiscoveryId("11111111-1111-1111-1111-111111111111") - .withVersion(73766L) - .withManufacturer("Contoso") - .withManufacturerUri("https://www.contoso.com/manufacturerUri") - .withModel("ContosoModel") - .withProductCode("fakeTokenPlaceholder") - .withHardwareRevision("1.0") - .withSoftwareRevision("2.0") - .withDocumentationUri("https://www.example.com/manual") - .withSerialNumber("64-103816-519918-8") - .withDefaultDatasetsConfiguration( - "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}") - .withDefaultEventsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}") - .withDefaultTopic(new Topic().withPath("/path/defaultTopic").withRetain(TopicRetainType.KEEP)) - .withDatasets(Arrays.asList(new DiscoveredDataset().withName("dataset1") - .withDatasetConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}") - .withTopic(new Topic().withPath("/path/dataset1").withRetain(TopicRetainType.KEEP)) - .withDataPoints(Arrays.asList( - new DiscoveredDataPoint().withName("dataPoint1") - .withDataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") - .withDataPointConfiguration( - "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"), - new DiscoveredDataPoint().withName("dataPoint2") - .withDataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") - .withDataPointConfiguration( - "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"))))) - .withEvents(Arrays.asList( - new DiscoveredEvent().withName("event1") - .withEventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") - .withEventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}") - .withTopic(new Topic().withPath("/path/event1").withRetain(TopicRetainType.KEEP)), - new DiscoveredEvent().withName("event2") - .withEventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") - .withEventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}")))) - .create(); - } - - // Use "Map.of" if available - @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; - } -} -``` - -### DiscoveredAssets_Delete - -```java -/** - * Samples for DiscoveredAssets Delete. - */ -public final class DiscoveredAssetsDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAsset.json - */ - /** - * Sample code: Delete_DiscoveredAsset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteDiscoveredAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets().delete("myResourceGroup", "my-discoveredasset", com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredAssets_GetByResourceGroup - -```java -/** - * Samples for DiscoveredAssets GetByResourceGroup. - */ -public final class DiscoveredAssetsGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAsset.json - */ - /** - * Sample code: Get_DiscoveredAsset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getDiscoveredAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets() - .getByResourceGroupWithResponse("myResourceGroup", "my-discoveredasset", com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredAssets_List - -```java -/** - * Samples for DiscoveredAssets List. - */ -public final class DiscoveredAssetsListSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json - */ - /** - * Sample code: List_DiscoveredAssets_Subscription. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listDiscoveredAssetsSubscription(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets().list(com.azure.core.util.Context.NONE); - } -} -``` - -### DiscoveredAssets_ListByResourceGroup +### OperationStatus_Get ```java /** - * Samples for DiscoveredAssets ListByResourceGroup. + * Samples for OperationStatus Get. */ -public final class DiscoveredAssetsListByResourceGroupSamples { +public final class OperationStatusGetSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_ResourceGroup.json + * x-ms-original-file: 2024-11-01/Get_OperationStatus.json */ /** - * Sample code: List_DiscoveredAssets_ResourceGroup. + * Sample code: Get_OperationStatus. * * @param manager Entry point to DeviceRegistryManager. */ - public static void - listDiscoveredAssetsResourceGroup(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + public static void getOperationStatus(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.operationStatus() + .getWithResponse("testLocation", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", com.azure.core.util.Context.NONE); } } ``` -### DiscoveredAssets_Update +### Operations_List ```java -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAsset; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetUpdateProperties; -import com.azure.resourcemanager.deviceregistry.models.Topic; -import com.azure.resourcemanager.deviceregistry.models.TopicRetainType; - /** - * Samples for DiscoveredAssets Update. + * Samples for Operations List. */ -public final class DiscoveredAssetsUpdateSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAsset.json + * x-ms-original-file: 2024-11-01/List_Operations.json */ /** - * Sample code: Update_DiscoveredAsset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void updateDiscoveredAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - DiscoveredAsset resource = manager.discoveredAssets() - .getByResourceGroupWithResponse("myResourceGroup", "my-discoveredasset", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties( - new DiscoveredAssetUpdateProperties().withDocumentationUri("https://www.example.com/manual-2") - .withDefaultTopic(new Topic().withPath("/path/defaultTopic").withRetain(TopicRetainType.NEVER))) - .apply(); - } -} -``` - -### OperationStatus_Get - -```java -/** - * Samples for OperationStatus Get. - */ -public final class OperationStatusGetSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_OperationStatus.json - */ - /** - * Sample code: Get_OperationStatus. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getOperationStatus(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.operationStatus() - .getWithResponse("testLocation", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", com.azure.core.util.Context.NONE); - } -} -``` - -### Operations_List - -```java -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_Operations.json - */ - /** - * Sample code: List_Operations. + * Sample code: List_Operations. * * @param manager Entry point to DeviceRegistryManager. */ @@ -1194,396 +757,3 @@ public final class OperationsListSamples { } ``` -### SchemaRegistries_CreateOrReplace - -```java -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryProperties; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentity; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for SchemaRegistries CreateOrReplace. - */ -public final class SchemaRegistriesCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_SchemaRegistry.json - */ - /** - * Sample code: Create_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void createSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries() - .define("my-schema-registry") - .withRegion("West Europe") - .withExistingResourceGroup("myResourceGroup") - .withTags(mapOf()) - .withProperties(new SchemaRegistryProperties().withNamespace("sr-namespace-001") - .withDisplayName("Schema Registry namespace 001") - .withDescription("This is a sample Schema Registry") - .withStorageAccountContainerUrl("my-blob-storage.blob.core.windows.net/my-container")) - .withIdentity(new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.NONE)) - .create(); - } - - // Use "Map.of" if available - @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; - } -} -``` - -### SchemaRegistries_Delete - -```java -/** - * Samples for SchemaRegistries Delete. - */ -public final class SchemaRegistriesDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaRegistry.json - */ - /** - * Sample code: Delete_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries().delete("myResourceGroup", "my-schema-registry", com.azure.core.util.Context.NONE); - } -} -``` - -### SchemaRegistries_GetByResourceGroup - -```java -/** - * Samples for SchemaRegistries GetByResourceGroup. - */ -public final class SchemaRegistriesGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_SchemaRegistry.json - */ - /** - * Sample code: Get_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries() - .getByResourceGroupWithResponse("myResourceGroup", "my-schema-registry", com.azure.core.util.Context.NONE); - } -} -``` - -### SchemaRegistries_List - -```java -/** - * Samples for SchemaRegistries List. - */ -public final class SchemaRegistriesListSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_Subscription.json - */ - /** - * Sample code: List_SchemaRegistries_Subscription. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listSchemaRegistriesSubscription(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries().list(com.azure.core.util.Context.NONE); - } -} -``` - -### SchemaRegistries_ListByResourceGroup - -```java -/** - * Samples for SchemaRegistries ListByResourceGroup. - */ -public final class SchemaRegistriesListByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_ResourceGroup.json - */ - /** - * Sample code: List_SchemaRegistries_ResourceGroup. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listSchemaRegistriesResourceGroup(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); - } -} -``` - -### SchemaRegistries_Update - -```java -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistry; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdateProperties; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for SchemaRegistries Update. - */ -public final class SchemaRegistriesUpdateSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Update_SchemaRegistry.json - */ - /** - * Sample code: Update_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void updateSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - SchemaRegistry resource = manager.schemaRegistries() - .getByResourceGroupWithResponse("myResourceGroup", "my-schema-registry", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf()) - .withProperties(new SchemaRegistryUpdateProperties().withDisplayName("Schema Registry namespace 001") - .withDescription("This is a sample Schema Registry")) - .apply(); - } - - // Use "Map.of" if available - @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; - } -} -``` - -### SchemaVersions_CreateOrReplace - -```java -import com.azure.resourcemanager.deviceregistry.models.SchemaVersionProperties; - -/** - * Samples for SchemaVersions CreateOrReplace. - */ -public final class SchemaVersionsCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_SchemaVersion.json - */ - /** - * Sample code: Create_SchemaVersion. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void createSchemaVersion(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaVersions() - .define("1") - .withExistingSchema("myResourceGroup", "my-schema-registry", "my-schema") - .withProperties(new SchemaVersionProperties().withDescription("Schema version 1") - .withSchemaContent( - "{\"$schema\": \"http://json-schema.org/draft-07/schema#\",\"type\": \"object\",\"properties\": {\"humidity\": {\"type\": \"string\"},\"temperature\": {\"type\":\"number\"}}}")) - .create(); - } -} -``` - -### SchemaVersions_Delete - -```java -/** - * Samples for SchemaVersions Delete. - */ -public final class SchemaVersionsDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaVersion.json - */ - /** - * Sample code: Delete_SchemaVersion. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteSchemaVersion(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaVersions() - .deleteWithResponse("myResourceGroup", "my-schema-registry", "my-schema", "1", - com.azure.core.util.Context.NONE); - } -} -``` - -### SchemaVersions_Get - -```java -/** - * Samples for SchemaVersions Get. - */ -public final class SchemaVersionsGetSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_SchemaVersion.json - */ - /** - * Sample code: Get_SchemaVersion. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getSchemaVersion(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaVersions() - .getWithResponse("myResourceGroup", "my-schema-registry", "my-schema", "1", - com.azure.core.util.Context.NONE); - } -} -``` - -### SchemaVersions_ListBySchema - -```java -/** - * Samples for SchemaVersions ListBySchema. - */ -public final class SchemaVersionsListBySchemaSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_SchemaVersions_Schema.json - */ - /** - * Sample code: List_SchemaVersions_Schema. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listSchemaVersionsSchema(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaVersions() - .listBySchema("myResourceGroup", "my-schema-registry", "my-schema", com.azure.core.util.Context.NONE); - } -} -``` - -### Schemas_CreateOrReplace - -```java -import com.azure.resourcemanager.deviceregistry.models.Format; -import com.azure.resourcemanager.deviceregistry.models.SchemaProperties; -import com.azure.resourcemanager.deviceregistry.models.SchemaType; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for Schemas CreateOrReplace. - */ -public final class SchemasCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_Schema.json - */ - /** - * Sample code: Create_Schema. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void createSchema(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemas() - .define("my-schema") - .withExistingSchemaRegistry("myResourceGroup", "my-schema-registry") - .withProperties(new SchemaProperties().withDisplayName("My Schema") - .withDescription("This is a sample Schema") - .withFormat(Format.JSON_SCHEMA_DRAFT7) - .withSchemaType(SchemaType.MESSAGE_SCHEMA) - .withTags(mapOf("sampleKey", "fakeTokenPlaceholder"))) - .create(); - } - - // Use "Map.of" if available - @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; - } -} -``` - -### Schemas_Delete - -```java -/** - * Samples for Schemas Delete. - */ -public final class SchemasDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_Schema.json - */ - /** - * Sample code: Delete_Schema. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteSchema(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemas() - .deleteWithResponse("myResourceGroup", "my-schema-registry", "my-schema", com.azure.core.util.Context.NONE); - } -} -``` - -### Schemas_Get - -```java -/** - * Samples for Schemas Get. - */ -public final class SchemasGetSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_Schema.json - */ - /** - * Sample code: Schemas_Get. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void schemasGet(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemas() - .getWithResponse("myResourceGroup", "my-schema-registry", "my-schema", com.azure.core.util.Context.NONE); - } -} -``` - -### Schemas_ListBySchemaRegistry - -```java -/** - * Samples for Schemas ListBySchemaRegistry. - */ -public final class SchemasListBySchemaRegistrySamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_Schemas_SchemaRegistry.json - */ - /** - * Sample code: List_Schemas_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listSchemasSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemas() - .listBySchemaRegistry("myResourceGroup", "my-schema-registry", com.azure.core.util.Context.NONE); - } -} -``` - diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/DeviceRegistryManager.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/DeviceRegistryManager.java index 1f39c58fce5d..06416263c13f 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/DeviceRegistryManager.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/DeviceRegistryManager.java @@ -28,23 +28,13 @@ import com.azure.resourcemanager.deviceregistry.implementation.AssetsImpl; import com.azure.resourcemanager.deviceregistry.implementation.BillingContainersImpl; import com.azure.resourcemanager.deviceregistry.implementation.DeviceRegistryManagementClientBuilder; -import com.azure.resourcemanager.deviceregistry.implementation.DiscoveredAssetEndpointProfilesImpl; -import com.azure.resourcemanager.deviceregistry.implementation.DiscoveredAssetsImpl; import com.azure.resourcemanager.deviceregistry.implementation.OperationStatusImpl; import com.azure.resourcemanager.deviceregistry.implementation.OperationsImpl; -import com.azure.resourcemanager.deviceregistry.implementation.SchemaRegistriesImpl; -import com.azure.resourcemanager.deviceregistry.implementation.SchemaVersionsImpl; -import com.azure.resourcemanager.deviceregistry.implementation.SchemasImpl; import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfiles; import com.azure.resourcemanager.deviceregistry.models.Assets; import com.azure.resourcemanager.deviceregistry.models.BillingContainers; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfiles; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssets; import com.azure.resourcemanager.deviceregistry.models.OperationStatus; import com.azure.resourcemanager.deviceregistry.models.Operations; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistries; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersions; -import com.azure.resourcemanager.deviceregistry.models.Schemas; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -67,16 +57,6 @@ public final class DeviceRegistryManager { private BillingContainers billingContainers; - private DiscoveredAssets discoveredAssets; - - private DiscoveredAssetEndpointProfiles discoveredAssetEndpointProfiles; - - private SchemaRegistries schemaRegistries; - - private Schemas schemas; - - private SchemaVersions schemaVersions; - private final DeviceRegistryManagementClient clientObject; private DeviceRegistryManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -241,7 +221,7 @@ public DeviceRegistryManager authenticate(TokenCredential credential, AzureProfi .append("-") .append("com.azure.resourcemanager.deviceregistry") .append("/") - .append("1.0.0-beta.1"); + .append("1.0.0-beta.3"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -347,67 +327,6 @@ public BillingContainers billingContainers() { return billingContainers; } - /** - * Gets the resource collection API of DiscoveredAssets. It manages DiscoveredAsset. - * - * @return Resource collection API of DiscoveredAssets. - */ - public DiscoveredAssets discoveredAssets() { - if (this.discoveredAssets == null) { - this.discoveredAssets = new DiscoveredAssetsImpl(clientObject.getDiscoveredAssets(), this); - } - return discoveredAssets; - } - - /** - * Gets the resource collection API of DiscoveredAssetEndpointProfiles. It manages DiscoveredAssetEndpointProfile. - * - * @return Resource collection API of DiscoveredAssetEndpointProfiles. - */ - public DiscoveredAssetEndpointProfiles discoveredAssetEndpointProfiles() { - if (this.discoveredAssetEndpointProfiles == null) { - this.discoveredAssetEndpointProfiles - = new DiscoveredAssetEndpointProfilesImpl(clientObject.getDiscoveredAssetEndpointProfiles(), this); - } - return discoveredAssetEndpointProfiles; - } - - /** - * Gets the resource collection API of SchemaRegistries. It manages SchemaRegistry. - * - * @return Resource collection API of SchemaRegistries. - */ - public SchemaRegistries schemaRegistries() { - if (this.schemaRegistries == null) { - this.schemaRegistries = new SchemaRegistriesImpl(clientObject.getSchemaRegistries(), this); - } - return schemaRegistries; - } - - /** - * Gets the resource collection API of Schemas. It manages Schema. - * - * @return Resource collection API of Schemas. - */ - public Schemas schemas() { - if (this.schemas == null) { - this.schemas = new SchemasImpl(clientObject.getSchemas(), this); - } - return schemas; - } - - /** - * Gets the resource collection API of SchemaVersions. It manages SchemaVersion. - * - * @return Resource collection API of SchemaVersions. - */ - public SchemaVersions schemaVersions() { - if (this.schemaVersions == null) { - this.schemaVersions = new SchemaVersionsImpl(clientObject.getSchemaVersions(), this); - } - return schemaVersions; - } - /** * Gets wrapped service client DeviceRegistryManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DeviceRegistryManagementClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DeviceRegistryManagementClient.java index 6e64e3324c3a..95fa8f8ea5d2 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DeviceRegistryManagementClient.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DeviceRegistryManagementClient.java @@ -80,39 +80,4 @@ public interface DeviceRegistryManagementClient { * @return the BillingContainersClient object. */ BillingContainersClient getBillingContainers(); - - /** - * Gets the DiscoveredAssetsClient object to access its operations. - * - * @return the DiscoveredAssetsClient object. - */ - DiscoveredAssetsClient getDiscoveredAssets(); - - /** - * Gets the DiscoveredAssetEndpointProfilesClient object to access its operations. - * - * @return the DiscoveredAssetEndpointProfilesClient object. - */ - DiscoveredAssetEndpointProfilesClient getDiscoveredAssetEndpointProfiles(); - - /** - * Gets the SchemaRegistriesClient object to access its operations. - * - * @return the SchemaRegistriesClient object. - */ - SchemaRegistriesClient getSchemaRegistries(); - - /** - * Gets the SchemasClient object to access its operations. - * - * @return the SchemasClient object. - */ - SchemasClient getSchemas(); - - /** - * Gets the SchemaVersionsClient object to access its operations. - * - * @return the SchemaVersionsClient object. - */ - SchemaVersionsClient getSchemaVersions(); } diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DiscoveredAssetEndpointProfilesClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DiscoveredAssetEndpointProfilesClient.java deleted file mode 100644 index 07d2ea342172..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DiscoveredAssetEndpointProfilesClient.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetEndpointProfileInner; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdate; - -/** - * An instance of this class provides access to all the operations defined in DiscoveredAssetEndpointProfilesClient. - */ -public interface DiscoveredAssetEndpointProfilesClient { - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, - String discoveredAssetEndpointProfileName, Context context); - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetEndpointProfileInner getByResourceGroup(String resourceGroupName, - String discoveredAssetEndpointProfileName); - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiscoveredAssetEndpointProfileInner> - beginCreateOrReplace(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileInner resource); - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiscoveredAssetEndpointProfileInner> - beginCreateOrReplace(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileInner resource, Context context); - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetEndpointProfileInner createOrReplace(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileInner resource); - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetEndpointProfileInner createOrReplace(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileInner resource, Context context); - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiscoveredAssetEndpointProfileInner> beginUpdate( - String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileUpdate properties); - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiscoveredAssetEndpointProfileInner> beginUpdate( - String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileUpdate properties, Context context); - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetEndpointProfileInner update(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileUpdate properties); - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetEndpointProfileInner update(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileUpdate properties, Context context); - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String discoveredAssetEndpointProfileName); - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String discoveredAssetEndpointProfileName, - Context context); - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String discoveredAssetEndpointProfileName); - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String discoveredAssetEndpointProfileName, Context context); - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DiscoveredAssetsClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DiscoveredAssetsClient.java deleted file mode 100644 index 3362c3d1e02f..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/DiscoveredAssetsClient.java +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetInner; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetUpdate; - -/** - * An instance of this class provides access to all the operations defined in DiscoveredAssetsClient. - */ -public interface DiscoveredAssetsClient { - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String discoveredAssetName, - Context context); - - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetInner getByResourceGroup(String resourceGroupName, String discoveredAssetName); - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiscoveredAssetInner> beginCreateOrReplace(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetInner resource); - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiscoveredAssetInner> beginCreateOrReplace(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetInner resource, Context context); - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetInner createOrReplace(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetInner resource); - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetInner createOrReplace(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetInner resource, Context context); - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiscoveredAssetInner> beginUpdate(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetUpdate properties); - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DiscoveredAssetInner> beginUpdate(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetUpdate properties, Context context); - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetInner update(String resourceGroupName, String discoveredAssetName, DiscoveredAssetUpdate properties); - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredAssetInner update(String resourceGroupName, String discoveredAssetName, DiscoveredAssetUpdate properties, - Context context); - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String discoveredAssetName); - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String discoveredAssetName, - Context context); - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String discoveredAssetName); - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String discoveredAssetName, Context context); - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemaRegistriesClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemaRegistriesClient.java deleted file mode 100644 index cea69f6ae34f..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemaRegistriesClient.java +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaRegistryInner; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdate; - -/** - * An instance of this class provides access to all the operations defined in SchemaRegistriesClient. - */ -public interface SchemaRegistriesClient { - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String schemaRegistryName, - Context context); - - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaRegistryInner getByResourceGroup(String resourceGroupName, String schemaRegistryName); - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SchemaRegistryInner> beginCreateOrReplace(String resourceGroupName, - String schemaRegistryName, SchemaRegistryInner resource); - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SchemaRegistryInner> beginCreateOrReplace(String resourceGroupName, - String schemaRegistryName, SchemaRegistryInner resource, Context context); - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaRegistryInner createOrReplace(String resourceGroupName, String schemaRegistryName, - SchemaRegistryInner resource); - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaRegistryInner createOrReplace(String resourceGroupName, String schemaRegistryName, - SchemaRegistryInner resource, Context context); - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SchemaRegistryInner> beginUpdate(String resourceGroupName, - String schemaRegistryName, SchemaRegistryUpdate properties); - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SchemaRegistryInner> beginUpdate(String resourceGroupName, - String schemaRegistryName, SchemaRegistryUpdate properties, Context context); - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaRegistryInner update(String resourceGroupName, String schemaRegistryName, SchemaRegistryUpdate properties); - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaRegistryInner update(String resourceGroupName, String schemaRegistryName, SchemaRegistryUpdate properties, - Context context); - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String schemaRegistryName); - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String schemaRegistryName, - Context context); - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String schemaRegistryName); - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String schemaRegistryName, Context context); - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List SchemaRegistry resources by subscription ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List SchemaRegistry resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemaVersionsClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemaVersionsClient.java deleted file mode 100644 index 5241f1271986..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemaVersionsClient.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaVersionInner; - -/** - * An instance of this class provides access to all the operations defined in SchemaVersionsClient. - */ -public interface SchemaVersionsClient { - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName, Context context); - - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaVersionInner get(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName); - - /** - * Create a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema version's definition along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrReplaceWithResponse(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName, SchemaVersionInner resource, Context context); - - /** - * Create a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema version's definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaVersionInner createOrReplace(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName, SchemaVersionInner resource); - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName, Context context); - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String schemaRegistryName, String schemaName, String schemaVersionName); - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySchema(String resourceGroupName, String schemaRegistryName, - String schemaName); - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySchema(String resourceGroupName, String schemaRegistryName, - String schemaName, Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemasClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemasClient.java deleted file mode 100644 index 4bd64cc2174e..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/SchemasClient.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaInner; - -/** - * An instance of this class provides access to all the operations defined in SchemasClient. - */ -public interface SchemasClient { - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context); - - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaInner get(String resourceGroupName, String schemaRegistryName, String schemaName); - - /** - * Create a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema definition along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrReplaceWithResponse(String resourceGroupName, String schemaRegistryName, - String schemaName, SchemaInner resource, Context context); - - /** - * Create a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SchemaInner createOrReplace(String resourceGroupName, String schemaRegistryName, String schemaName, - SchemaInner resource); - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context); - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String schemaRegistryName, String schemaName); - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySchemaRegistry(String resourceGroupName, String schemaRegistryName); - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySchemaRegistry(String resourceGroupName, String schemaRegistryName, - Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/DiscoveredAssetEndpointProfileInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/DiscoveredAssetEndpointProfileInner.java deleted file mode 100644 index 44ef009c51ad..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/DiscoveredAssetEndpointProfileInner.java +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileProperties; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import java.io.IOException; -import java.util.Map; - -/** - * Discovered Asset Endpoint Profile definition. - */ -@Fluent -public final class DiscoveredAssetEndpointProfileInner extends Resource { - /* - * The resource-specific properties for this resource. - */ - private DiscoveredAssetEndpointProfileProperties properties; - - /* - * The extended location. - */ - private ExtendedLocation extendedLocation; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of DiscoveredAssetEndpointProfileInner class. - */ - public DiscoveredAssetEndpointProfileInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public DiscoveredAssetEndpointProfileProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the DiscoveredAssetEndpointProfileInner object itself. - */ - public DiscoveredAssetEndpointProfileInner withProperties(DiscoveredAssetEndpointProfileProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the extendedLocation property: The extended location. - * - * @return the extendedLocation value. - */ - public ExtendedLocation extendedLocation() { - return this.extendedLocation; - } - - /** - * Set the extendedLocation property: The extended location. - * - * @param extendedLocation the extendedLocation value to set. - * @return the DiscoveredAssetEndpointProfileInner object itself. - */ - public DiscoveredAssetEndpointProfileInner withExtendedLocation(ExtendedLocation extendedLocation) { - this.extendedLocation = extendedLocation; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public DiscoveredAssetEndpointProfileInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DiscoveredAssetEndpointProfileInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (extendedLocation() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property extendedLocation in model DiscoveredAssetEndpointProfileInner")); - } else { - extendedLocation().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredAssetEndpointProfileInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetEndpointProfileInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetEndpointProfileInner if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredAssetEndpointProfileInner. - */ - public static DiscoveredAssetEndpointProfileInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetEndpointProfileInner deserializedDiscoveredAssetEndpointProfileInner - = new DiscoveredAssetEndpointProfileInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDiscoveredAssetEndpointProfileInner.withTags(tags); - } else if ("extendedLocation".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileInner.extendedLocation - = ExtendedLocation.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileInner.properties - = DiscoveredAssetEndpointProfileProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetEndpointProfileInner; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/DiscoveredAssetInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/DiscoveredAssetInner.java deleted file mode 100644 index 366bebe17b20..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/DiscoveredAssetInner.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetProperties; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import java.io.IOException; -import java.util.Map; - -/** - * Discovered Asset definition. - */ -@Fluent -public final class DiscoveredAssetInner extends Resource { - /* - * The resource-specific properties for this resource. - */ - private DiscoveredAssetProperties properties; - - /* - * The extended location. - */ - private ExtendedLocation extendedLocation; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of DiscoveredAssetInner class. - */ - public DiscoveredAssetInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public DiscoveredAssetProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the DiscoveredAssetInner object itself. - */ - public DiscoveredAssetInner withProperties(DiscoveredAssetProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the extendedLocation property: The extended location. - * - * @return the extendedLocation value. - */ - public ExtendedLocation extendedLocation() { - return this.extendedLocation; - } - - /** - * Set the extendedLocation property: The extended location. - * - * @param extendedLocation the extendedLocation value to set. - * @return the DiscoveredAssetInner object itself. - */ - public DiscoveredAssetInner withExtendedLocation(ExtendedLocation extendedLocation) { - this.extendedLocation = extendedLocation; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public DiscoveredAssetInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DiscoveredAssetInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (extendedLocation() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property extendedLocation in model DiscoveredAssetInner")); - } else { - extendedLocation().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredAssetInner.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("extendedLocation", this.extendedLocation); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredAssetInner. - */ - public static DiscoveredAssetInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetInner deserializedDiscoveredAssetInner = new DiscoveredAssetInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedDiscoveredAssetInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedDiscoveredAssetInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedDiscoveredAssetInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedDiscoveredAssetInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDiscoveredAssetInner.withTags(tags); - } else if ("extendedLocation".equals(fieldName)) { - deserializedDiscoveredAssetInner.extendedLocation = ExtendedLocation.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedDiscoveredAssetInner.properties = DiscoveredAssetProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedDiscoveredAssetInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetInner; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaInner.java deleted file mode 100644 index d11d9dbe8bd8..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.models.SchemaProperties; -import java.io.IOException; - -/** - * Schema definition. - */ -@Fluent -public final class SchemaInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private SchemaProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SchemaInner class. - */ - public SchemaInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SchemaProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SchemaInner object itself. - */ - public SchemaInner withProperties(SchemaProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaInner. - */ - public static SchemaInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaInner deserializedSchemaInner = new SchemaInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSchemaInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSchemaInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSchemaInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSchemaInner.properties = SchemaProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSchemaInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaInner; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaRegistryInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaRegistryInner.java deleted file mode 100644 index 8abb1090dddc..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaRegistryInner.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryProperties; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentity; -import java.io.IOException; -import java.util.Map; - -/** - * Schema registry definition. - */ -@Fluent -public final class SchemaRegistryInner extends Resource { - /* - * The resource-specific properties for this resource. - */ - private SchemaRegistryProperties properties; - - /* - * The managed service identities assigned to this resource. - */ - private SystemAssignedServiceIdentity identity; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SchemaRegistryInner class. - */ - public SchemaRegistryInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SchemaRegistryProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SchemaRegistryInner object itself. - */ - public SchemaRegistryInner withProperties(SchemaRegistryProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the identity property: The managed service identities assigned to this resource. - * - * @return the identity value. - */ - public SystemAssignedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The managed service identities assigned to this resource. - * - * @param identity the identity value to set. - * @return the SchemaRegistryInner object itself. - */ - public SchemaRegistryInner withIdentity(SystemAssignedServiceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaRegistryInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SchemaRegistryInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (identity() != null) { - identity().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeJsonField("identity", this.identity); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaRegistryInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaRegistryInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaRegistryInner. - */ - public static SchemaRegistryInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaRegistryInner deserializedSchemaRegistryInner = new SchemaRegistryInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSchemaRegistryInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSchemaRegistryInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSchemaRegistryInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSchemaRegistryInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSchemaRegistryInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedSchemaRegistryInner.properties = SchemaRegistryProperties.fromJson(reader); - } else if ("identity".equals(fieldName)) { - deserializedSchemaRegistryInner.identity = SystemAssignedServiceIdentity.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSchemaRegistryInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaRegistryInner; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaVersionInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaVersionInner.java deleted file mode 100644 index 9c234ec7f0c8..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/models/SchemaVersionInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersionProperties; -import java.io.IOException; - -/** - * Schema version's definition. - */ -@Fluent -public final class SchemaVersionInner extends ProxyResource { - /* - * The resource-specific properties for this resource. - */ - private SchemaVersionProperties properties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - private SystemData systemData; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of SchemaVersionInner class. - */ - public SchemaVersionInner() { - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SchemaVersionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SchemaVersionInner object itself. - */ - public SchemaVersionInner withProperties(SchemaVersionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaVersionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaVersionInner if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaVersionInner. - */ - public static SchemaVersionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaVersionInner deserializedSchemaVersionInner = new SchemaVersionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSchemaVersionInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedSchemaVersionInner.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedSchemaVersionInner.type = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedSchemaVersionInner.properties = SchemaVersionProperties.fromJson(reader); - } else if ("systemData".equals(fieldName)) { - deserializedSchemaVersionInner.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaVersionInner; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryManagementClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryManagementClientImpl.java index 9aa7a4bce55a..34a6a5cf0f5d 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryManagementClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DeviceRegistryManagementClientImpl.java @@ -27,13 +27,8 @@ import com.azure.resourcemanager.deviceregistry.fluent.AssetsClient; import com.azure.resourcemanager.deviceregistry.fluent.BillingContainersClient; import com.azure.resourcemanager.deviceregistry.fluent.DeviceRegistryManagementClient; -import com.azure.resourcemanager.deviceregistry.fluent.DiscoveredAssetEndpointProfilesClient; -import com.azure.resourcemanager.deviceregistry.fluent.DiscoveredAssetsClient; import com.azure.resourcemanager.deviceregistry.fluent.OperationStatusClient; import com.azure.resourcemanager.deviceregistry.fluent.OperationsClient; -import com.azure.resourcemanager.deviceregistry.fluent.SchemaRegistriesClient; -import com.azure.resourcemanager.deviceregistry.fluent.SchemaVersionsClient; -import com.azure.resourcemanager.deviceregistry.fluent.SchemasClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -202,76 +197,6 @@ public BillingContainersClient getBillingContainers() { return this.billingContainers; } - /** - * The DiscoveredAssetsClient object to access its operations. - */ - private final DiscoveredAssetsClient discoveredAssets; - - /** - * Gets the DiscoveredAssetsClient object to access its operations. - * - * @return the DiscoveredAssetsClient object. - */ - public DiscoveredAssetsClient getDiscoveredAssets() { - return this.discoveredAssets; - } - - /** - * The DiscoveredAssetEndpointProfilesClient object to access its operations. - */ - private final DiscoveredAssetEndpointProfilesClient discoveredAssetEndpointProfiles; - - /** - * Gets the DiscoveredAssetEndpointProfilesClient object to access its operations. - * - * @return the DiscoveredAssetEndpointProfilesClient object. - */ - public DiscoveredAssetEndpointProfilesClient getDiscoveredAssetEndpointProfiles() { - return this.discoveredAssetEndpointProfiles; - } - - /** - * The SchemaRegistriesClient object to access its operations. - */ - private final SchemaRegistriesClient schemaRegistries; - - /** - * Gets the SchemaRegistriesClient object to access its operations. - * - * @return the SchemaRegistriesClient object. - */ - public SchemaRegistriesClient getSchemaRegistries() { - return this.schemaRegistries; - } - - /** - * The SchemasClient object to access its operations. - */ - private final SchemasClient schemas; - - /** - * Gets the SchemasClient object to access its operations. - * - * @return the SchemasClient object. - */ - public SchemasClient getSchemas() { - return this.schemas; - } - - /** - * The SchemaVersionsClient object to access its operations. - */ - private final SchemaVersionsClient schemaVersions; - - /** - * Gets the SchemaVersionsClient object to access its operations. - * - * @return the SchemaVersionsClient object. - */ - public SchemaVersionsClient getSchemaVersions() { - return this.schemaVersions; - } - /** * Initializes an instance of DeviceRegistryManagementClient client. * @@ -289,17 +214,12 @@ public SchemaVersionsClient getSchemaVersions() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2024-09-01-preview"; + this.apiVersion = "2024-11-01"; this.operations = new OperationsClientImpl(this); this.operationStatus = new OperationStatusClientImpl(this); this.assets = new AssetsClientImpl(this); this.assetEndpointProfiles = new AssetEndpointProfilesClientImpl(this); this.billingContainers = new BillingContainersClientImpl(this); - this.discoveredAssets = new DiscoveredAssetsClientImpl(this); - this.discoveredAssetEndpointProfiles = new DiscoveredAssetEndpointProfilesClientImpl(this); - this.schemaRegistries = new SchemaRegistriesClientImpl(this); - this.schemas = new SchemasClientImpl(this); - this.schemaVersions = new SchemaVersionsClientImpl(this); } /** diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfileImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfileImpl.java deleted file mode 100644 index 88b31fc2df85..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfileImpl.java +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetEndpointProfileInner; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfile; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileProperties; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdate; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdateProperties; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import java.util.Collections; -import java.util.Map; - -public final class DiscoveredAssetEndpointProfileImpl implements DiscoveredAssetEndpointProfile, - DiscoveredAssetEndpointProfile.Definition, DiscoveredAssetEndpointProfile.Update { - private DiscoveredAssetEndpointProfileInner innerObject; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public DiscoveredAssetEndpointProfileProperties properties() { - return this.innerModel().properties(); - } - - public ExtendedLocation extendedLocation() { - return this.innerModel().extendedLocation(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public DiscoveredAssetEndpointProfileInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String discoveredAssetEndpointProfileName; - - private DiscoveredAssetEndpointProfileUpdate updateProperties; - - public DiscoveredAssetEndpointProfileImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public DiscoveredAssetEndpointProfile create() { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssetEndpointProfiles() - .createOrReplace(resourceGroupName, discoveredAssetEndpointProfileName, this.innerModel(), Context.NONE); - return this; - } - - public DiscoveredAssetEndpointProfile create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssetEndpointProfiles() - .createOrReplace(resourceGroupName, discoveredAssetEndpointProfileName, this.innerModel(), context); - return this; - } - - DiscoveredAssetEndpointProfileImpl(String name, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = new DiscoveredAssetEndpointProfileInner(); - this.serviceManager = serviceManager; - this.discoveredAssetEndpointProfileName = name; - } - - public DiscoveredAssetEndpointProfileImpl update() { - this.updateProperties = new DiscoveredAssetEndpointProfileUpdate(); - return this; - } - - public DiscoveredAssetEndpointProfile apply() { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssetEndpointProfiles() - .update(resourceGroupName, discoveredAssetEndpointProfileName, updateProperties, Context.NONE); - return this; - } - - public DiscoveredAssetEndpointProfile apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssetEndpointProfiles() - .update(resourceGroupName, discoveredAssetEndpointProfileName, updateProperties, context); - return this; - } - - DiscoveredAssetEndpointProfileImpl(DiscoveredAssetEndpointProfileInner innerObject, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.discoveredAssetEndpointProfileName - = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "discoveredAssetEndpointProfiles"); - } - - public DiscoveredAssetEndpointProfile refresh() { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssetEndpointProfiles() - .getByResourceGroupWithResponse(resourceGroupName, discoveredAssetEndpointProfileName, Context.NONE) - .getValue(); - return this; - } - - public DiscoveredAssetEndpointProfile refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssetEndpointProfiles() - .getByResourceGroupWithResponse(resourceGroupName, discoveredAssetEndpointProfileName, context) - .getValue(); - return this; - } - - public DiscoveredAssetEndpointProfileImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public DiscoveredAssetEndpointProfileImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public DiscoveredAssetEndpointProfileImpl withExtendedLocation(ExtendedLocation extendedLocation) { - this.innerModel().withExtendedLocation(extendedLocation); - return this; - } - - public DiscoveredAssetEndpointProfileImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateProperties.withTags(tags); - return this; - } - } - - public DiscoveredAssetEndpointProfileImpl withProperties(DiscoveredAssetEndpointProfileProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public DiscoveredAssetEndpointProfileImpl - withProperties(DiscoveredAssetEndpointProfileUpdateProperties properties) { - this.updateProperties.withProperties(properties); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfilesClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfilesClientImpl.java deleted file mode 100644 index 0075dd1ba2ab..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfilesClientImpl.java +++ /dev/null @@ -1,1337 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.deviceregistry.fluent.DiscoveredAssetEndpointProfilesClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetEndpointProfileInner; -import com.azure.resourcemanager.deviceregistry.implementation.models.DiscoveredAssetEndpointProfileListResult; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DiscoveredAssetEndpointProfilesClient. - */ -public final class DiscoveredAssetEndpointProfilesClientImpl implements DiscoveredAssetEndpointProfilesClient { - /** - * The proxy service used to perform REST calls. - */ - private final DiscoveredAssetEndpointProfilesService service; - - /** - * The service client containing this operation class. - */ - private final DeviceRegistryManagementClientImpl client; - - /** - * Initializes an instance of DiscoveredAssetEndpointProfilesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DiscoveredAssetEndpointProfilesClientImpl(DeviceRegistryManagementClientImpl client) { - this.service = RestProxy.create(DiscoveredAssetEndpointProfilesService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for DeviceRegistryManagementClientDiscoveredAssetEndpointProfiles to be - * used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "DeviceRegistryManage") - public interface DiscoveredAssetEndpointProfilesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("discoveredAssetEndpointProfileName") String discoveredAssetEndpointProfileName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("discoveredAssetEndpointProfileName") String discoveredAssetEndpointProfileName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DiscoveredAssetEndpointProfileInner resource, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("discoveredAssetEndpointProfileName") String discoveredAssetEndpointProfileName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DiscoveredAssetEndpointProfileUpdate properties, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("discoveredAssetEndpointProfileName") String discoveredAssetEndpointProfileName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getByResourceGroupWithResponseAsync(String resourceGroupName, String discoveredAssetEndpointProfileName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetEndpointProfileName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredAssetEndpointProfileName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetEndpointProfileName, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String discoveredAssetEndpointProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetEndpointProfileName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredAssetEndpointProfileName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetEndpointProfileName, accept, context); - } - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, discoveredAssetEndpointProfileName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String discoveredAssetEndpointProfileName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, discoveredAssetEndpointProfileName, context) - .block(); - } - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetEndpointProfileInner getByResourceGroup(String resourceGroupName, - String discoveredAssetEndpointProfileName) { - return getByResourceGroupWithResponse(resourceGroupName, discoveredAssetEndpointProfileName, Context.NONE) - .getValue(); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetEndpointProfileName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredAssetEndpointProfileName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetEndpointProfileName, contentType, - accept, resource, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetEndpointProfileName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredAssetEndpointProfileName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetEndpointProfileName, contentType, accept, - resource, context); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiscoveredAssetEndpointProfileInner> - beginCreateOrReplaceAsync(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileInner resource) { - Mono>> mono - = createOrReplaceWithResponseAsync(resourceGroupName, discoveredAssetEndpointProfileName, resource); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DiscoveredAssetEndpointProfileInner.class, - DiscoveredAssetEndpointProfileInner.class, this.client.getContext()); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiscoveredAssetEndpointProfileInner> - beginCreateOrReplaceAsync(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileInner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createOrReplaceWithResponseAsync(resourceGroupName, - discoveredAssetEndpointProfileName, resource, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DiscoveredAssetEndpointProfileInner.class, - DiscoveredAssetEndpointProfileInner.class, context); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiscoveredAssetEndpointProfileInner> - beginCreateOrReplace(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileInner resource) { - return this.beginCreateOrReplaceAsync(resourceGroupName, discoveredAssetEndpointProfileName, resource) - .getSyncPoller(); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiscoveredAssetEndpointProfileInner> - beginCreateOrReplace(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileInner resource, Context context) { - return this.beginCreateOrReplaceAsync(resourceGroupName, discoveredAssetEndpointProfileName, resource, context) - .getSyncPoller(); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileInner resource) { - return beginCreateOrReplaceAsync(resourceGroupName, discoveredAssetEndpointProfileName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileInner resource, Context context) { - return beginCreateOrReplaceAsync(resourceGroupName, discoveredAssetEndpointProfileName, resource, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetEndpointProfileInner createOrReplace(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileInner resource) { - return createOrReplaceAsync(resourceGroupName, discoveredAssetEndpointProfileName, resource).block(); - } - - /** - * Create a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetEndpointProfileInner createOrReplace(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileInner resource, Context context) { - return createOrReplaceAsync(resourceGroupName, discoveredAssetEndpointProfileName, resource, context).block(); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetEndpointProfileName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredAssetEndpointProfileName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetEndpointProfileName, contentType, - accept, properties, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetEndpointProfileName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredAssetEndpointProfileName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, discoveredAssetEndpointProfileName, contentType, accept, properties, context); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiscoveredAssetEndpointProfileInner> - beginUpdateAsync(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileUpdate properties) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, discoveredAssetEndpointProfileName, properties); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DiscoveredAssetEndpointProfileInner.class, - DiscoveredAssetEndpointProfileInner.class, this.client.getContext()); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiscoveredAssetEndpointProfileInner> - beginUpdateAsync(String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileUpdate properties, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, discoveredAssetEndpointProfileName, properties, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DiscoveredAssetEndpointProfileInner.class, - DiscoveredAssetEndpointProfileInner.class, context); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiscoveredAssetEndpointProfileInner> beginUpdate( - String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileUpdate properties) { - return this.beginUpdateAsync(resourceGroupName, discoveredAssetEndpointProfileName, properties).getSyncPoller(); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiscoveredAssetEndpointProfileInner> beginUpdate( - String resourceGroupName, String discoveredAssetEndpointProfileName, - DiscoveredAssetEndpointProfileUpdate properties, Context context) { - return this.beginUpdateAsync(resourceGroupName, discoveredAssetEndpointProfileName, properties, context) - .getSyncPoller(); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileUpdate properties) { - return beginUpdateAsync(resourceGroupName, discoveredAssetEndpointProfileName, properties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileUpdate properties, Context context) { - return beginUpdateAsync(resourceGroupName, discoveredAssetEndpointProfileName, properties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetEndpointProfileInner update(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileUpdate properties) { - return updateAsync(resourceGroupName, discoveredAssetEndpointProfileName, properties).block(); - } - - /** - * Update a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset Endpoint Profile definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetEndpointProfileInner update(String resourceGroupName, - String discoveredAssetEndpointProfileName, DiscoveredAssetEndpointProfileUpdate properties, Context context) { - return updateAsync(resourceGroupName, discoveredAssetEndpointProfileName, properties, context).block(); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetEndpointProfileName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredAssetEndpointProfileName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetEndpointProfileName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetEndpointProfileName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter discoveredAssetEndpointProfileName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, discoveredAssetEndpointProfileName, accept, context); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, discoveredAssetEndpointProfileName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, - String discoveredAssetEndpointProfileName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, discoveredAssetEndpointProfileName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, - String discoveredAssetEndpointProfileName) { - return this.beginDeleteAsync(resourceGroupName, discoveredAssetEndpointProfileName).getSyncPoller(); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, - String discoveredAssetEndpointProfileName, Context context) { - return this.beginDeleteAsync(resourceGroupName, discoveredAssetEndpointProfileName, context).getSyncPoller(); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String discoveredAssetEndpointProfileName) { - return beginDeleteAsync(resourceGroupName, discoveredAssetEndpointProfileName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String discoveredAssetEndpointProfileName, - Context context) { - return beginDeleteAsync(resourceGroupName, discoveredAssetEndpointProfileName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String discoveredAssetEndpointProfileName) { - deleteAsync(resourceGroupName, discoveredAssetEndpointProfileName).block(); - } - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String discoveredAssetEndpointProfileName, Context context) { - deleteAsync(resourceGroupName, discoveredAssetEndpointProfileName, context).block(); - } - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, - Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfilesImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfilesImpl.java deleted file mode 100644 index 34c7bc45c5df..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetEndpointProfilesImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.deviceregistry.fluent.DiscoveredAssetEndpointProfilesClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetEndpointProfileInner; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfile; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfiles; - -public final class DiscoveredAssetEndpointProfilesImpl implements DiscoveredAssetEndpointProfiles { - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredAssetEndpointProfilesImpl.class); - - private final DiscoveredAssetEndpointProfilesClient innerClient; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - public DiscoveredAssetEndpointProfilesImpl(DiscoveredAssetEndpointProfilesClient innerClient, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, - String discoveredAssetEndpointProfileName, Context context) { - Response inner = this.serviceClient() - .getByResourceGroupWithResponse(resourceGroupName, discoveredAssetEndpointProfileName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiscoveredAssetEndpointProfileImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DiscoveredAssetEndpointProfile getByResourceGroup(String resourceGroupName, - String discoveredAssetEndpointProfileName) { - DiscoveredAssetEndpointProfileInner inner - = this.serviceClient().getByResourceGroup(resourceGroupName, discoveredAssetEndpointProfileName); - if (inner != null) { - return new DiscoveredAssetEndpointProfileImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String discoveredAssetEndpointProfileName) { - this.serviceClient().delete(resourceGroupName, discoveredAssetEndpointProfileName); - } - - public void delete(String resourceGroupName, String discoveredAssetEndpointProfileName, Context context) { - this.serviceClient().delete(resourceGroupName, discoveredAssetEndpointProfileName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new DiscoveredAssetEndpointProfileImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, - Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new DiscoveredAssetEndpointProfileImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new DiscoveredAssetEndpointProfileImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new DiscoveredAssetEndpointProfileImpl(inner1, this.manager())); - } - - public DiscoveredAssetEndpointProfile getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String discoveredAssetEndpointProfileName - = ResourceManagerUtils.getValueFromIdByName(id, "discoveredAssetEndpointProfiles"); - if (discoveredAssetEndpointProfileName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The resource ID '%s' is not valid. Missing path segment 'discoveredAssetEndpointProfiles'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, discoveredAssetEndpointProfileName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String discoveredAssetEndpointProfileName - = ResourceManagerUtils.getValueFromIdByName(id, "discoveredAssetEndpointProfiles"); - if (discoveredAssetEndpointProfileName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The resource ID '%s' is not valid. Missing path segment 'discoveredAssetEndpointProfiles'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, discoveredAssetEndpointProfileName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String discoveredAssetEndpointProfileName - = ResourceManagerUtils.getValueFromIdByName(id, "discoveredAssetEndpointProfiles"); - if (discoveredAssetEndpointProfileName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The resource ID '%s' is not valid. Missing path segment 'discoveredAssetEndpointProfiles'.", id))); - } - this.delete(resourceGroupName, discoveredAssetEndpointProfileName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String discoveredAssetEndpointProfileName - = ResourceManagerUtils.getValueFromIdByName(id, "discoveredAssetEndpointProfiles"); - if (discoveredAssetEndpointProfileName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( - "The resource ID '%s' is not valid. Missing path segment 'discoveredAssetEndpointProfiles'.", id))); - } - this.delete(resourceGroupName, discoveredAssetEndpointProfileName, context); - } - - private DiscoveredAssetEndpointProfilesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - public DiscoveredAssetEndpointProfileImpl define(String name) { - return new DiscoveredAssetEndpointProfileImpl(name, this.manager()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetImpl.java deleted file mode 100644 index 06cf3ec63c15..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetImpl.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetInner; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAsset; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetProperties; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetUpdate; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetUpdateProperties; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import java.util.Collections; -import java.util.Map; - -public final class DiscoveredAssetImpl implements DiscoveredAsset, DiscoveredAsset.Definition, DiscoveredAsset.Update { - private DiscoveredAssetInner innerObject; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public DiscoveredAssetProperties properties() { - return this.innerModel().properties(); - } - - public ExtendedLocation extendedLocation() { - return this.innerModel().extendedLocation(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public DiscoveredAssetInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String discoveredAssetName; - - private DiscoveredAssetUpdate updateProperties; - - public DiscoveredAssetImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public DiscoveredAsset create() { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssets() - .createOrReplace(resourceGroupName, discoveredAssetName, this.innerModel(), Context.NONE); - return this; - } - - public DiscoveredAsset create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssets() - .createOrReplace(resourceGroupName, discoveredAssetName, this.innerModel(), context); - return this; - } - - DiscoveredAssetImpl(String name, com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = new DiscoveredAssetInner(); - this.serviceManager = serviceManager; - this.discoveredAssetName = name; - } - - public DiscoveredAssetImpl update() { - this.updateProperties = new DiscoveredAssetUpdate(); - return this; - } - - public DiscoveredAsset apply() { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssets() - .update(resourceGroupName, discoveredAssetName, updateProperties, Context.NONE); - return this; - } - - public DiscoveredAsset apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssets() - .update(resourceGroupName, discoveredAssetName, updateProperties, context); - return this; - } - - DiscoveredAssetImpl(DiscoveredAssetInner innerObject, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.discoveredAssetName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "discoveredAssets"); - } - - public DiscoveredAsset refresh() { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssets() - .getByResourceGroupWithResponse(resourceGroupName, discoveredAssetName, Context.NONE) - .getValue(); - return this; - } - - public DiscoveredAsset refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getDiscoveredAssets() - .getByResourceGroupWithResponse(resourceGroupName, discoveredAssetName, context) - .getValue(); - return this; - } - - public DiscoveredAssetImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public DiscoveredAssetImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public DiscoveredAssetImpl withExtendedLocation(ExtendedLocation extendedLocation) { - this.innerModel().withExtendedLocation(extendedLocation); - return this; - } - - public DiscoveredAssetImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateProperties.withTags(tags); - return this; - } - } - - public DiscoveredAssetImpl withProperties(DiscoveredAssetProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public DiscoveredAssetImpl withProperties(DiscoveredAssetUpdateProperties properties) { - this.updateProperties.withProperties(properties); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetsClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetsClientImpl.java deleted file mode 100644 index 17a821c7e2dd..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetsClientImpl.java +++ /dev/null @@ -1,1296 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.deviceregistry.fluent.DiscoveredAssetsClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetInner; -import com.azure.resourcemanager.deviceregistry.implementation.models.DiscoveredAssetListResult; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in DiscoveredAssetsClient. - */ -public final class DiscoveredAssetsClientImpl implements DiscoveredAssetsClient { - /** - * The proxy service used to perform REST calls. - */ - private final DiscoveredAssetsService service; - - /** - * The service client containing this operation class. - */ - private final DeviceRegistryManagementClientImpl client; - - /** - * Initializes an instance of DiscoveredAssetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DiscoveredAssetsClientImpl(DeviceRegistryManagementClientImpl client) { - this.service - = RestProxy.create(DiscoveredAssetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for DeviceRegistryManagementClientDiscoveredAssets to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "DeviceRegistryManage") - public interface DiscoveredAssetsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("discoveredAssetName") String discoveredAssetName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("discoveredAssetName") String discoveredAssetName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DiscoveredAssetInner resource, Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("discoveredAssetName") String discoveredAssetName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") DiscoveredAssetUpdate properties, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("discoveredAssetName") String discoveredAssetName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String discoveredAssetName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter discoveredAssetName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String discoveredAssetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter discoveredAssetName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetName, accept, context); - } - - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String discoveredAssetName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, discoveredAssetName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String discoveredAssetName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, discoveredAssetName, context).block(); - } - - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetInner getByResourceGroup(String resourceGroupName, String discoveredAssetName) { - return getByResourceGroupWithResponse(resourceGroupName, discoveredAssetName, Context.NONE).getValue(); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter discoveredAssetName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetName, contentType, accept, resource, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter discoveredAssetName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetName, contentType, accept, resource, - context); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiscoveredAssetInner> - beginCreateOrReplaceAsync(String resourceGroupName, String discoveredAssetName, DiscoveredAssetInner resource) { - Mono>> mono - = createOrReplaceWithResponseAsync(resourceGroupName, discoveredAssetName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DiscoveredAssetInner.class, DiscoveredAssetInner.class, this.client.getContext()); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiscoveredAssetInner> beginCreateOrReplaceAsync( - String resourceGroupName, String discoveredAssetName, DiscoveredAssetInner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrReplaceWithResponseAsync(resourceGroupName, discoveredAssetName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DiscoveredAssetInner.class, DiscoveredAssetInner.class, context); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiscoveredAssetInner> - beginCreateOrReplace(String resourceGroupName, String discoveredAssetName, DiscoveredAssetInner resource) { - return this.beginCreateOrReplaceAsync(resourceGroupName, discoveredAssetName, resource).getSyncPoller(); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiscoveredAssetInner> beginCreateOrReplace( - String resourceGroupName, String discoveredAssetName, DiscoveredAssetInner resource, Context context) { - return this.beginCreateOrReplaceAsync(resourceGroupName, discoveredAssetName, resource, context) - .getSyncPoller(); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetInner resource) { - return beginCreateOrReplaceAsync(resourceGroupName, discoveredAssetName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetInner resource, Context context) { - return beginCreateOrReplaceAsync(resourceGroupName, discoveredAssetName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetInner createOrReplace(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetInner resource) { - return createOrReplaceAsync(resourceGroupName, discoveredAssetName, resource).block(); - } - - /** - * Create a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetInner createOrReplace(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetInner resource, Context context) { - return createOrReplaceAsync(resourceGroupName, discoveredAssetName, resource, context).block(); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter discoveredAssetName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetName, contentType, accept, - properties, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter discoveredAssetName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, discoveredAssetName, contentType, accept, properties, context); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiscoveredAssetInner> - beginUpdateAsync(String resourceGroupName, String discoveredAssetName, DiscoveredAssetUpdate properties) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, discoveredAssetName, properties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DiscoveredAssetInner.class, DiscoveredAssetInner.class, this.client.getContext()); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DiscoveredAssetInner> beginUpdateAsync( - String resourceGroupName, String discoveredAssetName, DiscoveredAssetUpdate properties, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, discoveredAssetName, properties, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - DiscoveredAssetInner.class, DiscoveredAssetInner.class, context); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiscoveredAssetInner> beginUpdate(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetUpdate properties) { - return this.beginUpdateAsync(resourceGroupName, discoveredAssetName, properties).getSyncPoller(); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DiscoveredAssetInner> beginUpdate(String resourceGroupName, - String discoveredAssetName, DiscoveredAssetUpdate properties, Context context) { - return this.beginUpdateAsync(resourceGroupName, discoveredAssetName, properties, context).getSyncPoller(); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetUpdate properties) { - return beginUpdateAsync(resourceGroupName, discoveredAssetName, properties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetUpdate properties, Context context) { - return beginUpdateAsync(resourceGroupName, discoveredAssetName, properties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetInner update(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetUpdate properties) { - return updateAsync(resourceGroupName, discoveredAssetName, properties).block(); - } - - /** - * Update a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return discovered Asset definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredAssetInner update(String resourceGroupName, String discoveredAssetName, - DiscoveredAssetUpdate properties, Context context) { - return updateAsync(resourceGroupName, discoveredAssetName, properties, context).block(); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String discoveredAssetName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter discoveredAssetName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, discoveredAssetName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String discoveredAssetName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (discoveredAssetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter discoveredAssetName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, discoveredAssetName, accept, context); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String discoveredAssetName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, discoveredAssetName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String discoveredAssetName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, discoveredAssetName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String discoveredAssetName) { - return this.beginDeleteAsync(resourceGroupName, discoveredAssetName).getSyncPoller(); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String discoveredAssetName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, discoveredAssetName, context).getSyncPoller(); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String discoveredAssetName) { - return beginDeleteAsync(resourceGroupName, discoveredAssetName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String discoveredAssetName, Context context) { - return beginDeleteAsync(resourceGroupName, discoveredAssetName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String discoveredAssetName) { - deleteAsync(resourceGroupName, discoveredAssetName).block(); - } - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String discoveredAssetName, Context context) { - deleteAsync(resourceGroupName, discoveredAssetName, context).block(); - } - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetsImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetsImpl.java deleted file mode 100644 index e4c26f8f15db..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/DiscoveredAssetsImpl.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.deviceregistry.fluent.DiscoveredAssetsClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetInner; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAsset; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssets; - -public final class DiscoveredAssetsImpl implements DiscoveredAssets { - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredAssetsImpl.class); - - private final DiscoveredAssetsClient innerClient; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - public DiscoveredAssetsImpl(DiscoveredAssetsClient innerClient, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, - String discoveredAssetName, Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, discoveredAssetName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DiscoveredAssetImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DiscoveredAsset getByResourceGroup(String resourceGroupName, String discoveredAssetName) { - DiscoveredAssetInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, discoveredAssetName); - if (inner != null) { - return new DiscoveredAssetImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String discoveredAssetName) { - this.serviceClient().delete(resourceGroupName, discoveredAssetName); - } - - public void delete(String resourceGroupName, String discoveredAssetName, Context context) { - this.serviceClient().delete(resourceGroupName, discoveredAssetName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscoveredAssetImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscoveredAssetImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscoveredAssetImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DiscoveredAssetImpl(inner1, this.manager())); - } - - public DiscoveredAsset getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String discoveredAssetName = ResourceManagerUtils.getValueFromIdByName(id, "discoveredAssets"); - if (discoveredAssetName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'discoveredAssets'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, discoveredAssetName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String discoveredAssetName = ResourceManagerUtils.getValueFromIdByName(id, "discoveredAssets"); - if (discoveredAssetName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'discoveredAssets'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, discoveredAssetName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String discoveredAssetName = ResourceManagerUtils.getValueFromIdByName(id, "discoveredAssets"); - if (discoveredAssetName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'discoveredAssets'.", id))); - } - this.delete(resourceGroupName, discoveredAssetName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String discoveredAssetName = ResourceManagerUtils.getValueFromIdByName(id, "discoveredAssets"); - if (discoveredAssetName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'discoveredAssets'.", id))); - } - this.delete(resourceGroupName, discoveredAssetName, context); - } - - private DiscoveredAssetsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - public DiscoveredAssetImpl define(String name) { - return new DiscoveredAssetImpl(name, this.manager()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaImpl.java deleted file mode 100644 index 19245be6f64e..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaInner; -import com.azure.resourcemanager.deviceregistry.models.Schema; -import com.azure.resourcemanager.deviceregistry.models.SchemaProperties; - -public final class SchemaImpl implements Schema, Schema.Definition { - private SchemaInner innerObject; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - SchemaImpl(SchemaInner innerObject, com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SchemaProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SchemaInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String schemaRegistryName; - - private String schemaName; - - public SchemaImpl withExistingSchemaRegistry(String resourceGroupName, String schemaRegistryName) { - this.resourceGroupName = resourceGroupName; - this.schemaRegistryName = schemaRegistryName; - return this; - } - - public Schema create() { - this.innerObject = serviceManager.serviceClient() - .getSchemas() - .createOrReplaceWithResponse(resourceGroupName, schemaRegistryName, schemaName, this.innerModel(), - Context.NONE) - .getValue(); - return this; - } - - public Schema create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSchemas() - .createOrReplaceWithResponse(resourceGroupName, schemaRegistryName, schemaName, this.innerModel(), context) - .getValue(); - return this; - } - - SchemaImpl(String name, com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = new SchemaInner(); - this.serviceManager = serviceManager; - this.schemaName = name; - } - - public Schema refresh() { - this.innerObject = serviceManager.serviceClient() - .getSchemas() - .getWithResponse(resourceGroupName, schemaRegistryName, schemaName, Context.NONE) - .getValue(); - return this; - } - - public Schema refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSchemas() - .getWithResponse(resourceGroupName, schemaRegistryName, schemaName, context) - .getValue(); - return this; - } - - public SchemaImpl withProperties(SchemaProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistriesClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistriesClientImpl.java deleted file mode 100644 index 761f2767beb5..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistriesClientImpl.java +++ /dev/null @@ -1,1294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.deviceregistry.fluent.SchemaRegistriesClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaRegistryInner; -import com.azure.resourcemanager.deviceregistry.implementation.models.SchemaRegistryListResult; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdate; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SchemaRegistriesClient. - */ -public final class SchemaRegistriesClientImpl implements SchemaRegistriesClient { - /** - * The proxy service used to perform REST calls. - */ - private final SchemaRegistriesService service; - - /** - * The service client containing this operation class. - */ - private final DeviceRegistryManagementClientImpl client; - - /** - * Initializes an instance of SchemaRegistriesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SchemaRegistriesClientImpl(DeviceRegistryManagementClientImpl client) { - this.service - = RestProxy.create(SchemaRegistriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for DeviceRegistryManagementClientSchemaRegistries to be used by the - * proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "DeviceRegistryManage") - public interface SchemaRegistriesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") SchemaRegistryInner resource, - Context context); - - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") SchemaRegistryUpdate properties, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String schemaRegistryName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String schemaRegistryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, accept, context); - } - - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String schemaRegistryName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, schemaRegistryName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String schemaRegistryName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, schemaRegistryName, context).block(); - } - - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaRegistryInner getByResourceGroup(String resourceGroupName, String schemaRegistryName) { - return getByResourceGroupWithResponse(resourceGroupName, schemaRegistryName, Context.NONE).getValue(); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, - String schemaRegistryName, SchemaRegistryInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, contentType, accept, resource, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, - String schemaRegistryName, SchemaRegistryInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, contentType, accept, resource, - context); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SchemaRegistryInner> - beginCreateOrReplaceAsync(String resourceGroupName, String schemaRegistryName, SchemaRegistryInner resource) { - Mono>> mono - = createOrReplaceWithResponseAsync(resourceGroupName, schemaRegistryName, resource); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - SchemaRegistryInner.class, SchemaRegistryInner.class, this.client.getContext()); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SchemaRegistryInner> beginCreateOrReplaceAsync( - String resourceGroupName, String schemaRegistryName, SchemaRegistryInner resource, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrReplaceWithResponseAsync(resourceGroupName, schemaRegistryName, resource, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - SchemaRegistryInner.class, SchemaRegistryInner.class, context); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SchemaRegistryInner> - beginCreateOrReplace(String resourceGroupName, String schemaRegistryName, SchemaRegistryInner resource) { - return this.beginCreateOrReplaceAsync(resourceGroupName, schemaRegistryName, resource).getSyncPoller(); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SchemaRegistryInner> beginCreateOrReplace( - String resourceGroupName, String schemaRegistryName, SchemaRegistryInner resource, Context context) { - return this.beginCreateOrReplaceAsync(resourceGroupName, schemaRegistryName, resource, context).getSyncPoller(); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, String schemaRegistryName, - SchemaRegistryInner resource) { - return beginCreateOrReplaceAsync(resourceGroupName, schemaRegistryName, resource).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, String schemaRegistryName, - SchemaRegistryInner resource, Context context) { - return beginCreateOrReplaceAsync(resourceGroupName, schemaRegistryName, resource, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaRegistryInner createOrReplace(String resourceGroupName, String schemaRegistryName, - SchemaRegistryInner resource) { - return createOrReplaceAsync(resourceGroupName, schemaRegistryName, resource).block(); - } - - /** - * Create a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaRegistryInner createOrReplace(String resourceGroupName, String schemaRegistryName, - SchemaRegistryInner resource, Context context) { - return createOrReplaceAsync(resourceGroupName, schemaRegistryName, resource, context).block(); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String schemaRegistryName, SchemaRegistryUpdate properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, contentType, accept, properties, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, - String schemaRegistryName, SchemaRegistryUpdate properties, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, schemaRegistryName, contentType, accept, properties, context); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SchemaRegistryInner> beginUpdateAsync(String resourceGroupName, - String schemaRegistryName, SchemaRegistryUpdate properties) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, schemaRegistryName, properties); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - SchemaRegistryInner.class, SchemaRegistryInner.class, this.client.getContext()); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SchemaRegistryInner> beginUpdateAsync(String resourceGroupName, - String schemaRegistryName, SchemaRegistryUpdate properties, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, schemaRegistryName, properties, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - SchemaRegistryInner.class, SchemaRegistryInner.class, context); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SchemaRegistryInner> beginUpdate(String resourceGroupName, - String schemaRegistryName, SchemaRegistryUpdate properties) { - return this.beginUpdateAsync(resourceGroupName, schemaRegistryName, properties).getSyncPoller(); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of schema registry definition. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SchemaRegistryInner> beginUpdate(String resourceGroupName, - String schemaRegistryName, SchemaRegistryUpdate properties, Context context) { - return this.beginUpdateAsync(resourceGroupName, schemaRegistryName, properties, context).getSyncPoller(); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String schemaRegistryName, - SchemaRegistryUpdate properties) { - return beginUpdateAsync(resourceGroupName, schemaRegistryName, properties).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String schemaRegistryName, - SchemaRegistryUpdate properties, Context context) { - return beginUpdateAsync(resourceGroupName, schemaRegistryName, properties, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaRegistryInner update(String resourceGroupName, String schemaRegistryName, - SchemaRegistryUpdate properties) { - return updateAsync(resourceGroupName, schemaRegistryName, properties).block(); - } - - /** - * Update a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param properties The resource properties to be updated. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema registry definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaRegistryInner update(String resourceGroupName, String schemaRegistryName, - SchemaRegistryUpdate properties, Context context) { - return updateAsync(resourceGroupName, schemaRegistryName, properties, context).block(); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String schemaRegistryName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, - String schemaRegistryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, schemaRegistryName, accept, context); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String schemaRegistryName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, schemaRegistryName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String schemaRegistryName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, schemaRegistryName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String schemaRegistryName) { - return this.beginDeleteAsync(resourceGroupName, schemaRegistryName).getSyncPoller(); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String schemaRegistryName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, schemaRegistryName, context).getSyncPoller(); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String schemaRegistryName) { - return beginDeleteAsync(resourceGroupName, schemaRegistryName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String schemaRegistryName, Context context) { - return beginDeleteAsync(resourceGroupName, schemaRegistryName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String schemaRegistryName) { - deleteAsync(resourceGroupName, schemaRegistryName).block(); - } - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String schemaRegistryName, Context context) { - deleteAsync(resourceGroupName, schemaRegistryName, context).block(); - } - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List SchemaRegistry resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List SchemaRegistry resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List SchemaRegistry resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List SchemaRegistry resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List SchemaRegistry resources by subscription ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List SchemaRegistry resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistriesImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistriesImpl.java deleted file mode 100644 index b5aa03b8e1a1..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistriesImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.deviceregistry.fluent.SchemaRegistriesClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaRegistryInner; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistries; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistry; - -public final class SchemaRegistriesImpl implements SchemaRegistries { - private static final ClientLogger LOGGER = new ClientLogger(SchemaRegistriesImpl.class); - - private final SchemaRegistriesClient innerClient; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - public SchemaRegistriesImpl(SchemaRegistriesClient innerClient, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse(String resourceGroupName, String schemaRegistryName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, schemaRegistryName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SchemaRegistryImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SchemaRegistry getByResourceGroup(String resourceGroupName, String schemaRegistryName) { - SchemaRegistryInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, schemaRegistryName); - if (inner != null) { - return new SchemaRegistryImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String resourceGroupName, String schemaRegistryName) { - this.serviceClient().delete(resourceGroupName, schemaRegistryName); - } - - public void delete(String resourceGroupName, String schemaRegistryName, Context context) { - this.serviceClient().delete(resourceGroupName, schemaRegistryName, context); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SchemaRegistryImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SchemaRegistryImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SchemaRegistryImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SchemaRegistryImpl(inner1, this.manager())); - } - - public SchemaRegistry getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, schemaRegistryName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, schemaRegistryName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - this.delete(resourceGroupName, schemaRegistryName, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - this.delete(resourceGroupName, schemaRegistryName, context); - } - - private SchemaRegistriesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - public SchemaRegistryImpl define(String name) { - return new SchemaRegistryImpl(name, this.manager()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistryImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistryImpl.java deleted file mode 100644 index 91428a0ac6ee..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaRegistryImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaRegistryInner; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistry; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryProperties; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdate; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdateProperties; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentity; -import java.util.Collections; -import java.util.Map; - -public final class SchemaRegistryImpl implements SchemaRegistry, SchemaRegistry.Definition, SchemaRegistry.Update { - private SchemaRegistryInner innerObject; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SchemaRegistryProperties properties() { - return this.innerModel().properties(); - } - - public SystemAssignedServiceIdentity identity() { - return this.innerModel().identity(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public SchemaRegistryInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String schemaRegistryName; - - private SchemaRegistryUpdate updateProperties; - - public SchemaRegistryImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public SchemaRegistry create() { - this.innerObject = serviceManager.serviceClient() - .getSchemaRegistries() - .createOrReplace(resourceGroupName, schemaRegistryName, this.innerModel(), Context.NONE); - return this; - } - - public SchemaRegistry create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSchemaRegistries() - .createOrReplace(resourceGroupName, schemaRegistryName, this.innerModel(), context); - return this; - } - - SchemaRegistryImpl(String name, com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = new SchemaRegistryInner(); - this.serviceManager = serviceManager; - this.schemaRegistryName = name; - } - - public SchemaRegistryImpl update() { - this.updateProperties = new SchemaRegistryUpdate(); - return this; - } - - public SchemaRegistry apply() { - this.innerObject = serviceManager.serviceClient() - .getSchemaRegistries() - .update(resourceGroupName, schemaRegistryName, updateProperties, Context.NONE); - return this; - } - - public SchemaRegistry apply(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSchemaRegistries() - .update(resourceGroupName, schemaRegistryName, updateProperties, context); - return this; - } - - SchemaRegistryImpl(SchemaRegistryInner innerObject, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "schemaRegistries"); - } - - public SchemaRegistry refresh() { - this.innerObject = serviceManager.serviceClient() - .getSchemaRegistries() - .getByResourceGroupWithResponse(resourceGroupName, schemaRegistryName, Context.NONE) - .getValue(); - return this; - } - - public SchemaRegistry refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSchemaRegistries() - .getByResourceGroupWithResponse(resourceGroupName, schemaRegistryName, context) - .getValue(); - return this; - } - - public SchemaRegistryImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public SchemaRegistryImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public SchemaRegistryImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateProperties.withTags(tags); - return this; - } - } - - public SchemaRegistryImpl withProperties(SchemaRegistryProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - - public SchemaRegistryImpl withIdentity(SystemAssignedServiceIdentity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateProperties.withIdentity(identity); - return this; - } - } - - public SchemaRegistryImpl withProperties(SchemaRegistryUpdateProperties properties) { - this.updateProperties.withProperties(properties); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionImpl.java deleted file mode 100644 index 942a8c00390b..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaVersionInner; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersion; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersionProperties; - -public final class SchemaVersionImpl implements SchemaVersion, SchemaVersion.Definition { - private SchemaVersionInner innerObject; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - SchemaVersionImpl(SchemaVersionInner innerObject, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SchemaVersionProperties properties() { - return this.innerModel().properties(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public SchemaVersionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String schemaRegistryName; - - private String schemaName; - - private String schemaVersionName; - - public SchemaVersionImpl withExistingSchema(String resourceGroupName, String schemaRegistryName, - String schemaName) { - this.resourceGroupName = resourceGroupName; - this.schemaRegistryName = schemaRegistryName; - this.schemaName = schemaName; - return this; - } - - public SchemaVersion create() { - this.innerObject = serviceManager.serviceClient() - .getSchemaVersions() - .createOrReplaceWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SchemaVersion create(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSchemaVersions() - .createOrReplaceWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - this.innerModel(), context) - .getValue(); - return this; - } - - SchemaVersionImpl(String name, com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerObject = new SchemaVersionInner(); - this.serviceManager = serviceManager; - this.schemaVersionName = name; - } - - public SchemaVersion refresh() { - this.innerObject = serviceManager.serviceClient() - .getSchemaVersions() - .getWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, Context.NONE) - .getValue(); - return this; - } - - public SchemaVersion refresh(Context context) { - this.innerObject = serviceManager.serviceClient() - .getSchemaVersions() - .getWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, context) - .getValue(); - return this; - } - - public SchemaVersionImpl withProperties(SchemaVersionProperties properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionsClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionsClientImpl.java deleted file mode 100644 index d2adc087fef1..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionsClientImpl.java +++ /dev/null @@ -1,797 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.deviceregistry.fluent.SchemaVersionsClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaVersionInner; -import com.azure.resourcemanager.deviceregistry.implementation.models.SchemaVersionListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SchemaVersionsClient. - */ -public final class SchemaVersionsClientImpl implements SchemaVersionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final SchemaVersionsService service; - - /** - * The service client containing this operation class. - */ - private final DeviceRegistryManagementClientImpl client; - - /** - * Initializes an instance of SchemaVersionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SchemaVersionsClientImpl(DeviceRegistryManagementClientImpl client) { - this.service - = RestProxy.create(SchemaVersionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for DeviceRegistryManagementClientSchemaVersions to be used by the proxy - * service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "DeviceRegistryManage") - public interface SchemaVersionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @PathParam("schemaName") String schemaName, - @PathParam("schemaVersionName") String schemaVersionName, @HeaderParam("Accept") String accept, - Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @PathParam("schemaName") String schemaName, - @PathParam("schemaVersionName") String schemaVersionName, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") SchemaVersionInner resource, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @PathParam("schemaName") String schemaName, - @PathParam("schemaVersionName") String schemaVersionName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySchema(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @PathParam("schemaName") String schemaName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySchemaNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - if (schemaVersionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaVersionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - if (schemaVersionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaVersionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, accept, context); - } - - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName) { - return getWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName, Context context) { - return getWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, context) - .block(); - } - - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaVersionInner get(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName) { - return getWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, Context.NONE) - .getValue(); - } - - /** - * Create a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema version's definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrReplaceWithResponseAsync(String resourceGroupName, - String schemaRegistryName, String schemaName, String schemaVersionName, SchemaVersionInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - if (schemaVersionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaVersionName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - contentType, accept, resource, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema version's definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrReplaceWithResponseAsync(String resourceGroupName, - String schemaRegistryName, String schemaName, String schemaVersionName, SchemaVersionInner resource, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - if (schemaVersionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaVersionName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - contentType, accept, resource, context); - } - - /** - * Create a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema version's definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName, SchemaVersionInner resource) { - return createOrReplaceWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - resource).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema version's definition along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceWithResponse(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName, SchemaVersionInner resource, Context context) { - return createOrReplaceWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - resource, context).block(); - } - - /** - * Create a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema version's definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaVersionInner createOrReplace(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName, SchemaVersionInner resource) { - return createOrReplaceWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - resource, Context.NONE).getValue(); - } - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - if (schemaVersionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaVersionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - if (schemaVersionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaVersionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, accept, context); - } - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName) { - return deleteWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, context) - .block(); - } - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName) { - deleteWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, Context.NONE); - } - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySchemaSinglePageAsync(String resourceGroupName, - String schemaRegistryName, String schemaName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySchema(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySchemaSinglePageAsync(String resourceGroupName, - String schemaRegistryName, String schemaName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySchema(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, schemaRegistryName, schemaName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySchemaAsync(String resourceGroupName, String schemaRegistryName, - String schemaName) { - return new PagedFlux<>(() -> listBySchemaSinglePageAsync(resourceGroupName, schemaRegistryName, schemaName), - nextLink -> listBySchemaNextSinglePageAsync(nextLink)); - } - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySchemaAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, Context context) { - return new PagedFlux<>( - () -> listBySchemaSinglePageAsync(resourceGroupName, schemaRegistryName, schemaName, context), - nextLink -> listBySchemaNextSinglePageAsync(nextLink, context)); - } - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySchema(String resourceGroupName, String schemaRegistryName, - String schemaName) { - return new PagedIterable<>(listBySchemaAsync(resourceGroupName, schemaRegistryName, schemaName)); - } - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySchema(String resourceGroupName, String schemaRegistryName, - String schemaName, Context context) { - return new PagedIterable<>(listBySchemaAsync(resourceGroupName, schemaRegistryName, schemaName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySchemaNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySchemaNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySchemaNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySchemaNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionsImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionsImpl.java deleted file mode 100644 index cd010688dbf6..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemaVersionsImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.deviceregistry.fluent.SchemaVersionsClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaVersionInner; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersion; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersions; - -public final class SchemaVersionsImpl implements SchemaVersions { - private static final ClientLogger LOGGER = new ClientLogger(SchemaVersionsImpl.class); - - private final SchemaVersionsClient innerClient; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - public SchemaVersionsImpl(SchemaVersionsClient innerClient, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String schemaRegistryName, - String schemaName, String schemaVersionName, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SchemaVersionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SchemaVersion get(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName) { - SchemaVersionInner inner - = this.serviceClient().get(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); - if (inner != null) { - return new SchemaVersionImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, context); - } - - public void delete(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName) { - this.serviceClient().delete(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName); - } - - public PagedIterable listBySchema(String resourceGroupName, String schemaRegistryName, - String schemaName) { - PagedIterable inner - = this.serviceClient().listBySchema(resourceGroupName, schemaRegistryName, schemaName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SchemaVersionImpl(inner1, this.manager())); - } - - public PagedIterable listBySchema(String resourceGroupName, String schemaRegistryName, - String schemaName, Context context) { - PagedIterable inner - = this.serviceClient().listBySchema(resourceGroupName, schemaRegistryName, schemaName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SchemaVersionImpl(inner1, this.manager())); - } - - public SchemaVersion getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - String schemaName = ResourceManagerUtils.getValueFromIdByName(id, "schemas"); - if (schemaName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); - } - String schemaVersionName = ResourceManagerUtils.getValueFromIdByName(id, "schemaVersions"); - if (schemaVersionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaVersions'.", id))); - } - return this.getWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - String schemaName = ResourceManagerUtils.getValueFromIdByName(id, "schemas"); - if (schemaName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); - } - String schemaVersionName = ResourceManagerUtils.getValueFromIdByName(id, "schemaVersions"); - if (schemaVersionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaVersions'.", id))); - } - return this.getWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - String schemaName = ResourceManagerUtils.getValueFromIdByName(id, "schemas"); - if (schemaName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); - } - String schemaVersionName = ResourceManagerUtils.getValueFromIdByName(id, "schemaVersions"); - if (schemaVersionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaVersions'.", id))); - } - this.deleteWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - String schemaName = ResourceManagerUtils.getValueFromIdByName(id, "schemas"); - if (schemaName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); - } - String schemaVersionName = ResourceManagerUtils.getValueFromIdByName(id, "schemaVersions"); - if (schemaVersionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaVersions'.", id))); - } - return this.deleteWithResponse(resourceGroupName, schemaRegistryName, schemaName, schemaVersionName, context); - } - - private SchemaVersionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - public SchemaVersionImpl define(String name) { - return new SchemaVersionImpl(name, this.manager()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemasClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemasClientImpl.java deleted file mode 100644 index d678c0266990..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemasClientImpl.java +++ /dev/null @@ -1,731 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.deviceregistry.fluent.SchemasClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaInner; -import com.azure.resourcemanager.deviceregistry.implementation.models.SchemaListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in SchemasClient. - */ -public final class SchemasClientImpl implements SchemasClient { - /** - * The proxy service used to perform REST calls. - */ - private final SchemasService service; - - /** - * The service client containing this operation class. - */ - private final DeviceRegistryManagementClientImpl client; - - /** - * Initializes an instance of SchemasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SchemasClientImpl(DeviceRegistryManagementClientImpl client) { - this.service = RestProxy.create(SchemasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for DeviceRegistryManagementClientSchemas to be used by the proxy service - * to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "DeviceRegistryManage") - public interface SchemasService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @PathParam("schemaName") String schemaName, - @HeaderParam("Accept") String accept, Context context); - - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}") - @ExpectedResponses({ 200, 201 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrReplace(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @PathParam("schemaName") String schemaName, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") SchemaInner resource, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @PathParam("schemaName") String schemaName, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySchemaRegistry(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("schemaRegistryName") String schemaRegistryName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySchemaRegistryNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String schemaRegistryName, - String schemaName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, schemaRegistryName, schemaName, accept, context); - } - - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String schemaRegistryName, String schemaName) { - return getWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context) { - return getWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, context).block(); - } - - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaInner get(String resourceGroupName, String schemaRegistryName, String schemaName) { - return getWithResponse(resourceGroupName, schemaRegistryName, schemaName, Context.NONE).getValue(); - } - - /** - * Create a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrReplaceWithResponseAsync(String resourceGroupName, - String schemaRegistryName, String schemaName, SchemaInner resource) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, contentType, accept, - resource, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema definition along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrReplaceWithResponseAsync(String resourceGroupName, - String schemaRegistryName, String schemaName, SchemaInner resource, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - if (resource == null) { - return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); - } else { - resource.validate(); - } - final String contentType = "application/json"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, contentType, accept, - resource, context); - } - - /** - * Create a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrReplaceAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, SchemaInner resource) { - return createOrReplaceWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, resource) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param resource Resource create parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema definition along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrReplaceWithResponse(String resourceGroupName, String schemaRegistryName, - String schemaName, SchemaInner resource, Context context) { - return createOrReplaceWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, resource, context) - .block(); - } - - /** - * Create a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param resource Resource create parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return schema definition. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SchemaInner createOrReplace(String resourceGroupName, String schemaRegistryName, String schemaName, - SchemaInner resource) { - return createOrReplaceWithResponse(resourceGroupName, schemaRegistryName, schemaName, resource, Context.NONE) - .getValue(); - } - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String schemaRegistryName, - String schemaName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, schemaName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String schemaRegistryName, - String schemaName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - if (schemaName == null) { - return Mono.error(new IllegalArgumentException("Parameter schemaName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, schemaRegistryName, schemaName, accept, context); - } - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String schemaRegistryName, String schemaName) { - return deleteWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, schemaRegistryName, schemaName, context).block(); - } - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String schemaRegistryName, String schemaName) { - deleteWithResponse(resourceGroupName, schemaRegistryName, schemaName, Context.NONE); - } - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySchemaRegistrySinglePageAsync(String resourceGroupName, - String schemaRegistryName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBySchemaRegistry(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySchemaRegistrySinglePageAsync(String resourceGroupName, - String schemaRegistryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (schemaRegistryName == null) { - return Mono - .error(new IllegalArgumentException("Parameter schemaRegistryName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySchemaRegistry(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, schemaRegistryName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySchemaRegistryAsync(String resourceGroupName, String schemaRegistryName) { - return new PagedFlux<>(() -> listBySchemaRegistrySinglePageAsync(resourceGroupName, schemaRegistryName), - nextLink -> listBySchemaRegistryNextSinglePageAsync(nextLink)); - } - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySchemaRegistryAsync(String resourceGroupName, String schemaRegistryName, - Context context) { - return new PagedFlux<>( - () -> listBySchemaRegistrySinglePageAsync(resourceGroupName, schemaRegistryName, context), - nextLink -> listBySchemaRegistryNextSinglePageAsync(nextLink, context)); - } - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySchemaRegistry(String resourceGroupName, String schemaRegistryName) { - return new PagedIterable<>(listBySchemaRegistryAsync(resourceGroupName, schemaRegistryName)); - } - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySchemaRegistry(String resourceGroupName, String schemaRegistryName, - Context context) { - return new PagedIterable<>(listBySchemaRegistryAsync(resourceGroupName, schemaRegistryName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySchemaRegistryNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySchemaRegistryNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySchemaRegistryNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySchemaRegistryNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemasImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemasImpl.java deleted file mode 100644 index 1ab0e703460f..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/SchemasImpl.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.deviceregistry.fluent.SchemasClient; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaInner; -import com.azure.resourcemanager.deviceregistry.models.Schema; -import com.azure.resourcemanager.deviceregistry.models.Schemas; - -public final class SchemasImpl implements Schemas { - private static final ClientLogger LOGGER = new ClientLogger(SchemasImpl.class); - - private final SchemasClient innerClient; - - private final com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager; - - public SchemasImpl(SchemasClient innerClient, - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, schemaRegistryName, schemaName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SchemaImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Schema get(String resourceGroupName, String schemaRegistryName, String schemaName) { - SchemaInner inner = this.serviceClient().get(resourceGroupName, schemaRegistryName, schemaName); - if (inner != null) { - return new SchemaImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, schemaRegistryName, schemaName, context); - } - - public void delete(String resourceGroupName, String schemaRegistryName, String schemaName) { - this.serviceClient().delete(resourceGroupName, schemaRegistryName, schemaName); - } - - public PagedIterable listBySchemaRegistry(String resourceGroupName, String schemaRegistryName) { - PagedIterable inner - = this.serviceClient().listBySchemaRegistry(resourceGroupName, schemaRegistryName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SchemaImpl(inner1, this.manager())); - } - - public PagedIterable listBySchemaRegistry(String resourceGroupName, String schemaRegistryName, - Context context) { - PagedIterable inner - = this.serviceClient().listBySchemaRegistry(resourceGroupName, schemaRegistryName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SchemaImpl(inner1, this.manager())); - } - - public Schema getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - String schemaName = ResourceManagerUtils.getValueFromIdByName(id, "schemas"); - if (schemaName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); - } - return this.getWithResponse(resourceGroupName, schemaRegistryName, schemaName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - String schemaName = ResourceManagerUtils.getValueFromIdByName(id, "schemas"); - if (schemaName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); - } - return this.getWithResponse(resourceGroupName, schemaRegistryName, schemaName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - String schemaName = ResourceManagerUtils.getValueFromIdByName(id, "schemas"); - if (schemaName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); - } - this.deleteWithResponse(resourceGroupName, schemaRegistryName, schemaName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String schemaRegistryName = ResourceManagerUtils.getValueFromIdByName(id, "schemaRegistries"); - if (schemaRegistryName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemaRegistries'.", id))); - } - String schemaName = ResourceManagerUtils.getValueFromIdByName(id, "schemas"); - if (schemaName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'schemas'.", id))); - } - return this.deleteWithResponse(resourceGroupName, schemaRegistryName, schemaName, context); - } - - private SchemasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager() { - return this.serviceManager; - } - - public SchemaImpl define(String name) { - return new SchemaImpl(name, this.manager()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/DiscoveredAssetEndpointProfileListResult.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/DiscoveredAssetEndpointProfileListResult.java deleted file mode 100644 index ab54f80a63f3..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/DiscoveredAssetEndpointProfileListResult.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetEndpointProfileInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a DiscoveredAssetEndpointProfile list operation. - */ -@Immutable -public final class DiscoveredAssetEndpointProfileListResult - implements JsonSerializable { - /* - * The DiscoveredAssetEndpointProfile items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of DiscoveredAssetEndpointProfileListResult class. - */ - private DiscoveredAssetEndpointProfileListResult() { - } - - /** - * Get the value property: The DiscoveredAssetEndpointProfile items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property value in model DiscoveredAssetEndpointProfileListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredAssetEndpointProfileListResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetEndpointProfileListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetEndpointProfileListResult if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredAssetEndpointProfileListResult. - */ - public static DiscoveredAssetEndpointProfileListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetEndpointProfileListResult deserializedDiscoveredAssetEndpointProfileListResult - = new DiscoveredAssetEndpointProfileListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DiscoveredAssetEndpointProfileInner.fromJson(reader1)); - deserializedDiscoveredAssetEndpointProfileListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetEndpointProfileListResult; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/DiscoveredAssetListResult.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/DiscoveredAssetListResult.java deleted file mode 100644 index bb97da2021d3..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/DiscoveredAssetListResult.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a DiscoveredAsset list operation. - */ -@Immutable -public final class DiscoveredAssetListResult implements JsonSerializable { - /* - * The DiscoveredAsset items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of DiscoveredAssetListResult class. - */ - private DiscoveredAssetListResult() { - } - - /** - * Get the value property: The DiscoveredAsset items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property value in model DiscoveredAssetListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredAssetListResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetListResult if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredAssetListResult. - */ - public static DiscoveredAssetListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetListResult deserializedDiscoveredAssetListResult = new DiscoveredAssetListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> DiscoveredAssetInner.fromJson(reader1)); - deserializedDiscoveredAssetListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedDiscoveredAssetListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetListResult; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaListResult.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaListResult.java deleted file mode 100644 index a32b045693cf..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaListResult.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a Schema list operation. - */ -@Immutable -public final class SchemaListResult implements JsonSerializable { - /* - * The Schema items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SchemaListResult class. - */ - private SchemaListResult() { - } - - /** - * Get the value property: The Schema items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model SchemaListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SchemaListResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaListResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaListResult. - */ - public static SchemaListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaListResult deserializedSchemaListResult = new SchemaListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SchemaInner.fromJson(reader1)); - deserializedSchemaListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSchemaListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaListResult; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaRegistryListResult.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaRegistryListResult.java deleted file mode 100644 index 550f36d7844a..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaRegistryListResult.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaRegistryInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a SchemaRegistry list operation. - */ -@Immutable -public final class SchemaRegistryListResult implements JsonSerializable { - /* - * The SchemaRegistry items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SchemaRegistryListResult class. - */ - private SchemaRegistryListResult() { - } - - /** - * Get the value property: The SchemaRegistry items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model SchemaRegistryListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SchemaRegistryListResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaRegistryListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaRegistryListResult if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaRegistryListResult. - */ - public static SchemaRegistryListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaRegistryListResult deserializedSchemaRegistryListResult = new SchemaRegistryListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> SchemaRegistryInner.fromJson(reader1)); - deserializedSchemaRegistryListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSchemaRegistryListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaRegistryListResult; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaVersionListResult.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaVersionListResult.java deleted file mode 100644 index f90715495873..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/models/SchemaVersionListResult.java +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.implementation.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaVersionInner; -import java.io.IOException; -import java.util.List; - -/** - * The response of a SchemaVersion list operation. - */ -@Immutable -public final class SchemaVersionListResult implements JsonSerializable { - /* - * The SchemaVersion items on this page - */ - private List value; - - /* - * The link to the next page of items - */ - private String nextLink; - - /** - * Creates an instance of SchemaVersionListResult class. - */ - private SchemaVersionListResult() { - } - - /** - * Get the value property: The SchemaVersion items on this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link to the next page of items. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model SchemaVersionListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SchemaVersionListResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaVersionListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaVersionListResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaVersionListResult. - */ - public static SchemaVersionListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaVersionListResult deserializedSchemaVersionListResult = new SchemaVersionListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SchemaVersionInner.fromJson(reader1)); - deserializedSchemaVersionListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSchemaVersionListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaVersionListResult; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAsset.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAsset.java deleted file mode 100644 index 8f8524780878..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAsset.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetInner; -import java.util.Map; - -/** - * An immutable client-side representation of DiscoveredAsset. - */ -public interface DiscoveredAsset { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - DiscoveredAssetProperties properties(); - - /** - * Gets the extendedLocation property: The extended location. - * - * @return the extendedLocation value. - */ - ExtendedLocation extendedLocation(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetInner object. - * - * @return the inner object. - */ - DiscoveredAssetInner innerModel(); - - /** - * The entirety of the DiscoveredAsset definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCreate { - } - - /** - * The DiscoveredAsset definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the DiscoveredAsset definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the DiscoveredAsset definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - - /** - * The stage of the DiscoveredAsset definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithExtendedLocation withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the DiscoveredAsset definition allowing to specify extendedLocation. - */ - interface WithExtendedLocation { - /** - * Specifies the extendedLocation property: The extended location.. - * - * @param extendedLocation The extended location. - * @return the next definition stage. - */ - WithCreate withExtendedLocation(ExtendedLocation extendedLocation); - } - - /** - * The stage of the DiscoveredAsset definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - DiscoveredAsset create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - DiscoveredAsset create(Context context); - } - - /** - * The stage of the DiscoveredAsset definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the DiscoveredAsset definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The resource-specific properties for this resource.. - * - * @param properties The resource-specific properties for this resource. - * @return the next definition stage. - */ - WithCreate withProperties(DiscoveredAssetProperties properties); - } - } - - /** - * Begins update for the DiscoveredAsset resource. - * - * @return the stage of resource update. - */ - DiscoveredAsset.Update update(); - - /** - * The template for DiscoveredAsset update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - DiscoveredAsset apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - DiscoveredAsset apply(Context context); - } - - /** - * The DiscoveredAsset update stages. - */ - interface UpdateStages { - /** - * The stage of the DiscoveredAsset update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the DiscoveredAsset update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The resource-specific properties for this resource.. - * - * @param properties The resource-specific properties for this resource. - * @return the next definition stage. - */ - Update withProperties(DiscoveredAssetUpdateProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - DiscoveredAsset refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - DiscoveredAsset refresh(Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfile.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfile.java deleted file mode 100644 index ae0646d90b83..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfile.java +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetEndpointProfileInner; -import java.util.Map; - -/** - * An immutable client-side representation of DiscoveredAssetEndpointProfile. - */ -public interface DiscoveredAssetEndpointProfile { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - DiscoveredAssetEndpointProfileProperties properties(); - - /** - * Gets the extendedLocation property: The extended location. - * - * @return the extendedLocation value. - */ - ExtendedLocation extendedLocation(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetEndpointProfileInner object. - * - * @return the inner object. - */ - DiscoveredAssetEndpointProfileInner innerModel(); - - /** - * The entirety of the DiscoveredAssetEndpointProfile definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithExtendedLocation, DefinitionStages.WithCreate { - } - - /** - * The DiscoveredAssetEndpointProfile definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the DiscoveredAssetEndpointProfile definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the DiscoveredAssetEndpointProfile definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - - /** - * The stage of the DiscoveredAssetEndpointProfile definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithExtendedLocation withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the DiscoveredAssetEndpointProfile definition allowing to specify extendedLocation. - */ - interface WithExtendedLocation { - /** - * Specifies the extendedLocation property: The extended location.. - * - * @param extendedLocation The extended location. - * @return the next definition stage. - */ - WithCreate withExtendedLocation(ExtendedLocation extendedLocation); - } - - /** - * The stage of the DiscoveredAssetEndpointProfile definition which contains all the minimum required properties - * for the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - DiscoveredAssetEndpointProfile create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - DiscoveredAssetEndpointProfile create(Context context); - } - - /** - * The stage of the DiscoveredAssetEndpointProfile definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the DiscoveredAssetEndpointProfile definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The resource-specific properties for this resource.. - * - * @param properties The resource-specific properties for this resource. - * @return the next definition stage. - */ - WithCreate withProperties(DiscoveredAssetEndpointProfileProperties properties); - } - } - - /** - * Begins update for the DiscoveredAssetEndpointProfile resource. - * - * @return the stage of resource update. - */ - DiscoveredAssetEndpointProfile.Update update(); - - /** - * The template for DiscoveredAssetEndpointProfile update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - DiscoveredAssetEndpointProfile apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - DiscoveredAssetEndpointProfile apply(Context context); - } - - /** - * The DiscoveredAssetEndpointProfile update stages. - */ - interface UpdateStages { - /** - * The stage of the DiscoveredAssetEndpointProfile update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the DiscoveredAssetEndpointProfile update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The resource-specific properties for this resource.. - * - * @param properties The resource-specific properties for this resource. - * @return the next definition stage. - */ - Update withProperties(DiscoveredAssetEndpointProfileUpdateProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - DiscoveredAssetEndpointProfile refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - DiscoveredAssetEndpointProfile refresh(Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileProperties.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileProperties.java deleted file mode 100644 index d6df4e63298d..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileProperties.java +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Defines the Discovered Asset Endpoint Profile properties. - */ -@Fluent -public final class DiscoveredAssetEndpointProfileProperties - implements JsonSerializable { - /* - * The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the - * targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector - * type specific configuration. - */ - private String targetAddress; - - /* - * Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - */ - private String additionalConfiguration; - - /* - * List of supported authentication methods supported by the target server. - */ - private List supportedAuthenticationMethods; - - /* - * Defines the configuration for the connector type that is being used with the endpoint profile. - */ - private String endpointProfileType; - - /* - * Identifier used to detect changes in the asset endpoint profile. - */ - private String discoveryId; - - /* - * An integer that is incremented each time the resource is modified. - */ - private long version; - - /* - * Provisioning state of the resource. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of DiscoveredAssetEndpointProfileProperties class. - */ - public DiscoveredAssetEndpointProfileProperties() { - } - - /** - * Get the targetAddress property: The local valid URI specifying the network address/DNS name of a southbound - * device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration - * field holds further connector type specific configuration. - * - * @return the targetAddress value. - */ - public String targetAddress() { - return this.targetAddress; - } - - /** - * Set the targetAddress property: The local valid URI specifying the network address/DNS name of a southbound - * device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration - * field holds further connector type specific configuration. - * - * @param targetAddress the targetAddress value to set. - * @return the DiscoveredAssetEndpointProfileProperties object itself. - */ - public DiscoveredAssetEndpointProfileProperties withTargetAddress(String targetAddress) { - this.targetAddress = targetAddress; - return this; - } - - /** - * Get the additionalConfiguration property: Stringified JSON that contains connectivity type specific further - * configuration (e.g. OPC UA, Modbus, ONVIF). - * - * @return the additionalConfiguration value. - */ - public String additionalConfiguration() { - return this.additionalConfiguration; - } - - /** - * Set the additionalConfiguration property: Stringified JSON that contains connectivity type specific further - * configuration (e.g. OPC UA, Modbus, ONVIF). - * - * @param additionalConfiguration the additionalConfiguration value to set. - * @return the DiscoveredAssetEndpointProfileProperties object itself. - */ - public DiscoveredAssetEndpointProfileProperties withAdditionalConfiguration(String additionalConfiguration) { - this.additionalConfiguration = additionalConfiguration; - return this; - } - - /** - * Get the supportedAuthenticationMethods property: List of supported authentication methods supported by the target - * server. - * - * @return the supportedAuthenticationMethods value. - */ - public List supportedAuthenticationMethods() { - return this.supportedAuthenticationMethods; - } - - /** - * Set the supportedAuthenticationMethods property: List of supported authentication methods supported by the target - * server. - * - * @param supportedAuthenticationMethods the supportedAuthenticationMethods value to set. - * @return the DiscoveredAssetEndpointProfileProperties object itself. - */ - public DiscoveredAssetEndpointProfileProperties - withSupportedAuthenticationMethods(List supportedAuthenticationMethods) { - this.supportedAuthenticationMethods = supportedAuthenticationMethods; - return this; - } - - /** - * Get the endpointProfileType property: Defines the configuration for the connector type that is being used with - * the endpoint profile. - * - * @return the endpointProfileType value. - */ - public String endpointProfileType() { - return this.endpointProfileType; - } - - /** - * Set the endpointProfileType property: Defines the configuration for the connector type that is being used with - * the endpoint profile. - * - * @param endpointProfileType the endpointProfileType value to set. - * @return the DiscoveredAssetEndpointProfileProperties object itself. - */ - public DiscoveredAssetEndpointProfileProperties withEndpointProfileType(String endpointProfileType) { - this.endpointProfileType = endpointProfileType; - return this; - } - - /** - * Get the discoveryId property: Identifier used to detect changes in the asset endpoint profile. - * - * @return the discoveryId value. - */ - public String discoveryId() { - return this.discoveryId; - } - - /** - * Set the discoveryId property: Identifier used to detect changes in the asset endpoint profile. - * - * @param discoveryId the discoveryId value to set. - * @return the DiscoveredAssetEndpointProfileProperties object itself. - */ - public DiscoveredAssetEndpointProfileProperties withDiscoveryId(String discoveryId) { - this.discoveryId = discoveryId; - return this; - } - - /** - * Get the version property: An integer that is incremented each time the resource is modified. - * - * @return the version value. - */ - public long version() { - return this.version; - } - - /** - * Set the version property: An integer that is incremented each time the resource is modified. - * - * @param version the version value to set. - * @return the DiscoveredAssetEndpointProfileProperties object itself. - */ - public DiscoveredAssetEndpointProfileProperties withVersion(long version) { - this.version = version; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targetAddress() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property targetAddress in model DiscoveredAssetEndpointProfileProperties")); - } - if (endpointProfileType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property endpointProfileType in model DiscoveredAssetEndpointProfileProperties")); - } - if (discoveryId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property discoveryId in model DiscoveredAssetEndpointProfileProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredAssetEndpointProfileProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("targetAddress", this.targetAddress); - jsonWriter.writeStringField("endpointProfileType", this.endpointProfileType); - jsonWriter.writeStringField("discoveryId", this.discoveryId); - jsonWriter.writeLongField("version", this.version); - jsonWriter.writeStringField("additionalConfiguration", this.additionalConfiguration); - jsonWriter.writeArrayField("supportedAuthenticationMethods", this.supportedAuthenticationMethods, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetEndpointProfileProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetEndpointProfileProperties if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredAssetEndpointProfileProperties. - */ - public static DiscoveredAssetEndpointProfileProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetEndpointProfileProperties deserializedDiscoveredAssetEndpointProfileProperties - = new DiscoveredAssetEndpointProfileProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("targetAddress".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileProperties.targetAddress = reader.getString(); - } else if ("endpointProfileType".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileProperties.endpointProfileType = reader.getString(); - } else if ("discoveryId".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileProperties.discoveryId = reader.getString(); - } else if ("version".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileProperties.version = reader.getLong(); - } else if ("additionalConfiguration".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileProperties.additionalConfiguration = reader.getString(); - } else if ("supportedAuthenticationMethods".equals(fieldName)) { - List supportedAuthenticationMethods - = reader.readArray(reader1 -> AuthenticationMethod.fromString(reader1.getString())); - deserializedDiscoveredAssetEndpointProfileProperties.supportedAuthenticationMethods - = supportedAuthenticationMethods; - } else if ("provisioningState".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetEndpointProfileProperties; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileUpdate.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileUpdate.java deleted file mode 100644 index 7391068cc552..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileUpdate.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * The type used for update operations of the DiscoveredAssetEndpointProfile. - */ -@Fluent -public final class DiscoveredAssetEndpointProfileUpdate - implements JsonSerializable { - /* - * Resource tags. - */ - private Map tags; - - /* - * The resource-specific properties for this resource. - */ - private DiscoveredAssetEndpointProfileUpdateProperties properties; - - /** - * Creates an instance of DiscoveredAssetEndpointProfileUpdate class. - */ - public DiscoveredAssetEndpointProfileUpdate() { - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the DiscoveredAssetEndpointProfileUpdate object itself. - */ - public DiscoveredAssetEndpointProfileUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public DiscoveredAssetEndpointProfileUpdateProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the DiscoveredAssetEndpointProfileUpdate object itself. - */ - public DiscoveredAssetEndpointProfileUpdate - withProperties(DiscoveredAssetEndpointProfileUpdateProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetEndpointProfileUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetEndpointProfileUpdate if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DiscoveredAssetEndpointProfileUpdate. - */ - public static DiscoveredAssetEndpointProfileUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetEndpointProfileUpdate deserializedDiscoveredAssetEndpointProfileUpdate - = new DiscoveredAssetEndpointProfileUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDiscoveredAssetEndpointProfileUpdate.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileUpdate.properties - = DiscoveredAssetEndpointProfileUpdateProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetEndpointProfileUpdate; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileUpdateProperties.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileUpdateProperties.java deleted file mode 100644 index 9fbf0c0410ff..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfileUpdateProperties.java +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The updatable properties of the DiscoveredAssetEndpointProfile. - */ -@Fluent -public final class DiscoveredAssetEndpointProfileUpdateProperties - implements JsonSerializable { - /* - * The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the - * targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector - * type specific configuration. - */ - private String targetAddress; - - /* - * Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). - */ - private String additionalConfiguration; - - /* - * List of supported authentication methods supported by the target server. - */ - private List supportedAuthenticationMethods; - - /* - * Defines the configuration for the connector type that is being used with the endpoint profile. - */ - private String endpointProfileType; - - /* - * Identifier used to detect changes in the asset endpoint profile. - */ - private String discoveryId; - - /* - * An integer that is incremented each time the resource is modified. - */ - private Long version; - - /** - * Creates an instance of DiscoveredAssetEndpointProfileUpdateProperties class. - */ - public DiscoveredAssetEndpointProfileUpdateProperties() { - } - - /** - * Get the targetAddress property: The local valid URI specifying the network address/DNS name of a southbound - * device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration - * field holds further connector type specific configuration. - * - * @return the targetAddress value. - */ - public String targetAddress() { - return this.targetAddress; - } - - /** - * Set the targetAddress property: The local valid URI specifying the network address/DNS name of a southbound - * device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration - * field holds further connector type specific configuration. - * - * @param targetAddress the targetAddress value to set. - * @return the DiscoveredAssetEndpointProfileUpdateProperties object itself. - */ - public DiscoveredAssetEndpointProfileUpdateProperties withTargetAddress(String targetAddress) { - this.targetAddress = targetAddress; - return this; - } - - /** - * Get the additionalConfiguration property: Stringified JSON that contains connectivity type specific further - * configuration (e.g. OPC UA, Modbus, ONVIF). - * - * @return the additionalConfiguration value. - */ - public String additionalConfiguration() { - return this.additionalConfiguration; - } - - /** - * Set the additionalConfiguration property: Stringified JSON that contains connectivity type specific further - * configuration (e.g. OPC UA, Modbus, ONVIF). - * - * @param additionalConfiguration the additionalConfiguration value to set. - * @return the DiscoveredAssetEndpointProfileUpdateProperties object itself. - */ - public DiscoveredAssetEndpointProfileUpdateProperties withAdditionalConfiguration(String additionalConfiguration) { - this.additionalConfiguration = additionalConfiguration; - return this; - } - - /** - * Get the supportedAuthenticationMethods property: List of supported authentication methods supported by the target - * server. - * - * @return the supportedAuthenticationMethods value. - */ - public List supportedAuthenticationMethods() { - return this.supportedAuthenticationMethods; - } - - /** - * Set the supportedAuthenticationMethods property: List of supported authentication methods supported by the target - * server. - * - * @param supportedAuthenticationMethods the supportedAuthenticationMethods value to set. - * @return the DiscoveredAssetEndpointProfileUpdateProperties object itself. - */ - public DiscoveredAssetEndpointProfileUpdateProperties - withSupportedAuthenticationMethods(List supportedAuthenticationMethods) { - this.supportedAuthenticationMethods = supportedAuthenticationMethods; - return this; - } - - /** - * Get the endpointProfileType property: Defines the configuration for the connector type that is being used with - * the endpoint profile. - * - * @return the endpointProfileType value. - */ - public String endpointProfileType() { - return this.endpointProfileType; - } - - /** - * Set the endpointProfileType property: Defines the configuration for the connector type that is being used with - * the endpoint profile. - * - * @param endpointProfileType the endpointProfileType value to set. - * @return the DiscoveredAssetEndpointProfileUpdateProperties object itself. - */ - public DiscoveredAssetEndpointProfileUpdateProperties withEndpointProfileType(String endpointProfileType) { - this.endpointProfileType = endpointProfileType; - return this; - } - - /** - * Get the discoveryId property: Identifier used to detect changes in the asset endpoint profile. - * - * @return the discoveryId value. - */ - public String discoveryId() { - return this.discoveryId; - } - - /** - * Set the discoveryId property: Identifier used to detect changes in the asset endpoint profile. - * - * @param discoveryId the discoveryId value to set. - * @return the DiscoveredAssetEndpointProfileUpdateProperties object itself. - */ - public DiscoveredAssetEndpointProfileUpdateProperties withDiscoveryId(String discoveryId) { - this.discoveryId = discoveryId; - return this; - } - - /** - * Get the version property: An integer that is incremented each time the resource is modified. - * - * @return the version value. - */ - public Long version() { - return this.version; - } - - /** - * Set the version property: An integer that is incremented each time the resource is modified. - * - * @param version the version value to set. - * @return the DiscoveredAssetEndpointProfileUpdateProperties object itself. - */ - public DiscoveredAssetEndpointProfileUpdateProperties withVersion(Long version) { - this.version = version; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("targetAddress", this.targetAddress); - jsonWriter.writeStringField("additionalConfiguration", this.additionalConfiguration); - jsonWriter.writeArrayField("supportedAuthenticationMethods", this.supportedAuthenticationMethods, - (writer, element) -> writer.writeString(element == null ? null : element.toString())); - jsonWriter.writeStringField("endpointProfileType", this.endpointProfileType); - jsonWriter.writeStringField("discoveryId", this.discoveryId); - jsonWriter.writeNumberField("version", this.version); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetEndpointProfileUpdateProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetEndpointProfileUpdateProperties if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DiscoveredAssetEndpointProfileUpdateProperties. - */ - public static DiscoveredAssetEndpointProfileUpdateProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetEndpointProfileUpdateProperties deserializedDiscoveredAssetEndpointProfileUpdateProperties - = new DiscoveredAssetEndpointProfileUpdateProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("targetAddress".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileUpdateProperties.targetAddress = reader.getString(); - } else if ("additionalConfiguration".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileUpdateProperties.additionalConfiguration - = reader.getString(); - } else if ("supportedAuthenticationMethods".equals(fieldName)) { - List supportedAuthenticationMethods - = reader.readArray(reader1 -> AuthenticationMethod.fromString(reader1.getString())); - deserializedDiscoveredAssetEndpointProfileUpdateProperties.supportedAuthenticationMethods - = supportedAuthenticationMethods; - } else if ("endpointProfileType".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileUpdateProperties.endpointProfileType = reader.getString(); - } else if ("discoveryId".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileUpdateProperties.discoveryId = reader.getString(); - } else if ("version".equals(fieldName)) { - deserializedDiscoveredAssetEndpointProfileUpdateProperties.version - = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetEndpointProfileUpdateProperties; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfiles.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfiles.java deleted file mode 100644 index 4743ca56ef09..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetEndpointProfiles.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of DiscoveredAssetEndpointProfiles. - */ -public interface DiscoveredAssetEndpointProfiles { - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, - String discoveredAssetEndpointProfileName, Context context); - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile. - */ - DiscoveredAssetEndpointProfile getByResourceGroup(String resourceGroupName, - String discoveredAssetEndpointProfileName); - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String discoveredAssetEndpointProfileName); - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetEndpointProfileName Discovered Asset Endpoint Profile name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String discoveredAssetEndpointProfileName, Context context); - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List DiscoveredAssetEndpointProfile resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List DiscoveredAssetEndpointProfile resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAssetEndpointProfile list operation as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile along with {@link Response}. - */ - DiscoveredAssetEndpointProfile getById(String id); - - /** - * Get a DiscoveredAssetEndpointProfile. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAssetEndpointProfile along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a DiscoveredAssetEndpointProfile. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DiscoveredAssetEndpointProfile resource. - * - * @param name resource name. - * @return the first stage of the new DiscoveredAssetEndpointProfile definition. - */ - DiscoveredAssetEndpointProfile.DefinitionStages.Blank define(String name); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetProperties.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetProperties.java deleted file mode 100644 index 294db13d4612..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetProperties.java +++ /dev/null @@ -1,571 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Defines the discovered asset properties. - */ -@Fluent -public final class DiscoveredAssetProperties implements JsonSerializable { - /* - * A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that - * provides data points for this asset. Must provide asset endpoint profile name. - */ - private String assetEndpointProfileRef; - - /* - * Identifier used to detect changes in the asset. - */ - private String discoveryId; - - /* - * An integer that is incremented each time the resource is modified. - */ - private long version; - - /* - * Asset manufacturer name. - */ - private String manufacturer; - - /* - * Asset manufacturer URI. - */ - private String manufacturerUri; - - /* - * Asset model name. - */ - private String model; - - /* - * Asset product code. - */ - private String productCode; - - /* - * Revision number of the hardware. - */ - private String hardwareRevision; - - /* - * Revision number of the software. - */ - private String softwareRevision; - - /* - * Reference to the documentation. - */ - private String documentationUri; - - /* - * Asset serial number. - */ - private String serialNumber; - - /* - * Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have - * its own configuration that overrides the default settings here. - */ - private String defaultDatasetsConfiguration; - - /* - * Stringified JSON that contains connector-specific default configuration for all events. Each event can have its - * own configuration that overrides the default settings here. - */ - private String defaultEventsConfiguration; - - /* - * Object that describes the default topic information for the asset. - */ - private Topic defaultTopic; - - /* - * Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. - */ - private List datasets; - - /* - * Array of events that are part of the asset. Each event can have per-event configuration. - */ - private List events; - - /* - * Provisioning state of the resource. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of DiscoveredAssetProperties class. - */ - public DiscoveredAssetProperties() { - } - - /** - * Get the assetEndpointProfileRef property: A reference to the asset endpoint profile (connection information) used - * by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint - * profile name. - * - * @return the assetEndpointProfileRef value. - */ - public String assetEndpointProfileRef() { - return this.assetEndpointProfileRef; - } - - /** - * Set the assetEndpointProfileRef property: A reference to the asset endpoint profile (connection information) used - * by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint - * profile name. - * - * @param assetEndpointProfileRef the assetEndpointProfileRef value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withAssetEndpointProfileRef(String assetEndpointProfileRef) { - this.assetEndpointProfileRef = assetEndpointProfileRef; - return this; - } - - /** - * Get the discoveryId property: Identifier used to detect changes in the asset. - * - * @return the discoveryId value. - */ - public String discoveryId() { - return this.discoveryId; - } - - /** - * Set the discoveryId property: Identifier used to detect changes in the asset. - * - * @param discoveryId the discoveryId value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withDiscoveryId(String discoveryId) { - this.discoveryId = discoveryId; - return this; - } - - /** - * Get the version property: An integer that is incremented each time the resource is modified. - * - * @return the version value. - */ - public long version() { - return this.version; - } - - /** - * Set the version property: An integer that is incremented each time the resource is modified. - * - * @param version the version value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withVersion(long version) { - this.version = version; - return this; - } - - /** - * Get the manufacturer property: Asset manufacturer name. - * - * @return the manufacturer value. - */ - public String manufacturer() { - return this.manufacturer; - } - - /** - * Set the manufacturer property: Asset manufacturer name. - * - * @param manufacturer the manufacturer value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - return this; - } - - /** - * Get the manufacturerUri property: Asset manufacturer URI. - * - * @return the manufacturerUri value. - */ - public String manufacturerUri() { - return this.manufacturerUri; - } - - /** - * Set the manufacturerUri property: Asset manufacturer URI. - * - * @param manufacturerUri the manufacturerUri value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withManufacturerUri(String manufacturerUri) { - this.manufacturerUri = manufacturerUri; - return this; - } - - /** - * Get the model property: Asset model name. - * - * @return the model value. - */ - public String model() { - return this.model; - } - - /** - * Set the model property: Asset model name. - * - * @param model the model value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withModel(String model) { - this.model = model; - return this; - } - - /** - * Get the productCode property: Asset product code. - * - * @return the productCode value. - */ - public String productCode() { - return this.productCode; - } - - /** - * Set the productCode property: Asset product code. - * - * @param productCode the productCode value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withProductCode(String productCode) { - this.productCode = productCode; - return this; - } - - /** - * Get the hardwareRevision property: Revision number of the hardware. - * - * @return the hardwareRevision value. - */ - public String hardwareRevision() { - return this.hardwareRevision; - } - - /** - * Set the hardwareRevision property: Revision number of the hardware. - * - * @param hardwareRevision the hardwareRevision value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withHardwareRevision(String hardwareRevision) { - this.hardwareRevision = hardwareRevision; - return this; - } - - /** - * Get the softwareRevision property: Revision number of the software. - * - * @return the softwareRevision value. - */ - public String softwareRevision() { - return this.softwareRevision; - } - - /** - * Set the softwareRevision property: Revision number of the software. - * - * @param softwareRevision the softwareRevision value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withSoftwareRevision(String softwareRevision) { - this.softwareRevision = softwareRevision; - return this; - } - - /** - * Get the documentationUri property: Reference to the documentation. - * - * @return the documentationUri value. - */ - public String documentationUri() { - return this.documentationUri; - } - - /** - * Set the documentationUri property: Reference to the documentation. - * - * @param documentationUri the documentationUri value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withDocumentationUri(String documentationUri) { - this.documentationUri = documentationUri; - return this; - } - - /** - * Get the serialNumber property: Asset serial number. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.serialNumber; - } - - /** - * Set the serialNumber property: Asset serial number. - * - * @param serialNumber the serialNumber value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withSerialNumber(String serialNumber) { - this.serialNumber = serialNumber; - return this; - } - - /** - * Get the defaultDatasetsConfiguration property: Stringified JSON that contains connector-specific default - * configuration for all datasets. Each dataset can have its own configuration that overrides the default settings - * here. - * - * @return the defaultDatasetsConfiguration value. - */ - public String defaultDatasetsConfiguration() { - return this.defaultDatasetsConfiguration; - } - - /** - * Set the defaultDatasetsConfiguration property: Stringified JSON that contains connector-specific default - * configuration for all datasets. Each dataset can have its own configuration that overrides the default settings - * here. - * - * @param defaultDatasetsConfiguration the defaultDatasetsConfiguration value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withDefaultDatasetsConfiguration(String defaultDatasetsConfiguration) { - this.defaultDatasetsConfiguration = defaultDatasetsConfiguration; - return this; - } - - /** - * Get the defaultEventsConfiguration property: Stringified JSON that contains connector-specific default - * configuration for all events. Each event can have its own configuration that overrides the default settings here. - * - * @return the defaultEventsConfiguration value. - */ - public String defaultEventsConfiguration() { - return this.defaultEventsConfiguration; - } - - /** - * Set the defaultEventsConfiguration property: Stringified JSON that contains connector-specific default - * configuration for all events. Each event can have its own configuration that overrides the default settings here. - * - * @param defaultEventsConfiguration the defaultEventsConfiguration value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withDefaultEventsConfiguration(String defaultEventsConfiguration) { - this.defaultEventsConfiguration = defaultEventsConfiguration; - return this; - } - - /** - * Get the defaultTopic property: Object that describes the default topic information for the asset. - * - * @return the defaultTopic value. - */ - public Topic defaultTopic() { - return this.defaultTopic; - } - - /** - * Set the defaultTopic property: Object that describes the default topic information for the asset. - * - * @param defaultTopic the defaultTopic value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withDefaultTopic(Topic defaultTopic) { - this.defaultTopic = defaultTopic; - return this; - } - - /** - * Get the datasets property: Array of datasets that are part of the asset. Each dataset spec describes the data - * points that make up the set. - * - * @return the datasets value. - */ - public List datasets() { - return this.datasets; - } - - /** - * Set the datasets property: Array of datasets that are part of the asset. Each dataset spec describes the data - * points that make up the set. - * - * @param datasets the datasets value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withDatasets(List datasets) { - this.datasets = datasets; - return this; - } - - /** - * Get the events property: Array of events that are part of the asset. Each event can have per-event configuration. - * - * @return the events value. - */ - public List events() { - return this.events; - } - - /** - * Set the events property: Array of events that are part of the asset. Each event can have per-event configuration. - * - * @param events the events value to set. - * @return the DiscoveredAssetProperties object itself. - */ - public DiscoveredAssetProperties withEvents(List events) { - this.events = events; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (assetEndpointProfileRef() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property assetEndpointProfileRef in model DiscoveredAssetProperties")); - } - if (discoveryId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property discoveryId in model DiscoveredAssetProperties")); - } - if (defaultTopic() != null) { - defaultTopic().validate(); - } - if (datasets() != null) { - datasets().forEach(e -> e.validate()); - } - if (events() != null) { - events().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredAssetProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("assetEndpointProfileRef", this.assetEndpointProfileRef); - jsonWriter.writeStringField("discoveryId", this.discoveryId); - jsonWriter.writeLongField("version", this.version); - jsonWriter.writeStringField("manufacturer", this.manufacturer); - jsonWriter.writeStringField("manufacturerUri", this.manufacturerUri); - jsonWriter.writeStringField("model", this.model); - jsonWriter.writeStringField("productCode", this.productCode); - jsonWriter.writeStringField("hardwareRevision", this.hardwareRevision); - jsonWriter.writeStringField("softwareRevision", this.softwareRevision); - jsonWriter.writeStringField("documentationUri", this.documentationUri); - jsonWriter.writeStringField("serialNumber", this.serialNumber); - jsonWriter.writeStringField("defaultDatasetsConfiguration", this.defaultDatasetsConfiguration); - jsonWriter.writeStringField("defaultEventsConfiguration", this.defaultEventsConfiguration); - jsonWriter.writeJsonField("defaultTopic", this.defaultTopic); - jsonWriter.writeArrayField("datasets", this.datasets, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("events", this.events, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredAssetProperties. - */ - public static DiscoveredAssetProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetProperties deserializedDiscoveredAssetProperties = new DiscoveredAssetProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("assetEndpointProfileRef".equals(fieldName)) { - deserializedDiscoveredAssetProperties.assetEndpointProfileRef = reader.getString(); - } else if ("discoveryId".equals(fieldName)) { - deserializedDiscoveredAssetProperties.discoveryId = reader.getString(); - } else if ("version".equals(fieldName)) { - deserializedDiscoveredAssetProperties.version = reader.getLong(); - } else if ("manufacturer".equals(fieldName)) { - deserializedDiscoveredAssetProperties.manufacturer = reader.getString(); - } else if ("manufacturerUri".equals(fieldName)) { - deserializedDiscoveredAssetProperties.manufacturerUri = reader.getString(); - } else if ("model".equals(fieldName)) { - deserializedDiscoveredAssetProperties.model = reader.getString(); - } else if ("productCode".equals(fieldName)) { - deserializedDiscoveredAssetProperties.productCode = reader.getString(); - } else if ("hardwareRevision".equals(fieldName)) { - deserializedDiscoveredAssetProperties.hardwareRevision = reader.getString(); - } else if ("softwareRevision".equals(fieldName)) { - deserializedDiscoveredAssetProperties.softwareRevision = reader.getString(); - } else if ("documentationUri".equals(fieldName)) { - deserializedDiscoveredAssetProperties.documentationUri = reader.getString(); - } else if ("serialNumber".equals(fieldName)) { - deserializedDiscoveredAssetProperties.serialNumber = reader.getString(); - } else if ("defaultDatasetsConfiguration".equals(fieldName)) { - deserializedDiscoveredAssetProperties.defaultDatasetsConfiguration = reader.getString(); - } else if ("defaultEventsConfiguration".equals(fieldName)) { - deserializedDiscoveredAssetProperties.defaultEventsConfiguration = reader.getString(); - } else if ("defaultTopic".equals(fieldName)) { - deserializedDiscoveredAssetProperties.defaultTopic = Topic.fromJson(reader); - } else if ("datasets".equals(fieldName)) { - List datasets = reader.readArray(reader1 -> DiscoveredDataset.fromJson(reader1)); - deserializedDiscoveredAssetProperties.datasets = datasets; - } else if ("events".equals(fieldName)) { - List events = reader.readArray(reader1 -> DiscoveredEvent.fromJson(reader1)); - deserializedDiscoveredAssetProperties.events = events; - } else if ("provisioningState".equals(fieldName)) { - deserializedDiscoveredAssetProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetProperties; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetUpdate.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetUpdate.java deleted file mode 100644 index 916b32492f3e..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetUpdate.java +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * The type used for update operations of the DiscoveredAsset. - */ -@Fluent -public final class DiscoveredAssetUpdate implements JsonSerializable { - /* - * Resource tags. - */ - private Map tags; - - /* - * The resource-specific properties for this resource. - */ - private DiscoveredAssetUpdateProperties properties; - - /** - * Creates an instance of DiscoveredAssetUpdate class. - */ - public DiscoveredAssetUpdate() { - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the DiscoveredAssetUpdate object itself. - */ - public DiscoveredAssetUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public DiscoveredAssetUpdateProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the DiscoveredAssetUpdate object itself. - */ - public DiscoveredAssetUpdate withProperties(DiscoveredAssetUpdateProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetUpdate if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the DiscoveredAssetUpdate. - */ - public static DiscoveredAssetUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetUpdate deserializedDiscoveredAssetUpdate = new DiscoveredAssetUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDiscoveredAssetUpdate.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedDiscoveredAssetUpdate.properties = DiscoveredAssetUpdateProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetUpdate; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetUpdateProperties.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetUpdateProperties.java deleted file mode 100644 index a7cffab66be8..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssetUpdateProperties.java +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The updatable properties of the DiscoveredAsset. - */ -@Fluent -public final class DiscoveredAssetUpdateProperties implements JsonSerializable { - /* - * Identifier used to detect changes in the asset. - */ - private String discoveryId; - - /* - * An integer that is incremented each time the resource is modified. - */ - private Long version; - - /* - * Asset manufacturer name. - */ - private String manufacturer; - - /* - * Asset manufacturer URI. - */ - private String manufacturerUri; - - /* - * Asset model name. - */ - private String model; - - /* - * Asset product code. - */ - private String productCode; - - /* - * Revision number of the hardware. - */ - private String hardwareRevision; - - /* - * Revision number of the software. - */ - private String softwareRevision; - - /* - * Reference to the documentation. - */ - private String documentationUri; - - /* - * Asset serial number. - */ - private String serialNumber; - - /* - * Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have - * its own configuration that overrides the default settings here. - */ - private String defaultDatasetsConfiguration; - - /* - * Stringified JSON that contains connector-specific default configuration for all events. Each event can have its - * own configuration that overrides the default settings here. - */ - private String defaultEventsConfiguration; - - /* - * Object that describes the default topic information for the asset. - */ - private Topic defaultTopic; - - /* - * Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. - */ - private List datasets; - - /* - * Array of events that are part of the asset. Each event can have per-event configuration. - */ - private List events; - - /** - * Creates an instance of DiscoveredAssetUpdateProperties class. - */ - public DiscoveredAssetUpdateProperties() { - } - - /** - * Get the discoveryId property: Identifier used to detect changes in the asset. - * - * @return the discoveryId value. - */ - public String discoveryId() { - return this.discoveryId; - } - - /** - * Set the discoveryId property: Identifier used to detect changes in the asset. - * - * @param discoveryId the discoveryId value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withDiscoveryId(String discoveryId) { - this.discoveryId = discoveryId; - return this; - } - - /** - * Get the version property: An integer that is incremented each time the resource is modified. - * - * @return the version value. - */ - public Long version() { - return this.version; - } - - /** - * Set the version property: An integer that is incremented each time the resource is modified. - * - * @param version the version value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withVersion(Long version) { - this.version = version; - return this; - } - - /** - * Get the manufacturer property: Asset manufacturer name. - * - * @return the manufacturer value. - */ - public String manufacturer() { - return this.manufacturer; - } - - /** - * Set the manufacturer property: Asset manufacturer name. - * - * @param manufacturer the manufacturer value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - return this; - } - - /** - * Get the manufacturerUri property: Asset manufacturer URI. - * - * @return the manufacturerUri value. - */ - public String manufacturerUri() { - return this.manufacturerUri; - } - - /** - * Set the manufacturerUri property: Asset manufacturer URI. - * - * @param manufacturerUri the manufacturerUri value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withManufacturerUri(String manufacturerUri) { - this.manufacturerUri = manufacturerUri; - return this; - } - - /** - * Get the model property: Asset model name. - * - * @return the model value. - */ - public String model() { - return this.model; - } - - /** - * Set the model property: Asset model name. - * - * @param model the model value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withModel(String model) { - this.model = model; - return this; - } - - /** - * Get the productCode property: Asset product code. - * - * @return the productCode value. - */ - public String productCode() { - return this.productCode; - } - - /** - * Set the productCode property: Asset product code. - * - * @param productCode the productCode value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withProductCode(String productCode) { - this.productCode = productCode; - return this; - } - - /** - * Get the hardwareRevision property: Revision number of the hardware. - * - * @return the hardwareRevision value. - */ - public String hardwareRevision() { - return this.hardwareRevision; - } - - /** - * Set the hardwareRevision property: Revision number of the hardware. - * - * @param hardwareRevision the hardwareRevision value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withHardwareRevision(String hardwareRevision) { - this.hardwareRevision = hardwareRevision; - return this; - } - - /** - * Get the softwareRevision property: Revision number of the software. - * - * @return the softwareRevision value. - */ - public String softwareRevision() { - return this.softwareRevision; - } - - /** - * Set the softwareRevision property: Revision number of the software. - * - * @param softwareRevision the softwareRevision value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withSoftwareRevision(String softwareRevision) { - this.softwareRevision = softwareRevision; - return this; - } - - /** - * Get the documentationUri property: Reference to the documentation. - * - * @return the documentationUri value. - */ - public String documentationUri() { - return this.documentationUri; - } - - /** - * Set the documentationUri property: Reference to the documentation. - * - * @param documentationUri the documentationUri value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withDocumentationUri(String documentationUri) { - this.documentationUri = documentationUri; - return this; - } - - /** - * Get the serialNumber property: Asset serial number. - * - * @return the serialNumber value. - */ - public String serialNumber() { - return this.serialNumber; - } - - /** - * Set the serialNumber property: Asset serial number. - * - * @param serialNumber the serialNumber value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withSerialNumber(String serialNumber) { - this.serialNumber = serialNumber; - return this; - } - - /** - * Get the defaultDatasetsConfiguration property: Stringified JSON that contains connector-specific default - * configuration for all datasets. Each dataset can have its own configuration that overrides the default settings - * here. - * - * @return the defaultDatasetsConfiguration value. - */ - public String defaultDatasetsConfiguration() { - return this.defaultDatasetsConfiguration; - } - - /** - * Set the defaultDatasetsConfiguration property: Stringified JSON that contains connector-specific default - * configuration for all datasets. Each dataset can have its own configuration that overrides the default settings - * here. - * - * @param defaultDatasetsConfiguration the defaultDatasetsConfiguration value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withDefaultDatasetsConfiguration(String defaultDatasetsConfiguration) { - this.defaultDatasetsConfiguration = defaultDatasetsConfiguration; - return this; - } - - /** - * Get the defaultEventsConfiguration property: Stringified JSON that contains connector-specific default - * configuration for all events. Each event can have its own configuration that overrides the default settings here. - * - * @return the defaultEventsConfiguration value. - */ - public String defaultEventsConfiguration() { - return this.defaultEventsConfiguration; - } - - /** - * Set the defaultEventsConfiguration property: Stringified JSON that contains connector-specific default - * configuration for all events. Each event can have its own configuration that overrides the default settings here. - * - * @param defaultEventsConfiguration the defaultEventsConfiguration value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withDefaultEventsConfiguration(String defaultEventsConfiguration) { - this.defaultEventsConfiguration = defaultEventsConfiguration; - return this; - } - - /** - * Get the defaultTopic property: Object that describes the default topic information for the asset. - * - * @return the defaultTopic value. - */ - public Topic defaultTopic() { - return this.defaultTopic; - } - - /** - * Set the defaultTopic property: Object that describes the default topic information for the asset. - * - * @param defaultTopic the defaultTopic value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withDefaultTopic(Topic defaultTopic) { - this.defaultTopic = defaultTopic; - return this; - } - - /** - * Get the datasets property: Array of datasets that are part of the asset. Each dataset spec describes the data - * points that make up the set. - * - * @return the datasets value. - */ - public List datasets() { - return this.datasets; - } - - /** - * Set the datasets property: Array of datasets that are part of the asset. Each dataset spec describes the data - * points that make up the set. - * - * @param datasets the datasets value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withDatasets(List datasets) { - this.datasets = datasets; - return this; - } - - /** - * Get the events property: Array of events that are part of the asset. Each event can have per-event configuration. - * - * @return the events value. - */ - public List events() { - return this.events; - } - - /** - * Set the events property: Array of events that are part of the asset. Each event can have per-event configuration. - * - * @param events the events value to set. - * @return the DiscoveredAssetUpdateProperties object itself. - */ - public DiscoveredAssetUpdateProperties withEvents(List events) { - this.events = events; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (defaultTopic() != null) { - defaultTopic().validate(); - } - if (datasets() != null) { - datasets().forEach(e -> e.validate()); - } - if (events() != null) { - events().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("discoveryId", this.discoveryId); - jsonWriter.writeNumberField("version", this.version); - jsonWriter.writeStringField("manufacturer", this.manufacturer); - jsonWriter.writeStringField("manufacturerUri", this.manufacturerUri); - jsonWriter.writeStringField("model", this.model); - jsonWriter.writeStringField("productCode", this.productCode); - jsonWriter.writeStringField("hardwareRevision", this.hardwareRevision); - jsonWriter.writeStringField("softwareRevision", this.softwareRevision); - jsonWriter.writeStringField("documentationUri", this.documentationUri); - jsonWriter.writeStringField("serialNumber", this.serialNumber); - jsonWriter.writeStringField("defaultDatasetsConfiguration", this.defaultDatasetsConfiguration); - jsonWriter.writeStringField("defaultEventsConfiguration", this.defaultEventsConfiguration); - jsonWriter.writeJsonField("defaultTopic", this.defaultTopic); - jsonWriter.writeArrayField("datasets", this.datasets, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("events", this.events, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredAssetUpdateProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredAssetUpdateProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the DiscoveredAssetUpdateProperties. - */ - public static DiscoveredAssetUpdateProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredAssetUpdateProperties deserializedDiscoveredAssetUpdateProperties - = new DiscoveredAssetUpdateProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("discoveryId".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.discoveryId = reader.getString(); - } else if ("version".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.version = reader.getNullable(JsonReader::getLong); - } else if ("manufacturer".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.manufacturer = reader.getString(); - } else if ("manufacturerUri".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.manufacturerUri = reader.getString(); - } else if ("model".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.model = reader.getString(); - } else if ("productCode".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.productCode = reader.getString(); - } else if ("hardwareRevision".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.hardwareRevision = reader.getString(); - } else if ("softwareRevision".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.softwareRevision = reader.getString(); - } else if ("documentationUri".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.documentationUri = reader.getString(); - } else if ("serialNumber".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.serialNumber = reader.getString(); - } else if ("defaultDatasetsConfiguration".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.defaultDatasetsConfiguration = reader.getString(); - } else if ("defaultEventsConfiguration".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.defaultEventsConfiguration = reader.getString(); - } else if ("defaultTopic".equals(fieldName)) { - deserializedDiscoveredAssetUpdateProperties.defaultTopic = Topic.fromJson(reader); - } else if ("datasets".equals(fieldName)) { - List datasets = reader.readArray(reader1 -> DiscoveredDataset.fromJson(reader1)); - deserializedDiscoveredAssetUpdateProperties.datasets = datasets; - } else if ("events".equals(fieldName)) { - List events = reader.readArray(reader1 -> DiscoveredEvent.fromJson(reader1)); - deserializedDiscoveredAssetUpdateProperties.events = events; - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredAssetUpdateProperties; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssets.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssets.java deleted file mode 100644 index b573d15f1268..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredAssets.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of DiscoveredAssets. - */ -public interface DiscoveredAssets { - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String discoveredAssetName, - Context context); - - /** - * Get a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset. - */ - DiscoveredAsset getByResourceGroup(String resourceGroupName, String discoveredAssetName); - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String discoveredAssetName); - - /** - * Delete a DiscoveredAsset. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param discoveredAssetName Discovered Asset name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String discoveredAssetName, Context context); - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List DiscoveredAsset resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List DiscoveredAsset resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a DiscoveredAsset list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get a DiscoveredAsset. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset along with {@link Response}. - */ - DiscoveredAsset getById(String id); - - /** - * Get a DiscoveredAsset. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a DiscoveredAsset along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a DiscoveredAsset. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a DiscoveredAsset. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DiscoveredAsset resource. - * - * @param name resource name. - * @return the first stage of the new DiscoveredAsset definition. - */ - DiscoveredAsset.DefinitionStages.Blank define(String name); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredDataPoint.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredDataPoint.java deleted file mode 100644 index bf5234410ffd..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredDataPoint.java +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Defines the data point properties. - */ -@Fluent -public final class DiscoveredDataPoint implements JsonSerializable { - /* - * The name of the data point. - */ - private String name; - - /* - * The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the - * asset. - */ - private String dataSource; - - /* - * Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could - * include configuration like, publishingInterval, samplingInterval, and queueSize. - */ - private String dataPointConfiguration; - - /* - * UTC timestamp indicating when the data point was added or modified. - */ - private OffsetDateTime lastUpdatedOn; - - /** - * Creates an instance of DiscoveredDataPoint class. - */ - public DiscoveredDataPoint() { - } - - /** - * Get the name property: The name of the data point. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the data point. - * - * @param name the name value to set. - * @return the DiscoveredDataPoint object itself. - */ - public DiscoveredDataPoint withName(String name) { - this.name = name; - return this; - } - - /** - * Get the dataSource property: The address of the source of the data in the asset (e.g. URL) so that a client can - * access the data source on the asset. - * - * @return the dataSource value. - */ - public String dataSource() { - return this.dataSource; - } - - /** - * Set the dataSource property: The address of the source of the data in the asset (e.g. URL) so that a client can - * access the data source on the asset. - * - * @param dataSource the dataSource value to set. - * @return the DiscoveredDataPoint object itself. - */ - public DiscoveredDataPoint withDataSource(String dataSource) { - this.dataSource = dataSource; - return this; - } - - /** - * Get the dataPointConfiguration property: Stringified JSON that contains connector-specific configuration for the - * data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and - * queueSize. - * - * @return the dataPointConfiguration value. - */ - public String dataPointConfiguration() { - return this.dataPointConfiguration; - } - - /** - * Set the dataPointConfiguration property: Stringified JSON that contains connector-specific configuration for the - * data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and - * queueSize. - * - * @param dataPointConfiguration the dataPointConfiguration value to set. - * @return the DiscoveredDataPoint object itself. - */ - public DiscoveredDataPoint withDataPointConfiguration(String dataPointConfiguration) { - this.dataPointConfiguration = dataPointConfiguration; - return this; - } - - /** - * Get the lastUpdatedOn property: UTC timestamp indicating when the data point was added or modified. - * - * @return the lastUpdatedOn value. - */ - public OffsetDateTime lastUpdatedOn() { - return this.lastUpdatedOn; - } - - /** - * Set the lastUpdatedOn property: UTC timestamp indicating when the data point was added or modified. - * - * @param lastUpdatedOn the lastUpdatedOn value to set. - * @return the DiscoveredDataPoint object itself. - */ - public DiscoveredDataPoint withLastUpdatedOn(OffsetDateTime lastUpdatedOn) { - this.lastUpdatedOn = lastUpdatedOn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model DiscoveredDataPoint")); - } - if (dataSource() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property dataSource in model DiscoveredDataPoint")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredDataPoint.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("dataSource", this.dataSource); - jsonWriter.writeStringField("dataPointConfiguration", this.dataPointConfiguration); - jsonWriter.writeStringField("lastUpdatedOn", - this.lastUpdatedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedOn)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredDataPoint from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredDataPoint if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredDataPoint. - */ - public static DiscoveredDataPoint fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredDataPoint deserializedDiscoveredDataPoint = new DiscoveredDataPoint(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedDiscoveredDataPoint.name = reader.getString(); - } else if ("dataSource".equals(fieldName)) { - deserializedDiscoveredDataPoint.dataSource = reader.getString(); - } else if ("dataPointConfiguration".equals(fieldName)) { - deserializedDiscoveredDataPoint.dataPointConfiguration = reader.getString(); - } else if ("lastUpdatedOn".equals(fieldName)) { - deserializedDiscoveredDataPoint.lastUpdatedOn = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredDataPoint; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredDataset.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredDataset.java deleted file mode 100644 index fd0d627590b4..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredDataset.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Defines the dataset properties. - */ -@Fluent -public final class DiscoveredDataset implements JsonSerializable { - /* - * Name of the dataset. - */ - private String name; - - /* - * Stringified JSON that contains connector-specific properties that describes configuration for the specific - * dataset. - */ - private String datasetConfiguration; - - /* - * Object that describes the topic information for the specific dataset. - */ - private Topic topic; - - /* - * Array of data points that are part of the dataset. Each data point can have per-data point configuration. - */ - private List dataPoints; - - /** - * Creates an instance of DiscoveredDataset class. - */ - public DiscoveredDataset() { - } - - /** - * Get the name property: Name of the dataset. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Name of the dataset. - * - * @param name the name value to set. - * @return the DiscoveredDataset object itself. - */ - public DiscoveredDataset withName(String name) { - this.name = name; - return this; - } - - /** - * Get the datasetConfiguration property: Stringified JSON that contains connector-specific properties that - * describes configuration for the specific dataset. - * - * @return the datasetConfiguration value. - */ - public String datasetConfiguration() { - return this.datasetConfiguration; - } - - /** - * Set the datasetConfiguration property: Stringified JSON that contains connector-specific properties that - * describes configuration for the specific dataset. - * - * @param datasetConfiguration the datasetConfiguration value to set. - * @return the DiscoveredDataset object itself. - */ - public DiscoveredDataset withDatasetConfiguration(String datasetConfiguration) { - this.datasetConfiguration = datasetConfiguration; - return this; - } - - /** - * Get the topic property: Object that describes the topic information for the specific dataset. - * - * @return the topic value. - */ - public Topic topic() { - return this.topic; - } - - /** - * Set the topic property: Object that describes the topic information for the specific dataset. - * - * @param topic the topic value to set. - * @return the DiscoveredDataset object itself. - */ - public DiscoveredDataset withTopic(Topic topic) { - this.topic = topic; - return this; - } - - /** - * Get the dataPoints property: Array of data points that are part of the dataset. Each data point can have per-data - * point configuration. - * - * @return the dataPoints value. - */ - public List dataPoints() { - return this.dataPoints; - } - - /** - * Set the dataPoints property: Array of data points that are part of the dataset. Each data point can have per-data - * point configuration. - * - * @param dataPoints the dataPoints value to set. - * @return the DiscoveredDataset object itself. - */ - public DiscoveredDataset withDataPoints(List dataPoints) { - this.dataPoints = dataPoints; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model DiscoveredDataset")); - } - if (topic() != null) { - topic().validate(); - } - if (dataPoints() != null) { - dataPoints().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredDataset.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("datasetConfiguration", this.datasetConfiguration); - jsonWriter.writeJsonField("topic", this.topic); - jsonWriter.writeArrayField("dataPoints", this.dataPoints, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredDataset from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredDataset if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredDataset. - */ - public static DiscoveredDataset fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredDataset deserializedDiscoveredDataset = new DiscoveredDataset(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedDiscoveredDataset.name = reader.getString(); - } else if ("datasetConfiguration".equals(fieldName)) { - deserializedDiscoveredDataset.datasetConfiguration = reader.getString(); - } else if ("topic".equals(fieldName)) { - deserializedDiscoveredDataset.topic = Topic.fromJson(reader); - } else if ("dataPoints".equals(fieldName)) { - List dataPoints - = reader.readArray(reader1 -> DiscoveredDataPoint.fromJson(reader1)); - deserializedDiscoveredDataset.dataPoints = dataPoints; - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredDataset; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredEvent.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredEvent.java deleted file mode 100644 index 1a8a4f07f1dc..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/DiscoveredEvent.java +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; - -/** - * Defines the event properties. - */ -@Fluent -public final class DiscoveredEvent implements JsonSerializable { - /* - * The name of the event. - */ - private String name; - - /* - * The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the - * asset. - */ - private String eventNotifier; - - /* - * Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include - * configuration like, publishingInterval, samplingInterval, and queueSize. - */ - private String eventConfiguration; - - /* - * Object that describes the topic information for the specific event. - */ - private Topic topic; - - /* - * UTC timestamp indicating when the event was added or modified. - */ - private OffsetDateTime lastUpdatedOn; - - /** - * Creates an instance of DiscoveredEvent class. - */ - public DiscoveredEvent() { - } - - /** - * Get the name property: The name of the event. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the event. - * - * @param name the name value to set. - * @return the DiscoveredEvent object itself. - */ - public DiscoveredEvent withName(String name) { - this.name = name; - return this; - } - - /** - * Get the eventNotifier property: The address of the notifier of the event in the asset (e.g. URL) so that a client - * can access the event on the asset. - * - * @return the eventNotifier value. - */ - public String eventNotifier() { - return this.eventNotifier; - } - - /** - * Set the eventNotifier property: The address of the notifier of the event in the asset (e.g. URL) so that a client - * can access the event on the asset. - * - * @param eventNotifier the eventNotifier value to set. - * @return the DiscoveredEvent object itself. - */ - public DiscoveredEvent withEventNotifier(String eventNotifier) { - this.eventNotifier = eventNotifier; - return this; - } - - /** - * Get the eventConfiguration property: Stringified JSON that contains connector-specific configuration for the - * event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - * - * @return the eventConfiguration value. - */ - public String eventConfiguration() { - return this.eventConfiguration; - } - - /** - * Set the eventConfiguration property: Stringified JSON that contains connector-specific configuration for the - * event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. - * - * @param eventConfiguration the eventConfiguration value to set. - * @return the DiscoveredEvent object itself. - */ - public DiscoveredEvent withEventConfiguration(String eventConfiguration) { - this.eventConfiguration = eventConfiguration; - return this; - } - - /** - * Get the topic property: Object that describes the topic information for the specific event. - * - * @return the topic value. - */ - public Topic topic() { - return this.topic; - } - - /** - * Set the topic property: Object that describes the topic information for the specific event. - * - * @param topic the topic value to set. - * @return the DiscoveredEvent object itself. - */ - public DiscoveredEvent withTopic(Topic topic) { - this.topic = topic; - return this; - } - - /** - * Get the lastUpdatedOn property: UTC timestamp indicating when the event was added or modified. - * - * @return the lastUpdatedOn value. - */ - public OffsetDateTime lastUpdatedOn() { - return this.lastUpdatedOn; - } - - /** - * Set the lastUpdatedOn property: UTC timestamp indicating when the event was added or modified. - * - * @param lastUpdatedOn the lastUpdatedOn value to set. - * @return the DiscoveredEvent object itself. - */ - public DiscoveredEvent withLastUpdatedOn(OffsetDateTime lastUpdatedOn) { - this.lastUpdatedOn = lastUpdatedOn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property name in model DiscoveredEvent")); - } - if (eventNotifier() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property eventNotifier in model DiscoveredEvent")); - } - if (topic() != null) { - topic().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredEvent.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("eventNotifier", this.eventNotifier); - jsonWriter.writeStringField("eventConfiguration", this.eventConfiguration); - jsonWriter.writeJsonField("topic", this.topic); - jsonWriter.writeStringField("lastUpdatedOn", - this.lastUpdatedOn == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastUpdatedOn)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DiscoveredEvent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DiscoveredEvent if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DiscoveredEvent. - */ - public static DiscoveredEvent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - DiscoveredEvent deserializedDiscoveredEvent = new DiscoveredEvent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedDiscoveredEvent.name = reader.getString(); - } else if ("eventNotifier".equals(fieldName)) { - deserializedDiscoveredEvent.eventNotifier = reader.getString(); - } else if ("eventConfiguration".equals(fieldName)) { - deserializedDiscoveredEvent.eventConfiguration = reader.getString(); - } else if ("topic".equals(fieldName)) { - deserializedDiscoveredEvent.topic = Topic.fromJson(reader); - } else if ("lastUpdatedOn".equals(fieldName)) { - deserializedDiscoveredEvent.lastUpdatedOn = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedDiscoveredEvent; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Format.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Format.java deleted file mode 100644 index 775301f93450..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Format.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines the schema format. - */ -public final class Format extends ExpandableStringEnum { - /** - * JSON Schema version draft 7 format. - */ - public static final Format JSON_SCHEMA_DRAFT7 = fromString("JsonSchema/draft-07"); - - /** - * Delta format. - */ - public static final Format DELTA_1_0 = fromString("Delta/1.0"); - - /** - * Creates a new instance of Format value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Format() { - } - - /** - * Creates or finds a Format from its string representation. - * - * @param name a name to look for. - * @return the corresponding Format. - */ - public static Format fromString(String name) { - return fromString(name, Format.class); - } - - /** - * Gets known Format values. - * - * @return known Format values. - */ - public static Collection values() { - return values(Format.class); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Schema.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Schema.java deleted file mode 100644 index bde48886f14c..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Schema.java +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaInner; - -/** - * An immutable client-side representation of Schema. - */ -public interface Schema { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - SchemaProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.deviceregistry.fluent.models.SchemaInner object. - * - * @return the inner object. - */ - SchemaInner innerModel(); - - /** - * The entirety of the Schema definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The Schema definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the Schema definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the Schema definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, schemaRegistryName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @return the next definition stage. - */ - WithCreate withExistingSchemaRegistry(String resourceGroupName, String schemaRegistryName); - } - - /** - * The stage of the Schema definition which contains all the minimum required properties for the resource to be - * created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - Schema create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Schema create(Context context); - } - - /** - * The stage of the Schema definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The resource-specific properties for this resource.. - * - * @param properties The resource-specific properties for this resource. - * @return the next definition stage. - */ - WithCreate withProperties(SchemaProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Schema refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Schema refresh(Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaProperties.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaProperties.java deleted file mode 100644 index 52c5195de45d..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaProperties.java +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * Defines the schema properties. - */ -@Fluent -public final class SchemaProperties implements JsonSerializable { - /* - * Globally unique, immutable, non-reusable id. - */ - private String uuid; - - /* - * Human-readable display name. - */ - private String displayName; - - /* - * Human-readable description of the schema. - */ - private String description; - - /* - * Format of the schema. - */ - private Format format; - - /* - * Type of the schema. - */ - private SchemaType schemaType; - - /* - * Provisioning state of the resource. - */ - private ProvisioningState provisioningState; - - /* - * Schema tags. - */ - private Map tags; - - /** - * Creates an instance of SchemaProperties class. - */ - public SchemaProperties() { - } - - /** - * Get the uuid property: Globally unique, immutable, non-reusable id. - * - * @return the uuid value. - */ - public String uuid() { - return this.uuid; - } - - /** - * Get the displayName property: Human-readable display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Human-readable display name. - * - * @param displayName the displayName value to set. - * @return the SchemaProperties object itself. - */ - public SchemaProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: Human-readable description of the schema. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Human-readable description of the schema. - * - * @param description the description value to set. - * @return the SchemaProperties object itself. - */ - public SchemaProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the format property: Format of the schema. - * - * @return the format value. - */ - public Format format() { - return this.format; - } - - /** - * Set the format property: Format of the schema. - * - * @param format the format value to set. - * @return the SchemaProperties object itself. - */ - public SchemaProperties withFormat(Format format) { - this.format = format; - return this; - } - - /** - * Get the schemaType property: Type of the schema. - * - * @return the schemaType value. - */ - public SchemaType schemaType() { - return this.schemaType; - } - - /** - * Set the schemaType property: Type of the schema. - * - * @param schemaType the schemaType value to set. - * @return the SchemaProperties object itself. - */ - public SchemaProperties withSchemaType(SchemaType schemaType) { - this.schemaType = schemaType; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Get the tags property: Schema tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Schema tags. - * - * @param tags the tags value to set. - * @return the SchemaProperties object itself. - */ - public SchemaProperties withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (format() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property format in model SchemaProperties")); - } - if (schemaType() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property schemaType in model SchemaProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SchemaProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("format", this.format == null ? null : this.format.toString()); - jsonWriter.writeStringField("schemaType", this.schemaType == null ? null : this.schemaType.toString()); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaProperties if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaProperties. - */ - public static SchemaProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaProperties deserializedSchemaProperties = new SchemaProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("format".equals(fieldName)) { - deserializedSchemaProperties.format = Format.fromString(reader.getString()); - } else if ("schemaType".equals(fieldName)) { - deserializedSchemaProperties.schemaType = SchemaType.fromString(reader.getString()); - } else if ("uuid".equals(fieldName)) { - deserializedSchemaProperties.uuid = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedSchemaProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedSchemaProperties.description = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedSchemaProperties.provisioningState = ProvisioningState.fromString(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSchemaProperties.tags = tags; - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaProperties; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistries.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistries.java deleted file mode 100644 index c04e14791f50..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistries.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of SchemaRegistries. - */ -public interface SchemaRegistries { - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry along with {@link Response}. - */ - Response getByResourceGroupWithResponse(String resourceGroupName, String schemaRegistryName, - Context context); - - /** - * Get a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry. - */ - SchemaRegistry getByResourceGroup(String resourceGroupName, String schemaRegistryName); - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String schemaRegistryName); - - /** - * Delete a SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String schemaRegistryName, Context context); - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List SchemaRegistry resources by resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List SchemaRegistry resources by subscription ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List SchemaRegistry resources by subscription ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaRegistry list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get a SchemaRegistry. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry along with {@link Response}. - */ - SchemaRegistry getById(String id); - - /** - * Get a SchemaRegistry. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaRegistry along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a SchemaRegistry. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a SchemaRegistry. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SchemaRegistry resource. - * - * @param name resource name. - * @return the first stage of the new SchemaRegistry definition. - */ - SchemaRegistry.DefinitionStages.Blank define(String name); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistry.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistry.java deleted file mode 100644 index 8a0f9ab98e46..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistry.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaRegistryInner; -import java.util.Map; - -/** - * An immutable client-side representation of SchemaRegistry. - */ -public interface SchemaRegistry { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - SchemaRegistryProperties properties(); - - /** - * Gets the identity property: The managed service identities assigned to this resource. - * - * @return the identity value. - */ - SystemAssignedServiceIdentity identity(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.deviceregistry.fluent.models.SchemaRegistryInner object. - * - * @return the inner object. - */ - SchemaRegistryInner innerModel(); - - /** - * The entirety of the SchemaRegistry definition. - */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - - /** - * The SchemaRegistry definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the SchemaRegistry definition. - */ - interface Blank extends WithLocation { - } - - /** - * The stage of the SchemaRegistry definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - - /** - * The stage of the SchemaRegistry definition allowing to specify parent resource. - */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - - /** - * The stage of the SchemaRegistry definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithIdentity { - /** - * Executes the create request. - * - * @return the created resource. - */ - SchemaRegistry create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SchemaRegistry create(Context context); - } - - /** - * The stage of the SchemaRegistry definition allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** - * The stage of the SchemaRegistry definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The resource-specific properties for this resource.. - * - * @param properties The resource-specific properties for this resource. - * @return the next definition stage. - */ - WithCreate withProperties(SchemaRegistryProperties properties); - } - - /** - * The stage of the SchemaRegistry definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The managed service identities assigned to this resource.. - * - * @param identity The managed service identities assigned to this resource. - * @return the next definition stage. - */ - WithCreate withIdentity(SystemAssignedServiceIdentity identity); - } - } - - /** - * Begins update for the SchemaRegistry resource. - * - * @return the stage of resource update. - */ - SchemaRegistry.Update update(); - - /** - * The template for SchemaRegistry update. - */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { - /** - * Executes the update request. - * - * @return the updated resource. - */ - SchemaRegistry apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - SchemaRegistry apply(Context context); - } - - /** - * The SchemaRegistry update stages. - */ - interface UpdateStages { - /** - * The stage of the SchemaRegistry update allowing to specify tags. - */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - - /** - * The stage of the SchemaRegistry update allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The managed service identities assigned to this resource.. - * - * @param identity The managed service identities assigned to this resource. - * @return the next definition stage. - */ - Update withIdentity(SystemAssignedServiceIdentity identity); - } - - /** - * The stage of the SchemaRegistry update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The resource-specific properties for this resource.. - * - * @param properties The resource-specific properties for this resource. - * @return the next definition stage. - */ - Update withProperties(SchemaRegistryUpdateProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SchemaRegistry refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SchemaRegistry refresh(Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryProperties.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryProperties.java deleted file mode 100644 index 8b792b0c4f70..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryProperties.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Defines the schema registry properties. - */ -@Fluent -public final class SchemaRegistryProperties implements JsonSerializable { - /* - * Globally unique, immutable, non-reusable id. - */ - private String uuid; - - /* - * Schema registry namespace. Uniquely identifies a schema registry within a tenant. - */ - private String namespace; - - /* - * Human-readable display name. - */ - private String displayName; - - /* - * Human-readable description of the schema registry. - */ - private String description; - - /* - * The Storage Account's Container URL where schemas will be stored. - */ - private String storageAccountContainerUrl; - - /* - * Provisioning state of the resource. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of SchemaRegistryProperties class. - */ - public SchemaRegistryProperties() { - } - - /** - * Get the uuid property: Globally unique, immutable, non-reusable id. - * - * @return the uuid value. - */ - public String uuid() { - return this.uuid; - } - - /** - * Get the namespace property: Schema registry namespace. Uniquely identifies a schema registry within a tenant. - * - * @return the namespace value. - */ - public String namespace() { - return this.namespace; - } - - /** - * Set the namespace property: Schema registry namespace. Uniquely identifies a schema registry within a tenant. - * - * @param namespace the namespace value to set. - * @return the SchemaRegistryProperties object itself. - */ - public SchemaRegistryProperties withNamespace(String namespace) { - this.namespace = namespace; - return this; - } - - /** - * Get the displayName property: Human-readable display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Human-readable display name. - * - * @param displayName the displayName value to set. - * @return the SchemaRegistryProperties object itself. - */ - public SchemaRegistryProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: Human-readable description of the schema registry. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Human-readable description of the schema registry. - * - * @param description the description value to set. - * @return the SchemaRegistryProperties object itself. - */ - public SchemaRegistryProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the storageAccountContainerUrl property: The Storage Account's Container URL where schemas will be stored. - * - * @return the storageAccountContainerUrl value. - */ - public String storageAccountContainerUrl() { - return this.storageAccountContainerUrl; - } - - /** - * Set the storageAccountContainerUrl property: The Storage Account's Container URL where schemas will be stored. - * - * @param storageAccountContainerUrl the storageAccountContainerUrl value to set. - * @return the SchemaRegistryProperties object itself. - */ - public SchemaRegistryProperties withStorageAccountContainerUrl(String storageAccountContainerUrl) { - this.storageAccountContainerUrl = storageAccountContainerUrl; - return this; - } - - /** - * Get the provisioningState property: Provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (namespace() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property namespace in model SchemaRegistryProperties")); - } - if (storageAccountContainerUrl() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property storageAccountContainerUrl in model SchemaRegistryProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SchemaRegistryProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("namespace", this.namespace); - jsonWriter.writeStringField("storageAccountContainerUrl", this.storageAccountContainerUrl); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaRegistryProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaRegistryProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaRegistryProperties. - */ - public static SchemaRegistryProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaRegistryProperties deserializedSchemaRegistryProperties = new SchemaRegistryProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("namespace".equals(fieldName)) { - deserializedSchemaRegistryProperties.namespace = reader.getString(); - } else if ("storageAccountContainerUrl".equals(fieldName)) { - deserializedSchemaRegistryProperties.storageAccountContainerUrl = reader.getString(); - } else if ("uuid".equals(fieldName)) { - deserializedSchemaRegistryProperties.uuid = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedSchemaRegistryProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedSchemaRegistryProperties.description = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedSchemaRegistryProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaRegistryProperties; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryUpdate.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryUpdate.java deleted file mode 100644 index 05f3cfc4a579..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryUpdate.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * The type used for update operations of the SchemaRegistry. - */ -@Fluent -public final class SchemaRegistryUpdate implements JsonSerializable { - /* - * The managed service identities assigned to this resource. - */ - private SystemAssignedServiceIdentity identity; - - /* - * Resource tags. - */ - private Map tags; - - /* - * The resource-specific properties for this resource. - */ - private SchemaRegistryUpdateProperties properties; - - /** - * Creates an instance of SchemaRegistryUpdate class. - */ - public SchemaRegistryUpdate() { - } - - /** - * Get the identity property: The managed service identities assigned to this resource. - * - * @return the identity value. - */ - public SystemAssignedServiceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The managed service identities assigned to this resource. - * - * @param identity the identity value to set. - * @return the SchemaRegistryUpdate object itself. - */ - public SchemaRegistryUpdate withIdentity(SystemAssignedServiceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the SchemaRegistryUpdate object itself. - */ - public SchemaRegistryUpdate withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SchemaRegistryUpdateProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SchemaRegistryUpdate object itself. - */ - public SchemaRegistryUpdate withProperties(SchemaRegistryUpdateProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaRegistryUpdate from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaRegistryUpdate if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the SchemaRegistryUpdate. - */ - public static SchemaRegistryUpdate fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaRegistryUpdate deserializedSchemaRegistryUpdate = new SchemaRegistryUpdate(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("identity".equals(fieldName)) { - deserializedSchemaRegistryUpdate.identity = SystemAssignedServiceIdentity.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSchemaRegistryUpdate.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedSchemaRegistryUpdate.properties = SchemaRegistryUpdateProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaRegistryUpdate; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryUpdateProperties.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryUpdateProperties.java deleted file mode 100644 index 9aed811d776f..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaRegistryUpdateProperties.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The updatable properties of the SchemaRegistry. - */ -@Fluent -public final class SchemaRegistryUpdateProperties implements JsonSerializable { - /* - * Human-readable display name. - */ - private String displayName; - - /* - * Human-readable description of the schema registry. - */ - private String description; - - /** - * Creates an instance of SchemaRegistryUpdateProperties class. - */ - public SchemaRegistryUpdateProperties() { - } - - /** - * Get the displayName property: Human-readable display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Human-readable display name. - * - * @param displayName the displayName value to set. - * @return the SchemaRegistryUpdateProperties object itself. - */ - public SchemaRegistryUpdateProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: Human-readable description of the schema registry. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Human-readable description of the schema registry. - * - * @param description the description value to set. - * @return the SchemaRegistryUpdateProperties object itself. - */ - public SchemaRegistryUpdateProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("displayName", this.displayName); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaRegistryUpdateProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaRegistryUpdateProperties if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the SchemaRegistryUpdateProperties. - */ - public static SchemaRegistryUpdateProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaRegistryUpdateProperties deserializedSchemaRegistryUpdateProperties - = new SchemaRegistryUpdateProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("displayName".equals(fieldName)) { - deserializedSchemaRegistryUpdateProperties.displayName = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedSchemaRegistryUpdateProperties.description = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaRegistryUpdateProperties; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaType.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaType.java deleted file mode 100644 index 8e48c5748b6c..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaType.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines the schema type. - */ -public final class SchemaType extends ExpandableStringEnum { - /** - * Message Schema schema type. - */ - public static final SchemaType MESSAGE_SCHEMA = fromString("MessageSchema"); - - /** - * Creates a new instance of SchemaType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SchemaType() { - } - - /** - * Creates or finds a SchemaType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SchemaType. - */ - public static SchemaType fromString(String name) { - return fromString(name, SchemaType.class); - } - - /** - * Gets known SchemaType values. - * - * @return known SchemaType values. - */ - public static Collection values() { - return values(SchemaType.class); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersion.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersion.java deleted file mode 100644 index e981d2031fb6..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersion.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaVersionInner; - -/** - * An immutable client-side representation of SchemaVersion. - */ -public interface SchemaVersion { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - SchemaVersionProperties properties(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the inner com.azure.resourcemanager.deviceregistry.fluent.models.SchemaVersionInner object. - * - * @return the inner object. - */ - SchemaVersionInner innerModel(); - - /** - * The entirety of the SchemaVersion definition. - */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - - /** - * The SchemaVersion definition stages. - */ - interface DefinitionStages { - /** - * The first stage of the SchemaVersion definition. - */ - interface Blank extends WithParentResource { - } - - /** - * The stage of the SchemaVersion definition allowing to specify parent resource. - */ - interface WithParentResource { - /** - * Specifies resourceGroupName, schemaRegistryName, schemaName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @return the next definition stage. - */ - WithCreate withExistingSchema(String resourceGroupName, String schemaRegistryName, String schemaName); - } - - /** - * The stage of the SchemaVersion definition which contains all the minimum required properties for the resource - * to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - SchemaVersion create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SchemaVersion create(Context context); - } - - /** - * The stage of the SchemaVersion definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: The resource-specific properties for this resource.. - * - * @param properties The resource-specific properties for this resource. - * @return the next definition stage. - */ - WithCreate withProperties(SchemaVersionProperties properties); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SchemaVersion refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SchemaVersion refresh(Context context); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersionProperties.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersionProperties.java deleted file mode 100644 index ef2cef5c9f23..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersionProperties.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Defines the schema version properties. - */ -@Fluent -public final class SchemaVersionProperties implements JsonSerializable { - /* - * Globally unique, immutable, non-reusable id. - */ - private String uuid; - - /* - * Human-readable description of the schema. - */ - private String description; - - /* - * Schema content. - */ - private String schemaContent; - - /* - * Hash of the schema content. - */ - private String hash; - - /* - * Provisioning state of the resource. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of SchemaVersionProperties class. - */ - public SchemaVersionProperties() { - } - - /** - * Get the uuid property: Globally unique, immutable, non-reusable id. - * - * @return the uuid value. - */ - public String uuid() { - return this.uuid; - } - - /** - * Get the description property: Human-readable description of the schema. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Human-readable description of the schema. - * - * @param description the description value to set. - * @return the SchemaVersionProperties object itself. - */ - public SchemaVersionProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the schemaContent property: Schema content. - * - * @return the schemaContent value. - */ - public String schemaContent() { - return this.schemaContent; - } - - /** - * Set the schemaContent property: Schema content. - * - * @param schemaContent the schemaContent value to set. - * @return the SchemaVersionProperties object itself. - */ - public SchemaVersionProperties withSchemaContent(String schemaContent) { - this.schemaContent = schemaContent; - return this; - } - - /** - * Get the hash property: Hash of the schema content. - * - * @return the hash value. - */ - public String hash() { - return this.hash; - } - - /** - * Get the provisioningState property: Provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (schemaContent() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property schemaContent in model SchemaVersionProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SchemaVersionProperties.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("schemaContent", this.schemaContent); - jsonWriter.writeStringField("description", this.description); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SchemaVersionProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SchemaVersionProperties if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SchemaVersionProperties. - */ - public static SchemaVersionProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SchemaVersionProperties deserializedSchemaVersionProperties = new SchemaVersionProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("schemaContent".equals(fieldName)) { - deserializedSchemaVersionProperties.schemaContent = reader.getString(); - } else if ("uuid".equals(fieldName)) { - deserializedSchemaVersionProperties.uuid = reader.getString(); - } else if ("description".equals(fieldName)) { - deserializedSchemaVersionProperties.description = reader.getString(); - } else if ("hash".equals(fieldName)) { - deserializedSchemaVersionProperties.hash = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedSchemaVersionProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedSchemaVersionProperties; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersions.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersions.java deleted file mode 100644 index 5bf06a2dabee..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SchemaVersions.java +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of SchemaVersions. - */ -public interface SchemaVersions { - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName, Context context); - - /** - * Get a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion. - */ - SchemaVersion get(String resourceGroupName, String schemaRegistryName, String schemaName, String schemaVersionName); - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - String schemaVersionName, Context context); - - /** - * Delete a SchemaVersion. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param schemaVersionName Schema version name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String schemaRegistryName, String schemaName, String schemaVersionName); - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySchema(String resourceGroupName, String schemaRegistryName, String schemaName); - - /** - * List SchemaVersion resources by Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a SchemaVersion list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySchema(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context); - - /** - * Get a SchemaVersion. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion along with {@link Response}. - */ - SchemaVersion getById(String id); - - /** - * Get a SchemaVersion. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a SchemaVersion along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a SchemaVersion. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a SchemaVersion. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SchemaVersion resource. - * - * @param name resource name. - * @return the first stage of the new SchemaVersion definition. - */ - SchemaVersion.DefinitionStages.Blank define(String name); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Schemas.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Schemas.java deleted file mode 100644 index 458c2cae223d..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Schemas.java +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of Schemas. - */ -public interface Schemas { - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context); - - /** - * Get a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema. - */ - Schema get(String resourceGroupName, String schemaRegistryName, String schemaName); - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String resourceGroupName, String schemaRegistryName, String schemaName, - Context context); - - /** - * Delete a Schema. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param schemaName Schema name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String schemaRegistryName, String schemaName); - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySchemaRegistry(String resourceGroupName, String schemaRegistryName); - - /** - * List Schema resources by SchemaRegistry. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param schemaRegistryName Schema registry name parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of a Schema list operation as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySchemaRegistry(String resourceGroupName, String schemaRegistryName, Context context); - - /** - * Get a Schema. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema along with {@link Response}. - */ - Schema getById(String id); - - /** - * Get a Schema. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a Schema along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Schema. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a Schema. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Schema resource. - * - * @param name resource name. - * @return the first stage of the new Schema definition. - */ - Schema.DefinitionStages.Blank define(String name); -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SystemAssignedServiceIdentity.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SystemAssignedServiceIdentity.java deleted file mode 100644 index 1e29f42eddab..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SystemAssignedServiceIdentity.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Managed service identity (either system assigned, or none). - */ -@Fluent -public final class SystemAssignedServiceIdentity implements JsonSerializable { - /* - * The service principal ID of the system assigned identity. This property will only be provided for a system - * assigned identity. - */ - private String principalId; - - /* - * The tenant ID of the system assigned identity. This property will only be provided for a system assigned - * identity. - */ - private String tenantId; - - /* - * The type of managed identity assigned to this resource. - */ - private SystemAssignedServiceIdentityType type; - - /** - * Creates an instance of SystemAssignedServiceIdentity class. - */ - public SystemAssignedServiceIdentity() { - } - - /** - * Get the principalId property: The service principal ID of the system assigned identity. This property will only - * be provided for a system assigned identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for - * a system assigned identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The type of managed identity assigned to this resource. - * - * @return the type value. - */ - public SystemAssignedServiceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The type of managed identity assigned to this resource. - * - * @param type the type value to set. - * @return the SystemAssignedServiceIdentity object itself. - */ - public SystemAssignedServiceIdentity withType(SystemAssignedServiceIdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property type in model SystemAssignedServiceIdentity")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SystemAssignedServiceIdentity.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SystemAssignedServiceIdentity from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SystemAssignedServiceIdentity if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SystemAssignedServiceIdentity. - */ - public static SystemAssignedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SystemAssignedServiceIdentity deserializedSystemAssignedServiceIdentity - = new SystemAssignedServiceIdentity(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedSystemAssignedServiceIdentity.type - = SystemAssignedServiceIdentityType.fromString(reader.getString()); - } else if ("principalId".equals(fieldName)) { - deserializedSystemAssignedServiceIdentity.principalId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedSystemAssignedServiceIdentity.tenantId = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSystemAssignedServiceIdentity; - }); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SystemAssignedServiceIdentityType.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SystemAssignedServiceIdentityType.java deleted file mode 100644 index 1d08927e99f8..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/SystemAssignedServiceIdentityType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Type of managed service identity (either system assigned, or none). - */ -public final class SystemAssignedServiceIdentityType extends ExpandableStringEnum { - /** - * No managed system identity. - */ - public static final SystemAssignedServiceIdentityType NONE = fromString("None"); - - /** - * System assigned managed system identity. - */ - public static final SystemAssignedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); - - /** - * Creates a new instance of SystemAssignedServiceIdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SystemAssignedServiceIdentityType() { - } - - /** - * Creates or finds a SystemAssignedServiceIdentityType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SystemAssignedServiceIdentityType. - */ - public static SystemAssignedServiceIdentityType fromString(String name) { - return fromString(name, SystemAssignedServiceIdentityType.class); - } - - /** - * Gets known SystemAssignedServiceIdentityType values. - * - * @return known SystemAssignedServiceIdentityType values. - */ - public static Collection values() { - return values(SystemAssignedServiceIdentityType.class); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-deviceregistry/proxy-config.json b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-deviceregistry/proxy-config.json index 3cb6e4ed9293..fa86168e34db 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-deviceregistry/proxy-config.json +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-deviceregistry/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.deviceregistry.implementation.AssetEndpointProfilesClientImpl$AssetEndpointProfilesService"],["com.azure.resourcemanager.deviceregistry.implementation.AssetsClientImpl$AssetsService"],["com.azure.resourcemanager.deviceregistry.implementation.BillingContainersClientImpl$BillingContainersService"],["com.azure.resourcemanager.deviceregistry.implementation.DiscoveredAssetEndpointProfilesClientImpl$DiscoveredAssetEndpointProfilesService"],["com.azure.resourcemanager.deviceregistry.implementation.DiscoveredAssetsClientImpl$DiscoveredAssetsService"],["com.azure.resourcemanager.deviceregistry.implementation.OperationStatusClientImpl$OperationStatusService"],["com.azure.resourcemanager.deviceregistry.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.deviceregistry.implementation.SchemaRegistriesClientImpl$SchemaRegistriesService"],["com.azure.resourcemanager.deviceregistry.implementation.SchemaVersionsClientImpl$SchemaVersionsService"],["com.azure.resourcemanager.deviceregistry.implementation.SchemasClientImpl$SchemasService"]] \ No newline at end of file +[["com.azure.resourcemanager.deviceregistry.implementation.AssetEndpointProfilesClientImpl$AssetEndpointProfilesService"],["com.azure.resourcemanager.deviceregistry.implementation.AssetsClientImpl$AssetsService"],["com.azure.resourcemanager.deviceregistry.implementation.BillingContainersClientImpl$BillingContainersService"],["com.azure.resourcemanager.deviceregistry.implementation.OperationStatusClientImpl$OperationStatusService"],["com.azure.resourcemanager.deviceregistry.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesCreateOrReplaceSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesCreateOrReplaceSamples.java index dc391320bcae..655bb380e04f 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesCreateOrReplaceSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesCreateOrReplaceSamples.java @@ -16,7 +16,7 @@ */ public final class AssetEndpointProfilesCreateOrReplaceSamples { /* - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile_With_DiscoveredAepRef.json */ /** * Sample code: Create_AssetEndpointProfile_With_DiscoveredAepRef. @@ -42,7 +42,7 @@ public static void createAssetEndpointProfileWithDiscoveredAepRef( } /* - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json */ /** * Sample code: Create_AssetEndpointProfile. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesDeleteSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesDeleteSamples.java index 39666bcc05e2..bffb0fae3859 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesDeleteSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class AssetEndpointProfilesDeleteSamples { /* - * x-ms-original-file: 2024-09-01-preview/Delete_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json */ /** * Sample code: Delete_AssetEndpointProfile. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesGetByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesGetByResourceGroupSamples.java index b663bea06602..49d159e6002a 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesGetByResourceGroupSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class AssetEndpointProfilesGetByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile.json */ /** * Sample code: Get_AssetEndpointProfile. @@ -23,7 +23,7 @@ public static void getAssetEndpointProfile(com.azure.resourcemanager.deviceregis } /* - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json */ /** * Sample code: Get_AssetEndpointProfile_With_SyncStatus. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesListByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesListByResourceGroupSamples.java index e787068197ae..8ad3acd56b14 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesListByResourceGroupSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class AssetEndpointProfilesListByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_ResourceGroup.json */ /** * Sample code: List_AssetEndpointProfiles_ResourceGroup. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesListSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesListSamples.java index ea0d22e16586..283ab95580c0 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesListSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesListSamples.java @@ -9,7 +9,7 @@ */ public final class AssetEndpointProfilesListSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_Subscription.json */ /** * Sample code: List_AssetEndpointProfiles_Subscription. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesUpdateSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesUpdateSamples.java index 0b6c02fe658e..535278cf0c28 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesUpdateSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetEndpointProfilesUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class AssetEndpointProfilesUpdateSamples { /* - * x-ms-original-file: 2024-09-01-preview/Update_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json */ /** * Sample code: Update_AssetEndpointProfile. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsCreateOrReplaceSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsCreateOrReplaceSamples.java index edd3db1aa956..05cd5ada0578 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsCreateOrReplaceSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsCreateOrReplaceSamples.java @@ -22,7 +22,7 @@ */ public final class AssetsCreateOrReplaceSamples { /* - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_DiscoveredAssetRef.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_DiscoveredAssetRef.json */ /** * Sample code: Create_Asset_With_DiscoveredAssetRefs. @@ -89,7 +89,7 @@ public final class AssetsCreateOrReplaceSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_ExternalAssetId.json */ /** * Sample code: Create_Asset_Without_ExternalAssetId. @@ -154,7 +154,7 @@ public final class AssetsCreateOrReplaceSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_ExternalAssetId.json */ /** * Sample code: Create_Asset_With_ExternalAssetId. @@ -220,7 +220,7 @@ public final class AssetsCreateOrReplaceSamples { } /* - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_DisplayName.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_DisplayName.json */ /** * Sample code: Create_Asset_Without_DisplayName. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsDeleteSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsDeleteSamples.java index ab590b114b16..0d9e66e82986 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsDeleteSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class AssetsDeleteSamples { /* - * x-ms-original-file: 2024-09-01-preview/Delete_Asset.json + * x-ms-original-file: 2024-11-01/Delete_Asset.json */ /** * Sample code: Delete_Asset. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsGetByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsGetByResourceGroupSamples.java index 6d2718dfa05d..9608db4782f1 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsGetByResourceGroupSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class AssetsGetByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_Asset_With_SyncStatus.json */ /** * Sample code: Get_Asset_With_SyncStatus. @@ -22,7 +22,7 @@ public static void getAssetWithSyncStatus(com.azure.resourcemanager.deviceregist } /* - * x-ms-original-file: 2024-09-01-preview/Get_Asset.json + * x-ms-original-file: 2024-11-01/Get_Asset.json */ /** * Sample code: Get_Asset. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsListByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsListByResourceGroupSamples.java index 7181801b9f46..8eca96bc556e 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsListByResourceGroupSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class AssetsListByResourceGroupSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_Assets_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json */ /** * Sample code: List_Assets_ResourceGroup. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsListSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsListSamples.java index 053425992e96..7b01c8912711 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsListSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsListSamples.java @@ -9,7 +9,7 @@ */ public final class AssetsListSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_Assets_Subscription.json + * x-ms-original-file: 2024-11-01/List_Assets_Subscription.json */ /** * Sample code: List_Assets_Subscription. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsUpdateSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsUpdateSamples.java index d9aab729ee3b..1a4422742df4 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsUpdateSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/AssetsUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class AssetsUpdateSamples { /* - * x-ms-original-file: 2024-09-01-preview/Update_Asset.json + * x-ms-original-file: 2024-11-01/Update_Asset.json */ /** * Sample code: Update_Asset. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersGetSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersGetSamples.java index 59d3ddaea298..3e99b8c30549 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersGetSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersGetSamples.java @@ -9,7 +9,7 @@ */ public final class BillingContainersGetSamples { /* - * x-ms-original-file: 2024-09-01-preview/Get_BillingContainer.json + * x-ms-original-file: 2024-11-01/Get_BillingContainer.json */ /** * Sample code: Get_BillingContainer. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersListSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersListSamples.java index 91c0c29f8ada..c168af42e5e6 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersListSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersListSamples.java @@ -9,7 +9,7 @@ */ public final class BillingContainersListSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_BillingContainers_Subscription.json + * x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json */ /** * Sample code: List_BillingContainers_Subscription. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesCreateOrReplaceSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesCreateOrReplaceSamples.java deleted file mode 100644 index 980379745ac5..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesCreateOrReplaceSamples.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileProperties; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for DiscoveredAssetEndpointProfiles CreateOrReplace. - */ -public final class DiscoveredAssetEndpointProfilesCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAssetEndpointProfile.json - */ - /** - * Sample code: Create_DiscoveredAssetEndpointProfile. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - createDiscoveredAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles() - .define("my-discoveredassetendpointprofile") - .withRegion("West Europe") - .withExistingResourceGroup("myResourceGroup") - .withExtendedLocation(new ExtendedLocation().withType("CustomLocation") - .withName( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) - .withTags(mapOf("site", "building-1")) - .withProperties(new DiscoveredAssetEndpointProfileProperties() - .withTargetAddress("https://www.example.com/myTargetAddress") - .withAdditionalConfiguration("{\"foo\": \"bar\"}") - .withSupportedAuthenticationMethods(Arrays.asList(AuthenticationMethod.ANONYMOUS, - AuthenticationMethod.CERTIFICATE, AuthenticationMethod.USERNAME_PASSWORD)) - .withEndpointProfileType("myEndpointProfileType") - .withDiscoveryId("11111111-1111-1111-1111-111111111111") - .withVersion(73766L)) - .create(); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesDeleteSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesDeleteSamples.java deleted file mode 100644 index 66932617ea70..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesDeleteSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for DiscoveredAssetEndpointProfiles Delete. - */ -public final class DiscoveredAssetEndpointProfilesDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAssetEndpointProfile.json - */ - /** - * Sample code: Delete_DiscoveredAssetEndpointProfile. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - deleteDiscoveredAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles() - .delete("myResourceGroup", "my-discoveredassetendpointprofile", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesGetByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesGetByResourceGroupSamples.java deleted file mode 100644 index 902d00108312..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesGetByResourceGroupSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for DiscoveredAssetEndpointProfiles GetByResourceGroup. - */ -public final class DiscoveredAssetEndpointProfilesGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json - */ - /** - * Sample code: Get_DiscoveredAssetEndpointProfile. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - getDiscoveredAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles() - .getByResourceGroupWithResponse("myResourceGroup", "my-discoveredassetendpointprofile", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListByResourceGroupSamples.java deleted file mode 100644 index e5ba67836217..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListByResourceGroupSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for DiscoveredAssetEndpointProfiles ListByResourceGroup. - */ -public final class DiscoveredAssetEndpointProfilesListByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_ResourceGroup.json - */ - /** - * Sample code: List_DiscoveredAssetEndpointProfiles_ResourceGroup. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void listDiscoveredAssetEndpointProfilesResourceGroup( - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles() - .listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListSamples.java deleted file mode 100644 index 3e70c95f7add..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for DiscoveredAssetEndpointProfiles List. - */ -public final class DiscoveredAssetEndpointProfilesListSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json - */ - /** - * Sample code: List_DiscoveredAssetEndpointProfiles_Subscription. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void listDiscoveredAssetEndpointProfilesSubscription( - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssetEndpointProfiles().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesUpdateSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesUpdateSamples.java deleted file mode 100644 index 9f1f74a9c58b..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesUpdateSamples.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfile; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdateProperties; -import java.util.Arrays; - -/** - * Samples for DiscoveredAssetEndpointProfiles Update. - */ -public final class DiscoveredAssetEndpointProfilesUpdateSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAssetEndpointProfile.json - */ - /** - * Sample code: Update_DiscoveredAssetEndpointProfile. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - updateDiscoveredAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - DiscoveredAssetEndpointProfile resource = manager.discoveredAssetEndpointProfiles() - .getByResourceGroupWithResponse("myResourceGroup", "my-discoveredassetendpointprofile", - com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new DiscoveredAssetEndpointProfileUpdateProperties() - .withTargetAddress("https://www.example.com/myTargetAddress") - .withAdditionalConfiguration("{\"foo\": \"bar\"}") - .withSupportedAuthenticationMethods( - Arrays.asList(AuthenticationMethod.ANONYMOUS, AuthenticationMethod.CERTIFICATE)) - .withEndpointProfileType("myEndpointProfileType") - .withDiscoveryId("11111111-1111-1111-1111-111111111111") - .withVersion(73766L)) - .apply(); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsCreateOrReplaceSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsCreateOrReplaceSamples.java deleted file mode 100644 index 7b827e572ffa..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsCreateOrReplaceSamples.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetProperties; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredDataPoint; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredDataset; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredEvent; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import com.azure.resourcemanager.deviceregistry.models.Topic; -import com.azure.resourcemanager.deviceregistry.models.TopicRetainType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for DiscoveredAssets CreateOrReplace. - */ -public final class DiscoveredAssetsCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAsset.json - */ - /** - * Sample code: Create_DiscoveredAsset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void createDiscoveredAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets() - .define("my-discoveredasset") - .withRegion("West Europe") - .withExistingResourceGroup("myResourceGroup") - .withExtendedLocation(new ExtendedLocation().withType("CustomLocation") - .withName( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1")) - .withTags(mapOf("site", "building-1")) - .withProperties(new DiscoveredAssetProperties().withAssetEndpointProfileRef("myAssetEndpointProfile") - .withDiscoveryId("11111111-1111-1111-1111-111111111111") - .withVersion(73766L) - .withManufacturer("Contoso") - .withManufacturerUri("https://www.contoso.com/manufacturerUri") - .withModel("ContosoModel") - .withProductCode("fakeTokenPlaceholder") - .withHardwareRevision("1.0") - .withSoftwareRevision("2.0") - .withDocumentationUri("https://www.example.com/manual") - .withSerialNumber("64-103816-519918-8") - .withDefaultDatasetsConfiguration( - "{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}") - .withDefaultEventsConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}") - .withDefaultTopic(new Topic().withPath("/path/defaultTopic").withRetain(TopicRetainType.KEEP)) - .withDatasets(Arrays.asList(new DiscoveredDataset().withName("dataset1") - .withDatasetConfiguration("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}") - .withTopic(new Topic().withPath("/path/dataset1").withRetain(TopicRetainType.KEEP)) - .withDataPoints(Arrays.asList( - new DiscoveredDataPoint().withName("dataPoint1") - .withDataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1") - .withDataPointConfiguration( - "{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"), - new DiscoveredDataPoint().withName("dataPoint2") - .withDataSource("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2") - .withDataPointConfiguration( - "{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"))))) - .withEvents(Arrays.asList( - new DiscoveredEvent().withName("event1") - .withEventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3") - .withEventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}") - .withTopic(new Topic().withPath("/path/event1").withRetain(TopicRetainType.KEEP)), - new DiscoveredEvent().withName("event2") - .withEventNotifier("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4") - .withEventConfiguration("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}")))) - .create(); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsDeleteSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsDeleteSamples.java deleted file mode 100644 index 0d59bfe0d1a5..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for DiscoveredAssets Delete. - */ -public final class DiscoveredAssetsDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAsset.json - */ - /** - * Sample code: Delete_DiscoveredAsset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteDiscoveredAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets().delete("myResourceGroup", "my-discoveredasset", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsGetByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsGetByResourceGroupSamples.java deleted file mode 100644 index 0023b0ec8197..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for DiscoveredAssets GetByResourceGroup. - */ -public final class DiscoveredAssetsGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAsset.json - */ - /** - * Sample code: Get_DiscoveredAsset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getDiscoveredAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets() - .getByResourceGroupWithResponse("myResourceGroup", "my-discoveredasset", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsListByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsListByResourceGroupSamples.java deleted file mode 100644 index fd6cea3872ad..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsListByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for DiscoveredAssets ListByResourceGroup. - */ -public final class DiscoveredAssetsListByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_ResourceGroup.json - */ - /** - * Sample code: List_DiscoveredAssets_ResourceGroup. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listDiscoveredAssetsResourceGroup(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsListSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsListSamples.java deleted file mode 100644 index e8998ccfa8bd..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for DiscoveredAssets List. - */ -public final class DiscoveredAssetsListSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json - */ - /** - * Sample code: List_DiscoveredAssets_Subscription. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listDiscoveredAssetsSubscription(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.discoveredAssets().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsUpdateSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsUpdateSamples.java deleted file mode 100644 index 41de069e6c7e..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetsUpdateSamples.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAsset; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetUpdateProperties; -import com.azure.resourcemanager.deviceregistry.models.Topic; -import com.azure.resourcemanager.deviceregistry.models.TopicRetainType; - -/** - * Samples for DiscoveredAssets Update. - */ -public final class DiscoveredAssetsUpdateSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAsset.json - */ - /** - * Sample code: Update_DiscoveredAsset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void updateDiscoveredAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - DiscoveredAsset resource = manager.discoveredAssets() - .getByResourceGroupWithResponse("myResourceGroup", "my-discoveredasset", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties( - new DiscoveredAssetUpdateProperties().withDocumentationUri("https://www.example.com/manual-2") - .withDefaultTopic(new Topic().withPath("/path/defaultTopic").withRetain(TopicRetainType.NEVER))) - .apply(); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/OperationStatusGetSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/OperationStatusGetSamples.java index 75ca8405dbfe..6d8f739d390e 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/OperationStatusGetSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/OperationStatusGetSamples.java @@ -9,7 +9,7 @@ */ public final class OperationStatusGetSamples { /* - * x-ms-original-file: 2024-09-01-preview/Get_OperationStatus.json + * x-ms-original-file: 2024-11-01/Get_OperationStatus.json */ /** * Sample code: Get_OperationStatus. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListSamples.java index 675cc123c41f..da4d08aa6b60 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListSamples.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2024-09-01-preview/List_Operations.json + * x-ms-original-file: 2024-11-01/List_Operations.json */ /** * Sample code: List_Operations. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesCreateOrReplaceSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesCreateOrReplaceSamples.java deleted file mode 100644 index aedf0714bcd2..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesCreateOrReplaceSamples.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryProperties; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentity; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for SchemaRegistries CreateOrReplace. - */ -public final class SchemaRegistriesCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_SchemaRegistry.json - */ - /** - * Sample code: Create_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void createSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries() - .define("my-schema-registry") - .withRegion("West Europe") - .withExistingResourceGroup("myResourceGroup") - .withTags(mapOf()) - .withProperties(new SchemaRegistryProperties().withNamespace("sr-namespace-001") - .withDisplayName("Schema Registry namespace 001") - .withDescription("This is a sample Schema Registry") - .withStorageAccountContainerUrl("my-blob-storage.blob.core.windows.net/my-container")) - .withIdentity(new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.NONE)) - .create(); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesDeleteSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesDeleteSamples.java deleted file mode 100644 index 118576c57f94..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for SchemaRegistries Delete. - */ -public final class SchemaRegistriesDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaRegistry.json - */ - /** - * Sample code: Delete_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries().delete("myResourceGroup", "my-schema-registry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesGetByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesGetByResourceGroupSamples.java deleted file mode 100644 index 87c8c6c91764..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for SchemaRegistries GetByResourceGroup. - */ -public final class SchemaRegistriesGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_SchemaRegistry.json - */ - /** - * Sample code: Get_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries() - .getByResourceGroupWithResponse("myResourceGroup", "my-schema-registry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListByResourceGroupSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListByResourceGroupSamples.java deleted file mode 100644 index 53766e391b4c..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for SchemaRegistries ListByResourceGroup. - */ -public final class SchemaRegistriesListByResourceGroupSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_ResourceGroup.json - */ - /** - * Sample code: List_SchemaRegistries_ResourceGroup. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listSchemaRegistriesResourceGroup(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListSamples.java deleted file mode 100644 index cda2ad2af26c..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for SchemaRegistries List. - */ -public final class SchemaRegistriesListSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_Subscription.json - */ - /** - * Sample code: List_SchemaRegistries_Subscription. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listSchemaRegistriesSubscription(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaRegistries().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesUpdateSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesUpdateSamples.java deleted file mode 100644 index 136bb88fa550..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesUpdateSamples.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistry; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdateProperties; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for SchemaRegistries Update. - */ -public final class SchemaRegistriesUpdateSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Update_SchemaRegistry.json - */ - /** - * Sample code: Update_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void updateSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - SchemaRegistry resource = manager.schemaRegistries() - .getByResourceGroupWithResponse("myResourceGroup", "my-schema-registry", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withTags(mapOf()) - .withProperties(new SchemaRegistryUpdateProperties().withDisplayName("Schema Registry namespace 001") - .withDescription("This is a sample Schema Registry")) - .apply(); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsCreateOrReplaceSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsCreateOrReplaceSamples.java deleted file mode 100644 index 6a5824352539..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsCreateOrReplaceSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.resourcemanager.deviceregistry.models.SchemaVersionProperties; - -/** - * Samples for SchemaVersions CreateOrReplace. - */ -public final class SchemaVersionsCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_SchemaVersion.json - */ - /** - * Sample code: Create_SchemaVersion. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void createSchemaVersion(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaVersions() - .define("1") - .withExistingSchema("myResourceGroup", "my-schema-registry", "my-schema") - .withProperties(new SchemaVersionProperties().withDescription("Schema version 1") - .withSchemaContent( - "{\"$schema\": \"http://json-schema.org/draft-07/schema#\",\"type\": \"object\",\"properties\": {\"humidity\": {\"type\": \"string\"},\"temperature\": {\"type\":\"number\"}}}")) - .create(); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsDeleteSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsDeleteSamples.java deleted file mode 100644 index 6fcc426be6c3..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsDeleteSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for SchemaVersions Delete. - */ -public final class SchemaVersionsDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaVersion.json - */ - /** - * Sample code: Delete_SchemaVersion. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteSchemaVersion(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaVersions() - .deleteWithResponse("myResourceGroup", "my-schema-registry", "my-schema", "1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsGetSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsGetSamples.java deleted file mode 100644 index 138db4a3ba6e..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for SchemaVersions Get. - */ -public final class SchemaVersionsGetSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_SchemaVersion.json - */ - /** - * Sample code: Get_SchemaVersion. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getSchemaVersion(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaVersions() - .getWithResponse("myResourceGroup", "my-schema-registry", "my-schema", "1", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsListBySchemaSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsListBySchemaSamples.java deleted file mode 100644 index da174a8b4672..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsListBySchemaSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for SchemaVersions ListBySchema. - */ -public final class SchemaVersionsListBySchemaSamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_SchemaVersions_Schema.json - */ - /** - * Sample code: List_SchemaVersions_Schema. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listSchemaVersionsSchema(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemaVersions() - .listBySchema("myResourceGroup", "my-schema-registry", "my-schema", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasCreateOrReplaceSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasCreateOrReplaceSamples.java deleted file mode 100644 index d063442e01d6..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasCreateOrReplaceSamples.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.resourcemanager.deviceregistry.models.Format; -import com.azure.resourcemanager.deviceregistry.models.SchemaProperties; -import com.azure.resourcemanager.deviceregistry.models.SchemaType; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for Schemas CreateOrReplace. - */ -public final class SchemasCreateOrReplaceSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Create_Schema.json - */ - /** - * Sample code: Create_Schema. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void createSchema(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemas() - .define("my-schema") - .withExistingSchemaRegistry("myResourceGroup", "my-schema-registry") - .withProperties(new SchemaProperties().withDisplayName("My Schema") - .withDescription("This is a sample Schema") - .withFormat(Format.JSON_SCHEMA_DRAFT7) - .withSchemaType(SchemaType.MESSAGE_SCHEMA) - .withTags(mapOf("sampleKey", "fakeTokenPlaceholder"))) - .create(); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasDeleteSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasDeleteSamples.java deleted file mode 100644 index a9a7fb3b83db..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for Schemas Delete. - */ -public final class SchemasDeleteSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Delete_Schema.json - */ - /** - * Sample code: Delete_Schema. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteSchema(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemas() - .deleteWithResponse("myResourceGroup", "my-schema-registry", "my-schema", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasGetSamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasGetSamples.java deleted file mode 100644 index 52af6cc3fdc2..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for Schemas Get. - */ -public final class SchemasGetSamples { - /* - * x-ms-original-file: 2024-09-01-preview/Get_Schema.json - */ - /** - * Sample code: Schemas_Get. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void schemasGet(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemas() - .getWithResponse("myResourceGroup", "my-schema-registry", "my-schema", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasListBySchemaRegistrySamples.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasListBySchemaRegistrySamples.java deleted file mode 100644 index 4fd405c92e5b..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/samples/java/com/azure/resourcemanager/deviceregistry/generated/SchemasListBySchemaRegistrySamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -/** - * Samples for Schemas ListBySchemaRegistry. - */ -public final class SchemasListBySchemaRegistrySamples { - /* - * x-ms-original-file: 2024-09-01-preview/List_Schemas_SchemaRegistry.json - */ - /** - * Sample code: List_Schemas_SchemaRegistry. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listSchemasSchemaRegistry(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.schemas() - .listBySchemaRegistry("myResourceGroup", "my-schema-registry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersGetWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersGetWithResponseMockTests.java index 8901a275a6f6..d465e0692e20 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersGetWithResponseMockTests.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersGetWithResponseMockTests.java @@ -20,7 +20,7 @@ public final class BillingContainersGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Deleting\"},\"etag\":\"cogjltdtbn\",\"id\":\"adoocrkvc\",\"name\":\"khnvpam\",\"type\":\"gxqquezik\"}"; + = "{\"properties\":{\"provisioningState\":\"Accepted\"},\"etag\":\"civfsnkymuctq\",\"id\":\"fbebrjcxer\",\"name\":\"uwutttxfvjrbi\",\"type\":\"phxepcyvahf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -30,7 +30,7 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); BillingContainer response - = manager.billingContainers().getWithResponse("xdy", com.azure.core.util.Context.NONE).getValue(); + = manager.billingContainers().getWithResponse("biqylihkaet", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersListMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersListMockTests.java index d6bfd0372c2c..f3cd2337d3a5 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersListMockTests.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/BillingContainersListMockTests.java @@ -21,7 +21,7 @@ public final class BillingContainersListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\"},\"etag\":\"kallatmel\",\"id\":\"ipicc\",\"name\":\"zkzivgvvcnay\",\"type\":\"hyrnxxmu\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\"},\"etag\":\"qxj\",\"id\":\"ujqgidok\",\"name\":\"jljyoxgv\",\"type\":\"ltbgsncghkj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileInnerTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileInnerTests.java deleted file mode 100644 index 8d5b39b78b32..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileInnerTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.fluent.models.DiscoveredAssetEndpointProfileInner; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileProperties; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredAssetEndpointProfileInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredAssetEndpointProfileInner model = BinaryData.fromString( - "{\"properties\":{\"targetAddress\":\"xbczwtruwiqz\",\"additionalConfiguration\":\"j\",\"supportedAuthenticationMethods\":[\"Certificate\"],\"endpointProfileType\":\"myokacspkwlh\",\"discoveryId\":\"dobpxjmflbvvn\",\"version\":2925444529354115235,\"provisioningState\":\"Canceled\"},\"extendedLocation\":{\"type\":\"ciwwzjuqkhr\",\"name\":\"ajiwkuo\"},\"location\":\"skghsauuimj\",\"tags\":{\"ugidyjrr\":\"ied\",\"v\":\"byao\",\"onpc\":\"xc\",\"eggzfb\":\"hocohslkev\"},\"id\":\"hfmvfaxkffe\",\"name\":\"ithlvmezyvshxm\",\"type\":\"sbbzo\"}") - .toObject(DiscoveredAssetEndpointProfileInner.class); - Assertions.assertEquals("skghsauuimj", model.location()); - Assertions.assertEquals("ied", model.tags().get("ugidyjrr")); - Assertions.assertEquals("xbczwtruwiqz", model.properties().targetAddress()); - Assertions.assertEquals("j", model.properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.CERTIFICATE, - model.properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("myokacspkwlh", model.properties().endpointProfileType()); - Assertions.assertEquals("dobpxjmflbvvn", model.properties().discoveryId()); - Assertions.assertEquals(2925444529354115235L, model.properties().version()); - Assertions.assertEquals("ciwwzjuqkhr", model.extendedLocation().type()); - Assertions.assertEquals("ajiwkuo", model.extendedLocation().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredAssetEndpointProfileInner model - = new DiscoveredAssetEndpointProfileInner().withLocation("skghsauuimj") - .withTags(mapOf("ugidyjrr", "ied", "v", "byao", "onpc", "xc", "eggzfb", "hocohslkev")) - .withProperties(new DiscoveredAssetEndpointProfileProperties().withTargetAddress("xbczwtruwiqz") - .withAdditionalConfiguration("j") - .withSupportedAuthenticationMethods(Arrays.asList(AuthenticationMethod.CERTIFICATE)) - .withEndpointProfileType("myokacspkwlh") - .withDiscoveryId("dobpxjmflbvvn") - .withVersion(2925444529354115235L)) - .withExtendedLocation(new ExtendedLocation().withType("ciwwzjuqkhr").withName("ajiwkuo")); - model = BinaryData.fromObject(model).toObject(DiscoveredAssetEndpointProfileInner.class); - Assertions.assertEquals("skghsauuimj", model.location()); - Assertions.assertEquals("ied", model.tags().get("ugidyjrr")); - Assertions.assertEquals("xbczwtruwiqz", model.properties().targetAddress()); - Assertions.assertEquals("j", model.properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.CERTIFICATE, - model.properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("myokacspkwlh", model.properties().endpointProfileType()); - Assertions.assertEquals("dobpxjmflbvvn", model.properties().discoveryId()); - Assertions.assertEquals(2925444529354115235L, model.properties().version()); - Assertions.assertEquals("ciwwzjuqkhr", model.extendedLocation().type()); - Assertions.assertEquals("ajiwkuo", model.extendedLocation().name()); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileListResultTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileListResultTests.java deleted file mode 100644 index 2b5be14f640d..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileListResultTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.implementation.models.DiscoveredAssetEndpointProfileListResult; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredAssetEndpointProfileListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredAssetEndpointProfileListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"targetAddress\":\"konocu\",\"additionalConfiguration\":\"klyaxuconu\",\"supportedAuthenticationMethods\":[\"Certificate\"],\"endpointProfileType\":\"kbeype\",\"discoveryId\":\"rmjmwvvjektc\",\"version\":9050422304173328061,\"provisioningState\":\"Failed\"},\"extendedLocation\":{\"type\":\"wlrsffrzpwv\",\"name\":\"qdqgbi\"},\"location\":\"lihkaetcktvfc\",\"tags\":{\"jf\":\"snkymuctq\",\"fuwutttxf\":\"ebrjcxe\",\"hfnljkyq\":\"jrbirphxepcyv\"},\"id\":\"j\",\"name\":\"uujqgidokgjljyo\",\"type\":\"gvcl\"}],\"nextLink\":\"gsncghkjeszz\"}") - .toObject(DiscoveredAssetEndpointProfileListResult.class); - Assertions.assertEquals("lihkaetcktvfc", model.value().get(0).location()); - Assertions.assertEquals("snkymuctq", model.value().get(0).tags().get("jf")); - Assertions.assertEquals("konocu", model.value().get(0).properties().targetAddress()); - Assertions.assertEquals("klyaxuconu", model.value().get(0).properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.CERTIFICATE, - model.value().get(0).properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("kbeype", model.value().get(0).properties().endpointProfileType()); - Assertions.assertEquals("rmjmwvvjektc", model.value().get(0).properties().discoveryId()); - Assertions.assertEquals(9050422304173328061L, model.value().get(0).properties().version()); - Assertions.assertEquals("wlrsffrzpwv", model.value().get(0).extendedLocation().type()); - Assertions.assertEquals("qdqgbi", model.value().get(0).extendedLocation().name()); - Assertions.assertEquals("gsncghkjeszz", model.nextLink()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilePropertiesTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilePropertiesTests.java deleted file mode 100644 index 065da1e60d85..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilePropertiesTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredAssetEndpointProfilePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredAssetEndpointProfileProperties model = BinaryData.fromString( - "{\"targetAddress\":\"gigr\",\"additionalConfiguration\":\"burvjxxjnspy\",\"supportedAuthenticationMethods\":[\"Anonymous\"],\"endpointProfileType\":\"oenkouknvudwti\",\"discoveryId\":\"kbldngkpocipa\",\"version\":2857636660248584289,\"provisioningState\":\"Failed\"}") - .toObject(DiscoveredAssetEndpointProfileProperties.class); - Assertions.assertEquals("gigr", model.targetAddress()); - Assertions.assertEquals("burvjxxjnspy", model.additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.ANONYMOUS, model.supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("oenkouknvudwti", model.endpointProfileType()); - Assertions.assertEquals("kbldngkpocipa", model.discoveryId()); - Assertions.assertEquals(2857636660248584289L, model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredAssetEndpointProfileProperties model - = new DiscoveredAssetEndpointProfileProperties().withTargetAddress("gigr") - .withAdditionalConfiguration("burvjxxjnspy") - .withSupportedAuthenticationMethods(Arrays.asList(AuthenticationMethod.ANONYMOUS)) - .withEndpointProfileType("oenkouknvudwti") - .withDiscoveryId("kbldngkpocipa") - .withVersion(2857636660248584289L); - model = BinaryData.fromObject(model).toObject(DiscoveredAssetEndpointProfileProperties.class); - Assertions.assertEquals("gigr", model.targetAddress()); - Assertions.assertEquals("burvjxxjnspy", model.additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.ANONYMOUS, model.supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("oenkouknvudwti", model.endpointProfileType()); - Assertions.assertEquals("kbldngkpocipa", model.discoveryId()); - Assertions.assertEquals(2857636660248584289L, model.version()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileUpdatePropertiesTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileUpdatePropertiesTests.java deleted file mode 100644 index ad5806ce2d45..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileUpdatePropertiesTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdateProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredAssetEndpointProfileUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredAssetEndpointProfileUpdateProperties model = BinaryData.fromString( - "{\"targetAddress\":\"nkixzbinj\",\"additionalConfiguration\":\"uttmrywnuzoqft\",\"supportedAuthenticationMethods\":[\"UsernamePassword\",\"Certificate\",\"Certificate\",\"Certificate\"],\"endpointProfileType\":\"qvyxlwhzlsicoho\",\"discoveryId\":\"nwvlryavwhheunmm\",\"version\":5242913098058290048}") - .toObject(DiscoveredAssetEndpointProfileUpdateProperties.class); - Assertions.assertEquals("nkixzbinj", model.targetAddress()); - Assertions.assertEquals("uttmrywnuzoqft", model.additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.USERNAME_PASSWORD, model.supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("qvyxlwhzlsicoho", model.endpointProfileType()); - Assertions.assertEquals("nwvlryavwhheunmm", model.discoveryId()); - Assertions.assertEquals(5242913098058290048L, model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredAssetEndpointProfileUpdateProperties model = new DiscoveredAssetEndpointProfileUpdateProperties() - .withTargetAddress("nkixzbinj") - .withAdditionalConfiguration("uttmrywnuzoqft") - .withSupportedAuthenticationMethods(Arrays.asList(AuthenticationMethod.USERNAME_PASSWORD, - AuthenticationMethod.CERTIFICATE, AuthenticationMethod.CERTIFICATE, AuthenticationMethod.CERTIFICATE)) - .withEndpointProfileType("qvyxlwhzlsicoho") - .withDiscoveryId("nwvlryavwhheunmm") - .withVersion(5242913098058290048L); - model = BinaryData.fromObject(model).toObject(DiscoveredAssetEndpointProfileUpdateProperties.class); - Assertions.assertEquals("nkixzbinj", model.targetAddress()); - Assertions.assertEquals("uttmrywnuzoqft", model.additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.USERNAME_PASSWORD, model.supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("qvyxlwhzlsicoho", model.endpointProfileType()); - Assertions.assertEquals("nwvlryavwhheunmm", model.discoveryId()); - Assertions.assertEquals(5242913098058290048L, model.version()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileUpdateTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileUpdateTests.java deleted file mode 100644 index 78735aeca2b9..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfileUpdateTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdate; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileUpdateProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredAssetEndpointProfileUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredAssetEndpointProfileUpdate model = BinaryData.fromString( - "{\"tags\":{\"iucgygevqzn\":\"kgjn\",\"rbpizc\":\"yp\",\"j\":\"r\",\"yhxdeoejzicwi\":\"dpydn\"},\"properties\":{\"targetAddress\":\"ttgzfbis\",\"additionalConfiguration\":\"bkh\",\"supportedAuthenticationMethods\":[\"UsernamePassword\",\"Certificate\",\"UsernamePassword\",\"Anonymous\"],\"endpointProfileType\":\"dphagalpbuxwgip\",\"discoveryId\":\"onowk\",\"version\":7362184502931754827}}") - .toObject(DiscoveredAssetEndpointProfileUpdate.class); - Assertions.assertEquals("kgjn", model.tags().get("iucgygevqzn")); - Assertions.assertEquals("ttgzfbis", model.properties().targetAddress()); - Assertions.assertEquals("bkh", model.properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.USERNAME_PASSWORD, - model.properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("dphagalpbuxwgip", model.properties().endpointProfileType()); - Assertions.assertEquals("onowk", model.properties().discoveryId()); - Assertions.assertEquals(7362184502931754827L, model.properties().version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredAssetEndpointProfileUpdate model = new DiscoveredAssetEndpointProfileUpdate() - .withTags(mapOf("iucgygevqzn", "kgjn", "rbpizc", "yp", "j", "r", "yhxdeoejzicwi", "dpydn")) - .withProperties(new DiscoveredAssetEndpointProfileUpdateProperties().withTargetAddress("ttgzfbis") - .withAdditionalConfiguration("bkh") - .withSupportedAuthenticationMethods( - Arrays.asList(AuthenticationMethod.USERNAME_PASSWORD, AuthenticationMethod.CERTIFICATE, - AuthenticationMethod.USERNAME_PASSWORD, AuthenticationMethod.ANONYMOUS)) - .withEndpointProfileType("dphagalpbuxwgip") - .withDiscoveryId("onowk") - .withVersion(7362184502931754827L)); - model = BinaryData.fromObject(model).toObject(DiscoveredAssetEndpointProfileUpdate.class); - Assertions.assertEquals("kgjn", model.tags().get("iucgygevqzn")); - Assertions.assertEquals("ttgzfbis", model.properties().targetAddress()); - Assertions.assertEquals("bkh", model.properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.USERNAME_PASSWORD, - model.properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("dphagalpbuxwgip", model.properties().endpointProfileType()); - Assertions.assertEquals("onowk", model.properties().discoveryId()); - Assertions.assertEquals(7362184502931754827L, model.properties().version()); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesCreateOrReplaceMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesCreateOrReplaceMockTests.java deleted file mode 100644 index c8cae6f552c2..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesCreateOrReplaceMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfile; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfileProperties; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -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 reactor.core.publisher.Mono; - -public final class DiscoveredAssetEndpointProfilesCreateOrReplaceMockTests { - @Test - public void testCreateOrReplace() throws Exception { - String responseStr - = "{\"properties\":{\"targetAddress\":\"szufoxciqopidoa\",\"additionalConfiguration\":\"iodhkhazxkhnz\",\"supportedAuthenticationMethods\":[\"Anonymous\",\"Certificate\"],\"endpointProfileType\":\"ntoe\",\"discoveryId\":\"okdwb\",\"version\":4169571464200013299,\"provisioningState\":\"Succeeded\"},\"extendedLocation\":{\"type\":\"zcmrvexztvb\",\"name\":\"qgsfraoyzkoow\"},\"location\":\"mnguxawqaldsyu\",\"tags\":{\"kutwpf\":\"merqfobwyznkb\",\"sd\":\"pagmhrskdsnf\",\"wpusdsttwvogv\":\"akgtdlmkkzevdlh\",\"qqmoaku\":\"bejdcn\"},\"id\":\"gm\",\"name\":\"zr\",\"type\":\"rdgrtw\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DiscoveredAssetEndpointProfile response = manager.discoveredAssetEndpointProfiles() - .define("vkg") - .withRegion("ab") - .withExistingResourceGroup("f") - .withExtendedLocation(new ExtendedLocation().withType("ovsm").withName("l")) - .withTags(mapOf("tpuqujmq", "efkifr", "jcntuj", "gkfbtndoaong")) - .withProperties(new DiscoveredAssetEndpointProfileProperties().withTargetAddress("bgdknnqv") - .withAdditionalConfiguration("znqntoru") - .withSupportedAuthenticationMethods(Arrays.asList(AuthenticationMethod.USERNAME_PASSWORD, - AuthenticationMethod.ANONYMOUS, AuthenticationMethod.CERTIFICATE, AuthenticationMethod.ANONYMOUS)) - .withEndpointProfileType("kycgrauwj") - .withDiscoveryId("etaebu") - .withVersion(602178268406598897L)) - .create(); - - Assertions.assertEquals("mnguxawqaldsyu", response.location()); - Assertions.assertEquals("merqfobwyznkb", response.tags().get("kutwpf")); - Assertions.assertEquals("szufoxciqopidoa", response.properties().targetAddress()); - Assertions.assertEquals("iodhkhazxkhnz", response.properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.ANONYMOUS, - response.properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("ntoe", response.properties().endpointProfileType()); - Assertions.assertEquals("okdwb", response.properties().discoveryId()); - Assertions.assertEquals(4169571464200013299L, response.properties().version()); - Assertions.assertEquals("zcmrvexztvb", response.extendedLocation().type()); - Assertions.assertEquals("qgsfraoyzkoow", response.extendedLocation().name()); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesGetByResourceGroupWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index dca02d5d02c3..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfile; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DiscoveredAssetEndpointProfilesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"targetAddress\":\"xkgymareqnajxqu\",\"additionalConfiguration\":\"hky\",\"supportedAuthenticationMethods\":[\"Anonymous\",\"UsernamePassword\",\"Anonymous\"],\"endpointProfileType\":\"gssofwq\",\"discoveryId\":\"zqalkrmnjijpx\",\"version\":6013226485484313004,\"provisioningState\":\"Succeeded\"},\"extendedLocation\":{\"type\":\"dfnbyxbaaabjyv\",\"name\":\"yffimrzrtuzqogs\"},\"location\":\"nevfdnw\",\"tags\":{\"ud\":\"ewzsyyceuzsoib\",\"brqubp\":\"frxtrthzvaytdwk\"},\"id\":\"xhexiilivpdti\",\"name\":\"r\",\"type\":\"tdqoaxoruzfgsq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DiscoveredAssetEndpointProfile response = manager.discoveredAssetEndpointProfiles() - .getByResourceGroupWithResponse("ywdmjsjqbjh", "yxxrwlycoduh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("nevfdnw", response.location()); - Assertions.assertEquals("ewzsyyceuzsoib", response.tags().get("ud")); - Assertions.assertEquals("xkgymareqnajxqu", response.properties().targetAddress()); - Assertions.assertEquals("hky", response.properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.ANONYMOUS, - response.properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("gssofwq", response.properties().endpointProfileType()); - Assertions.assertEquals("zqalkrmnjijpx", response.properties().discoveryId()); - Assertions.assertEquals(6013226485484313004L, response.properties().version()); - Assertions.assertEquals("dfnbyxbaaabjyv", response.extendedLocation().type()); - Assertions.assertEquals("yffimrzrtuzqogs", response.extendedLocation().name()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListByResourceGroupMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListByResourceGroupMockTests.java deleted file mode 100644 index c3db890c3339..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListByResourceGroupMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfile; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DiscoveredAssetEndpointProfilesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"targetAddress\":\"eptra\",\"additionalConfiguration\":\"jezwlwnw\",\"supportedAuthenticationMethods\":[\"Certificate\",\"Certificate\"],\"endpointProfileType\":\"vydypatdoo\",\"discoveryId\":\"ojknio\",\"version\":8422661722393224797,\"provisioningState\":\"Accepted\"},\"extendedLocation\":{\"type\":\"bw\",\"name\":\"ujhemmsbvdkcrodt\"},\"location\":\"nfwjlfltkacjvefk\",\"tags\":{\"owpulpq\":\"oakggkfpag\",\"xkqjnsjervt\":\"lyls\"},\"id\":\"agxsdszuemps\",\"name\":\"zkfzbeyv\",\"type\":\"nqicvinvkjjxdxrb\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.discoveredAssetEndpointProfiles().listByResourceGroup("yfxrx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nfwjlfltkacjvefk", response.iterator().next().location()); - Assertions.assertEquals("oakggkfpag", response.iterator().next().tags().get("owpulpq")); - Assertions.assertEquals("eptra", response.iterator().next().properties().targetAddress()); - Assertions.assertEquals("jezwlwnw", response.iterator().next().properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.CERTIFICATE, - response.iterator().next().properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("vydypatdoo", response.iterator().next().properties().endpointProfileType()); - Assertions.assertEquals("ojknio", response.iterator().next().properties().discoveryId()); - Assertions.assertEquals(8422661722393224797L, response.iterator().next().properties().version()); - Assertions.assertEquals("bw", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals("ujhemmsbvdkcrodt", response.iterator().next().extendedLocation().name()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListMockTests.java deleted file mode 100644 index 165ef44f280a..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredAssetEndpointProfilesListMockTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredAssetEndpointProfile; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DiscoveredAssetEndpointProfilesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"targetAddress\":\"kzclewyh\",\"additionalConfiguration\":\"wp\",\"supportedAuthenticationMethods\":[\"Certificate\",\"Anonymous\",\"UsernamePassword\",\"Anonymous\"],\"endpointProfileType\":\"ncckw\",\"discoveryId\":\"fz\",\"version\":1751290787011310749,\"provisioningState\":\"Accepted\"},\"extendedLocation\":{\"type\":\"buy\",\"name\":\"a\"},\"location\":\"feqztppriol\",\"tags\":{\"sobqw\":\"jaltolmnc\",\"vglsbjjca\":\"sdbnwdcfhucqdpf\",\"t\":\"vxb\"},\"id\":\"udutnco\",\"name\":\"mr\",\"type\":\"xqtvcofu\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.discoveredAssetEndpointProfiles().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("feqztppriol", response.iterator().next().location()); - Assertions.assertEquals("jaltolmnc", response.iterator().next().tags().get("sobqw")); - Assertions.assertEquals("kzclewyh", response.iterator().next().properties().targetAddress()); - Assertions.assertEquals("wp", response.iterator().next().properties().additionalConfiguration()); - Assertions.assertEquals(AuthenticationMethod.CERTIFICATE, - response.iterator().next().properties().supportedAuthenticationMethods().get(0)); - Assertions.assertEquals("ncckw", response.iterator().next().properties().endpointProfileType()); - Assertions.assertEquals("fz", response.iterator().next().properties().discoveryId()); - Assertions.assertEquals(1751290787011310749L, response.iterator().next().properties().version()); - Assertions.assertEquals("buy", response.iterator().next().extendedLocation().type()); - Assertions.assertEquals("a", response.iterator().next().extendedLocation().name()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredDataPointTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredDataPointTests.java deleted file mode 100644 index 25a3aae3a889..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredDataPointTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredDataPoint; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredDataPointTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredDataPoint model = BinaryData.fromString( - "{\"name\":\"ggd\",\"dataSource\":\"jixhbk\",\"dataPointConfiguration\":\"fqweykhmene\",\"lastUpdatedOn\":\"2021-09-26T05:32:17Z\"}") - .toObject(DiscoveredDataPoint.class); - Assertions.assertEquals("ggd", model.name()); - Assertions.assertEquals("jixhbk", model.dataSource()); - Assertions.assertEquals("fqweykhmene", model.dataPointConfiguration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T05:32:17Z"), model.lastUpdatedOn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredDataPoint model = new DiscoveredDataPoint().withName("ggd") - .withDataSource("jixhbk") - .withDataPointConfiguration("fqweykhmene") - .withLastUpdatedOn(OffsetDateTime.parse("2021-09-26T05:32:17Z")); - model = BinaryData.fromObject(model).toObject(DiscoveredDataPoint.class); - Assertions.assertEquals("ggd", model.name()); - Assertions.assertEquals("jixhbk", model.dataSource()); - Assertions.assertEquals("fqweykhmene", model.dataPointConfiguration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T05:32:17Z"), model.lastUpdatedOn()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredDatasetTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredDatasetTests.java deleted file mode 100644 index 6324d0b4341b..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredDatasetTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredDataPoint; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredDataset; -import com.azure.resourcemanager.deviceregistry.models.Topic; -import com.azure.resourcemanager.deviceregistry.models.TopicRetainType; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredDatasetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredDataset model = BinaryData.fromString( - "{\"name\":\"bonqvpkvlrxnjeas\",\"datasetConfiguration\":\"pheoflokeyy\",\"topic\":{\"path\":\"nj\",\"retain\":\"Never\"},\"dataPoints\":[{\"name\":\"grhpdjpju\",\"dataSource\":\"asxazjpqyegualhb\",\"dataPointConfiguration\":\"hejjz\",\"lastUpdatedOn\":\"2021-01-27T02:51:11Z\"},{\"name\":\"udgwdslfho\",\"dataSource\":\"wmc\",\"dataPointConfiguration\":\"pwlbjnpg\",\"lastUpdatedOn\":\"2021-06-30T18:10:14Z\"},{\"name\":\"tadehxnltyfsopp\",\"dataSource\":\"suesnzw\",\"dataPointConfiguration\":\"jbavorxzdm\",\"lastUpdatedOn\":\"2021-07-20T12:25:55Z\"},{\"name\":\"tbqvudw\",\"dataSource\":\"dndnvow\",\"dataPointConfiguration\":\"jjugwdkcglhslaz\",\"lastUpdatedOn\":\"2021-04-05T17:23:15Z\"}]}") - .toObject(DiscoveredDataset.class); - Assertions.assertEquals("bonqvpkvlrxnjeas", model.name()); - Assertions.assertEquals("pheoflokeyy", model.datasetConfiguration()); - Assertions.assertEquals("nj", model.topic().path()); - Assertions.assertEquals(TopicRetainType.NEVER, model.topic().retain()); - Assertions.assertEquals("grhpdjpju", model.dataPoints().get(0).name()); - Assertions.assertEquals("asxazjpqyegualhb", model.dataPoints().get(0).dataSource()); - Assertions.assertEquals("hejjz", model.dataPoints().get(0).dataPointConfiguration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T02:51:11Z"), - model.dataPoints().get(0).lastUpdatedOn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredDataset model = new DiscoveredDataset().withName("bonqvpkvlrxnjeas") - .withDatasetConfiguration("pheoflokeyy") - .withTopic(new Topic().withPath("nj").withRetain(TopicRetainType.NEVER)) - .withDataPoints(Arrays.asList( - new DiscoveredDataPoint().withName("grhpdjpju") - .withDataSource("asxazjpqyegualhb") - .withDataPointConfiguration("hejjz") - .withLastUpdatedOn(OffsetDateTime.parse("2021-01-27T02:51:11Z")), - new DiscoveredDataPoint().withName("udgwdslfho") - .withDataSource("wmc") - .withDataPointConfiguration("pwlbjnpg") - .withLastUpdatedOn(OffsetDateTime.parse("2021-06-30T18:10:14Z")), - new DiscoveredDataPoint().withName("tadehxnltyfsopp") - .withDataSource("suesnzw") - .withDataPointConfiguration("jbavorxzdm") - .withLastUpdatedOn(OffsetDateTime.parse("2021-07-20T12:25:55Z")), - new DiscoveredDataPoint().withName("tbqvudw") - .withDataSource("dndnvow") - .withDataPointConfiguration("jjugwdkcglhslaz") - .withLastUpdatedOn(OffsetDateTime.parse("2021-04-05T17:23:15Z")))); - model = BinaryData.fromObject(model).toObject(DiscoveredDataset.class); - Assertions.assertEquals("bonqvpkvlrxnjeas", model.name()); - Assertions.assertEquals("pheoflokeyy", model.datasetConfiguration()); - Assertions.assertEquals("nj", model.topic().path()); - Assertions.assertEquals(TopicRetainType.NEVER, model.topic().retain()); - Assertions.assertEquals("grhpdjpju", model.dataPoints().get(0).name()); - Assertions.assertEquals("asxazjpqyegualhb", model.dataPoints().get(0).dataSource()); - Assertions.assertEquals("hejjz", model.dataPoints().get(0).dataPointConfiguration()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-27T02:51:11Z"), - model.dataPoints().get(0).lastUpdatedOn()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredEventTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredEventTests.java deleted file mode 100644 index dc19ac3d0a82..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/DiscoveredEventTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.DiscoveredEvent; -import com.azure.resourcemanager.deviceregistry.models.Topic; -import com.azure.resourcemanager.deviceregistry.models.TopicRetainType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredEventTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredEvent model = BinaryData.fromString( - "{\"name\":\"exfwhy\",\"eventNotifier\":\"cibvyvdcsitynn\",\"eventConfiguration\":\"mdectehfiqscjey\",\"topic\":{\"path\":\"hezrkgq\",\"retain\":\"Never\"},\"lastUpdatedOn\":\"2021-06-04T03:18:37Z\"}") - .toObject(DiscoveredEvent.class); - Assertions.assertEquals("exfwhy", model.name()); - Assertions.assertEquals("cibvyvdcsitynn", model.eventNotifier()); - Assertions.assertEquals("mdectehfiqscjey", model.eventConfiguration()); - Assertions.assertEquals("hezrkgq", model.topic().path()); - Assertions.assertEquals(TopicRetainType.NEVER, model.topic().retain()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T03:18:37Z"), model.lastUpdatedOn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredEvent model = new DiscoveredEvent().withName("exfwhy") - .withEventNotifier("cibvyvdcsitynn") - .withEventConfiguration("mdectehfiqscjey") - .withTopic(new Topic().withPath("hezrkgq").withRetain(TopicRetainType.NEVER)) - .withLastUpdatedOn(OffsetDateTime.parse("2021-06-04T03:18:37Z")); - model = BinaryData.fromObject(model).toObject(DiscoveredEvent.class); - Assertions.assertEquals("exfwhy", model.name()); - Assertions.assertEquals("cibvyvdcsitynn", model.eventNotifier()); - Assertions.assertEquals("mdectehfiqscjey", model.eventConfiguration()); - Assertions.assertEquals("hezrkgq", model.topic().path()); - Assertions.assertEquals(TopicRetainType.NEVER, model.topic().retain()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T03:18:37Z"), model.lastUpdatedOn()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListMockTests.java index 2ec8855d7289..156f9bd4723a 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListMockTests.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/OperationsListMockTests.java @@ -21,7 +21,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"umaq\",\"isDataAction\":true,\"display\":{\"provider\":\"cdui\",\"resource\":\"tgccymvaolpss\",\"operation\":\"lfmmdnbbglzpswi\",\"description\":\"mcwyhzdxssadb\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"gpphrcgyn\",\"isDataAction\":true,\"display\":{\"provider\":\"cfvmmco\",\"resource\":\"sxlzevgbmqj\",\"operation\":\"bcypmi\",\"description\":\"w\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaInnerTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaInnerTests.java deleted file mode 100644 index 2c308e7586f9..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaInner; -import com.azure.resourcemanager.deviceregistry.models.Format; -import com.azure.resourcemanager.deviceregistry.models.SchemaProperties; -import com.azure.resourcemanager.deviceregistry.models.SchemaType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SchemaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaInner model = BinaryData.fromString( - "{\"properties\":{\"uuid\":\"ngmtsavjcb\",\"displayName\":\"xqpsrknftguv\",\"description\":\"uhprwmdyvxqt\",\"format\":\"Delta/1.0\",\"schemaType\":\"MessageSchema\",\"provisioningState\":\"Failed\",\"tags\":{\"exrmcqibycnojvk\":\"oyq\"}},\"id\":\"e\",\"name\":\"qsgzvahapj\",\"type\":\"zhpvgqzcjrvxd\"}") - .toObject(SchemaInner.class); - Assertions.assertEquals("xqpsrknftguv", model.properties().displayName()); - Assertions.assertEquals("uhprwmdyvxqt", model.properties().description()); - Assertions.assertEquals(Format.DELTA_1_0, model.properties().format()); - Assertions.assertEquals(SchemaType.MESSAGE_SCHEMA, model.properties().schemaType()); - Assertions.assertEquals("oyq", model.properties().tags().get("exrmcqibycnojvk")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaInner model = new SchemaInner().withProperties(new SchemaProperties().withDisplayName("xqpsrknftguv") - .withDescription("uhprwmdyvxqt") - .withFormat(Format.DELTA_1_0) - .withSchemaType(SchemaType.MESSAGE_SCHEMA) - .withTags(mapOf("exrmcqibycnojvk", "oyq"))); - model = BinaryData.fromObject(model).toObject(SchemaInner.class); - Assertions.assertEquals("xqpsrknftguv", model.properties().displayName()); - Assertions.assertEquals("uhprwmdyvxqt", model.properties().description()); - Assertions.assertEquals(Format.DELTA_1_0, model.properties().format()); - Assertions.assertEquals(SchemaType.MESSAGE_SCHEMA, model.properties().schemaType()); - Assertions.assertEquals("oyq", model.properties().tags().get("exrmcqibycnojvk")); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaListResultTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaListResultTests.java deleted file mode 100644 index 8e08baab5861..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.implementation.models.SchemaListResult; -import com.azure.resourcemanager.deviceregistry.models.Format; -import com.azure.resourcemanager.deviceregistry.models.SchemaType; -import org.junit.jupiter.api.Assertions; - -public final class SchemaListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"uuid\":\"n\",\"displayName\":\"xisxyawjoyaqcsl\",\"description\":\"pkii\",\"format\":\"JsonSchema/draft-07\",\"schemaType\":\"MessageSchema\",\"provisioningState\":\"Accepted\",\"tags\":{\"hnrztfol\":\"eli\",\"dtpnapnyiropuhp\":\"bnxknalaulppg\",\"gqgitxmedjvcsl\":\"gvpgy\"}},\"id\":\"qwwncw\",\"name\":\"zhxgktrmgucn\",\"type\":\"pkteo\"},{\"properties\":{\"uuid\":\"wptfdy\",\"displayName\":\"fqbuaceopzf\",\"description\":\"hhuao\",\"format\":\"Delta/1.0\",\"schemaType\":\"MessageSchema\",\"provisioningState\":\"Canceled\",\"tags\":{\"t\":\"xolzdahzx\",\"grcfb\":\"bgbkdmoizpost\",\"bpvjymjhx\":\"nrmfqjhhk\"}},\"id\":\"yngudivk\",\"name\":\"tswb\",\"type\":\"qzvszjf\"}],\"nextLink\":\"vjfdx\"}") - .toObject(SchemaListResult.class); - Assertions.assertEquals("xisxyawjoyaqcsl", model.value().get(0).properties().displayName()); - Assertions.assertEquals("pkii", model.value().get(0).properties().description()); - Assertions.assertEquals(Format.JSON_SCHEMA_DRAFT7, model.value().get(0).properties().format()); - Assertions.assertEquals(SchemaType.MESSAGE_SCHEMA, model.value().get(0).properties().schemaType()); - Assertions.assertEquals("eli", model.value().get(0).properties().tags().get("hnrztfol")); - Assertions.assertEquals("vjfdx", model.nextLink()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaPropertiesTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaPropertiesTests.java deleted file mode 100644 index 7f948e306a47..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaPropertiesTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.Format; -import com.azure.resourcemanager.deviceregistry.models.SchemaProperties; -import com.azure.resourcemanager.deviceregistry.models.SchemaType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SchemaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaProperties model = BinaryData.fromString( - "{\"uuid\":\"lmwlxkvugfhzo\",\"displayName\":\"wjvzunluthnn\",\"description\":\"nxipeil\",\"format\":\"Delta/1.0\",\"schemaType\":\"MessageSchema\",\"provisioningState\":\"Failed\",\"tags\":{\"kzbbtd\":\"xdult\",\"bsjyofdx\":\"umveekgpwozuhkf\",\"oekqvk\":\"uusdttouwa\",\"vbxwyjsflhh\":\"lns\"}}") - .toObject(SchemaProperties.class); - Assertions.assertEquals("wjvzunluthnn", model.displayName()); - Assertions.assertEquals("nxipeil", model.description()); - Assertions.assertEquals(Format.DELTA_1_0, model.format()); - Assertions.assertEquals(SchemaType.MESSAGE_SCHEMA, model.schemaType()); - Assertions.assertEquals("xdult", model.tags().get("kzbbtd")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaProperties model = new SchemaProperties().withDisplayName("wjvzunluthnn") - .withDescription("nxipeil") - .withFormat(Format.DELTA_1_0) - .withSchemaType(SchemaType.MESSAGE_SCHEMA) - .withTags( - mapOf("kzbbtd", "xdult", "bsjyofdx", "umveekgpwozuhkf", "oekqvk", "uusdttouwa", "vbxwyjsflhh", "lns")); - model = BinaryData.fromObject(model).toObject(SchemaProperties.class); - Assertions.assertEquals("wjvzunluthnn", model.displayName()); - Assertions.assertEquals("nxipeil", model.description()); - Assertions.assertEquals(Format.DELTA_1_0, model.format()); - Assertions.assertEquals(SchemaType.MESSAGE_SCHEMA, model.schemaType()); - Assertions.assertEquals("xdult", model.tags().get("kzbbtd")); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesCreateOrReplaceMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesCreateOrReplaceMockTests.java deleted file mode 100644 index 02b457021dc6..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesCreateOrReplaceMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistry; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryProperties; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentity; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemaRegistriesCreateOrReplaceMockTests { - @Test - public void testCreateOrReplace() throws Exception { - String responseStr - = "{\"properties\":{\"uuid\":\"qhl\",\"namespace\":\"vriiio\",\"displayName\":\"al\",\"description\":\"fk\",\"storageAccountContainerUrl\":\"tvsexsowuel\",\"provisioningState\":\"Succeeded\"},\"identity\":{\"principalId\":\"hhxvrhmzkwpj\",\"tenantId\":\"wspughftqsxhqx\",\"type\":\"None\"},\"location\":\"ukndxdigrjgu\",\"tags\":{\"z\":\"dmsyqtfihwhbo\",\"zudphqamvdkfw\":\"ngamvpphosz\",\"qiatkzwpcnp\":\"nwcvtbvkayhmtnv\"},\"id\":\"zcjaesgvvsccy\",\"name\":\"jguq\",\"type\":\"hwyg\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SchemaRegistry response = manager.schemaRegistries() - .define("x") - .withRegion("frl") - .withExistingResourceGroup("slthaq") - .withTags(mapOf("iin", "zrnw", "h", "fpwpjylwbt")) - .withProperties(new SchemaRegistryProperties().withNamespace("pdrhne") - .withDisplayName("owqkdwytisi") - .withDescription("rcgp") - .withStorageAccountContainerUrl("kpzi")) - .withIdentity(new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.NONE)) - .create(); - - Assertions.assertEquals("ukndxdigrjgu", response.location()); - Assertions.assertEquals("dmsyqtfihwhbo", response.tags().get("z")); - Assertions.assertEquals("vriiio", response.properties().namespace()); - Assertions.assertEquals("al", response.properties().displayName()); - Assertions.assertEquals("fk", response.properties().description()); - Assertions.assertEquals("tvsexsowuel", response.properties().storageAccountContainerUrl()); - Assertions.assertEquals(SystemAssignedServiceIdentityType.NONE, response.identity().type()); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesGetByResourceGroupWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index fed1b9d56e0f..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistry; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemaRegistriesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"uuid\":\"hhziuief\",\"namespace\":\"zbhd\",\"displayName\":\"mlmz\",\"description\":\"oftrmaequia\",\"storageAccountContainerUrl\":\"xicslfao\",\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"ylhalnswhcc\",\"tenantId\":\"hka\",\"type\":\"SystemAssigned\"},\"location\":\"itqscywuggwoluhc\",\"tags\":{\"i\":\"emh\"},\"id\":\"sbrgz\",\"name\":\"wmsweypqwd\",\"type\":\"ggicccnxqhue\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SchemaRegistry response = manager.schemaRegistries() - .getByResourceGroupWithResponse("enuuzkopbm", "nrfdw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("itqscywuggwoluhc", response.location()); - Assertions.assertEquals("emh", response.tags().get("i")); - Assertions.assertEquals("zbhd", response.properties().namespace()); - Assertions.assertEquals("mlmz", response.properties().displayName()); - Assertions.assertEquals("oftrmaequia", response.properties().description()); - Assertions.assertEquals("xicslfao", response.properties().storageAccountContainerUrl()); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListByResourceGroupMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListByResourceGroupMockTests.java deleted file mode 100644 index 0883b28b3ca4..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListByResourceGroupMockTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistry; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemaRegistriesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"uuid\":\"ncsdtclusiyp\",\"namespace\":\"sfgytguslfead\",\"displayName\":\"gq\",\"description\":\"yhejhzisxgfp\",\"storageAccountContainerUrl\":\"lolp\",\"provisioningState\":\"Canceled\"},\"identity\":{\"principalId\":\"pqvujzraehtwdwrf\",\"tenantId\":\"wib\",\"type\":\"SystemAssigned\"},\"location\":\"dl\",\"tags\":{\"khevxccedc\":\"hfwpracstwit\",\"jc\":\"nmdyodnwzxl\",\"vvwxqi\":\"nhltiugcxn\",\"unyowxwl\":\"y\"},\"id\":\"djrkvfgbvfvpd\",\"name\":\"odacizs\",\"type\":\"q\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.schemaRegistries().listByResourceGroup("mkttlstvlzywem", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dl", response.iterator().next().location()); - Assertions.assertEquals("hfwpracstwit", response.iterator().next().tags().get("khevxccedc")); - Assertions.assertEquals("sfgytguslfead", response.iterator().next().properties().namespace()); - Assertions.assertEquals("gq", response.iterator().next().properties().displayName()); - Assertions.assertEquals("yhejhzisxgfp", response.iterator().next().properties().description()); - Assertions.assertEquals("lolp", response.iterator().next().properties().storageAccountContainerUrl()); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, - response.iterator().next().identity().type()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListMockTests.java deleted file mode 100644 index ce224492e587..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistriesListMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistry; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemaRegistriesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"uuid\":\"rribd\",\"namespace\":\"ibqipqkg\",\"displayName\":\"xndzwm\",\"description\":\"efajpj\",\"storageAccountContainerUrl\":\"rwkq\",\"provisioningState\":\"Failed\"},\"identity\":{\"principalId\":\"ij\",\"tenantId\":\"ivfxzsjabibsyst\",\"type\":\"SystemAssigned\"},\"location\":\"sdjpvkvp\",\"tags\":{\"ncj\":\"bkzbzkd\",\"zhjjklffhmouwq\":\"budurgkakmo\",\"eeyebi\":\"gzrf\"},\"id\":\"ikayuhqlbjbsybb\",\"name\":\"wrv\",\"type\":\"ldgmfpgvmpip\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.schemaRegistries().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("sdjpvkvp", response.iterator().next().location()); - Assertions.assertEquals("bkzbzkd", response.iterator().next().tags().get("ncj")); - Assertions.assertEquals("ibqipqkg", response.iterator().next().properties().namespace()); - Assertions.assertEquals("xndzwm", response.iterator().next().properties().displayName()); - Assertions.assertEquals("efajpj", response.iterator().next().properties().description()); - Assertions.assertEquals("rwkq", response.iterator().next().properties().storageAccountContainerUrl()); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, - response.iterator().next().identity().type()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryInnerTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryInnerTests.java deleted file mode 100644 index 1a737e1e9dd5..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryInnerTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaRegistryInner; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryProperties; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentity; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SchemaRegistryInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaRegistryInner model = BinaryData.fromString( - "{\"properties\":{\"uuid\":\"jhtxfvgxbfsmxne\",\"namespace\":\"mpvecxgodebfqk\",\"displayName\":\"bmpukgriwflz\",\"description\":\"bxzpuzycisp\",\"storageAccountContainerUrl\":\"qzahmgkbrp\",\"provisioningState\":\"Canceled\"},\"identity\":{\"principalId\":\"bnuqqkpik\",\"tenantId\":\"rgvtqag\",\"type\":\"SystemAssigned\"},\"location\":\"ynhijggme\",\"tags\":{\"zmhjrunmp\":\"iarbutrcvpna\",\"nkxmyskpbhenbtk\":\"ttdbhrbnl\",\"yxczfclh\":\"xywnytnrsynlqidy\"},\"id\":\"axdbabph\",\"name\":\"wrqlfktsthsuco\",\"type\":\"mnyyazt\"}") - .toObject(SchemaRegistryInner.class); - Assertions.assertEquals("ynhijggme", model.location()); - Assertions.assertEquals("iarbutrcvpna", model.tags().get("zmhjrunmp")); - Assertions.assertEquals("mpvecxgodebfqk", model.properties().namespace()); - Assertions.assertEquals("bmpukgriwflz", model.properties().displayName()); - Assertions.assertEquals("bxzpuzycisp", model.properties().description()); - Assertions.assertEquals("qzahmgkbrp", model.properties().storageAccountContainerUrl()); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaRegistryInner model = new SchemaRegistryInner().withLocation("ynhijggme") - .withTags( - mapOf("zmhjrunmp", "iarbutrcvpna", "nkxmyskpbhenbtk", "ttdbhrbnl", "yxczfclh", "xywnytnrsynlqidy")) - .withProperties(new SchemaRegistryProperties().withNamespace("mpvecxgodebfqk") - .withDisplayName("bmpukgriwflz") - .withDescription("bxzpuzycisp") - .withStorageAccountContainerUrl("qzahmgkbrp")) - .withIdentity( - new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)); - model = BinaryData.fromObject(model).toObject(SchemaRegistryInner.class); - Assertions.assertEquals("ynhijggme", model.location()); - Assertions.assertEquals("iarbutrcvpna", model.tags().get("zmhjrunmp")); - Assertions.assertEquals("mpvecxgodebfqk", model.properties().namespace()); - Assertions.assertEquals("bmpukgriwflz", model.properties().displayName()); - Assertions.assertEquals("bxzpuzycisp", model.properties().description()); - Assertions.assertEquals("qzahmgkbrp", model.properties().storageAccountContainerUrl()); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryListResultTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryListResultTests.java deleted file mode 100644 index 3b5048ec4d28..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryListResultTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.implementation.models.SchemaRegistryListResult; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class SchemaRegistryListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaRegistryListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"uuid\":\"lxotogtwrupq\",\"namespace\":\"xvnmicykvceov\",\"displayName\":\"lo\",\"description\":\"oty\",\"storageAccountContainerUrl\":\"jfcn\",\"provisioningState\":\"Accepted\"},\"identity\":{\"principalId\":\"x\",\"tenantId\":\"bttk\",\"type\":\"None\"},\"location\":\"wpn\",\"tags\":{\"hoxus\":\"oqnermclfpl\"},\"id\":\"rpabg\",\"name\":\"epsbjtazqu\",\"type\":\"xywpmueefjzwfqkq\"},{\"properties\":{\"uuid\":\"dsuyonobgla\",\"namespace\":\"cq\",\"displayName\":\"ccm\",\"description\":\"udxytlmoyrx\",\"storageAccountContainerUrl\":\"wfudwpzntxhdzhl\",\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"ck\",\"tenantId\":\"lhrxsbkyvpyc\",\"type\":\"None\"},\"location\":\"z\",\"tags\":{\"hhseyv\":\"kafkuwbcrnwbm\"},\"id\":\"us\",\"name\":\"tslhspkdeem\",\"type\":\"ofmxagkvtmelmqkr\"},{\"properties\":{\"uuid\":\"vljua\",\"namespace\":\"aquhcdhm\",\"displayName\":\"alaexqpvfadmwsrc\",\"description\":\"vxpvgomz\",\"storageAccountContainerUrl\":\"fmisg\",\"provisioningState\":\"Deleting\"},\"identity\":{\"principalId\":\"e\",\"tenantId\":\"awkz\",\"type\":\"None\"},\"location\":\"io\",\"tags\":{\"xosow\":\"hakauhashsf\",\"cjooxdjebwpucwwf\":\"xcug\",\"hzceuojgjrwjue\":\"ovbvmeueciv\"},\"id\":\"otwmcdyt\",\"name\":\"x\",\"type\":\"it\"},{\"properties\":{\"uuid\":\"jawgqwg\",\"namespace\":\"hniskxfbkpyc\",\"displayName\":\"lwn\",\"description\":\"hjdauwhvylwz\",\"storageAccountContainerUrl\":\"tdhxujznbmpowuwp\",\"provisioningState\":\"Accepted\"},\"identity\":{\"principalId\":\"eualupjmkhf\",\"tenantId\":\"bbcswsrtjri\",\"type\":\"SystemAssigned\"},\"location\":\"bpbewtghfgb\",\"tags\":{\"gibtnm\":\"wxzvlvqhjkb\"},\"id\":\"iebwwaloayqcgwrt\",\"name\":\"j\",\"type\":\"zg\"}],\"nextLink\":\"zmh\"}") - .toObject(SchemaRegistryListResult.class); - Assertions.assertEquals("wpn", model.value().get(0).location()); - Assertions.assertEquals("oqnermclfpl", model.value().get(0).tags().get("hoxus")); - Assertions.assertEquals("xvnmicykvceov", model.value().get(0).properties().namespace()); - Assertions.assertEquals("lo", model.value().get(0).properties().displayName()); - Assertions.assertEquals("oty", model.value().get(0).properties().description()); - Assertions.assertEquals("jfcn", model.value().get(0).properties().storageAccountContainerUrl()); - Assertions.assertEquals(SystemAssignedServiceIdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("zmh", model.nextLink()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryPropertiesTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryPropertiesTests.java deleted file mode 100644 index 735b2f64b29c..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryPropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryProperties; -import org.junit.jupiter.api.Assertions; - -public final class SchemaRegistryPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaRegistryProperties model = BinaryData.fromString( - "{\"uuid\":\"twwrqp\",\"namespace\":\"edckzywbiexzfey\",\"displayName\":\"axibxujw\",\"description\":\"qwalmuzyoxaepd\",\"storageAccountContainerUrl\":\"zjancuxr\",\"provisioningState\":\"Canceled\"}") - .toObject(SchemaRegistryProperties.class); - Assertions.assertEquals("edckzywbiexzfey", model.namespace()); - Assertions.assertEquals("axibxujw", model.displayName()); - Assertions.assertEquals("qwalmuzyoxaepd", model.description()); - Assertions.assertEquals("zjancuxr", model.storageAccountContainerUrl()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaRegistryProperties model = new SchemaRegistryProperties().withNamespace("edckzywbiexzfey") - .withDisplayName("axibxujw") - .withDescription("qwalmuzyoxaepd") - .withStorageAccountContainerUrl("zjancuxr"); - model = BinaryData.fromObject(model).toObject(SchemaRegistryProperties.class); - Assertions.assertEquals("edckzywbiexzfey", model.namespace()); - Assertions.assertEquals("axibxujw", model.displayName()); - Assertions.assertEquals("qwalmuzyoxaepd", model.description()); - Assertions.assertEquals("zjancuxr", model.storageAccountContainerUrl()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryUpdatePropertiesTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryUpdatePropertiesTests.java deleted file mode 100644 index a15054ded060..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryUpdatePropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class SchemaRegistryUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaRegistryUpdateProperties model - = BinaryData.fromString("{\"displayName\":\"tldwkyzxuutk\",\"description\":\"ws\"}") - .toObject(SchemaRegistryUpdateProperties.class); - Assertions.assertEquals("tldwkyzxuutk", model.displayName()); - Assertions.assertEquals("ws", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaRegistryUpdateProperties model - = new SchemaRegistryUpdateProperties().withDisplayName("tldwkyzxuutk").withDescription("ws"); - model = BinaryData.fromObject(model).toObject(SchemaRegistryUpdateProperties.class); - Assertions.assertEquals("tldwkyzxuutk", model.displayName()); - Assertions.assertEquals("ws", model.description()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryUpdateTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryUpdateTests.java deleted file mode 100644 index 958d084383da..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaRegistryUpdateTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdate; -import com.azure.resourcemanager.deviceregistry.models.SchemaRegistryUpdateProperties; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentity; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SchemaRegistryUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaRegistryUpdate model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"zpfzabglc\",\"tenantId\":\"xwtctyqiklbbovpl\",\"type\":\"SystemAssigned\"},\"tags\":{\"mkfssxqukkfplgm\":\"vgyuguos\",\"wiyighxpkdw\":\"sxnkjzkdeslpvlo\",\"upedeojnabckhs\":\"baiuebbaumny\"},\"properties\":{\"displayName\":\"psiebtfhvpes\",\"description\":\"skrdqmhjj\"}}") - .toObject(SchemaRegistryUpdate.class); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("vgyuguos", model.tags().get("mkfssxqukkfplgm")); - Assertions.assertEquals("psiebtfhvpes", model.properties().displayName()); - Assertions.assertEquals("skrdqmhjj", model.properties().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaRegistryUpdate model = new SchemaRegistryUpdate() - .withIdentity( - new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED)) - .withTags(mapOf("mkfssxqukkfplgm", "vgyuguos", "wiyighxpkdw", "sxnkjzkdeslpvlo", "upedeojnabckhs", - "baiuebbaumny")) - .withProperties( - new SchemaRegistryUpdateProperties().withDisplayName("psiebtfhvpes").withDescription("skrdqmhjj")); - model = BinaryData.fromObject(model).toObject(SchemaRegistryUpdate.class); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("vgyuguos", model.tags().get("mkfssxqukkfplgm")); - Assertions.assertEquals("psiebtfhvpes", model.properties().displayName()); - Assertions.assertEquals("skrdqmhjj", model.properties().description()); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionInnerTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionInnerTests.java deleted file mode 100644 index 12dabcc15478..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.fluent.models.SchemaVersionInner; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersionProperties; -import org.junit.jupiter.api.Assertions; - -public final class SchemaVersionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaVersionInner model = BinaryData.fromString( - "{\"properties\":{\"uuid\":\"e\",\"description\":\"t\",\"schemaContent\":\"qaqtdoqmcbxvwvxy\",\"hash\":\"qbhsfxobl\",\"provisioningState\":\"Canceled\"},\"id\":\"lmpewwwfbkr\",\"name\":\"rn\",\"type\":\"vshqjohxcr\"}") - .toObject(SchemaVersionInner.class); - Assertions.assertEquals("t", model.properties().description()); - Assertions.assertEquals("qaqtdoqmcbxvwvxy", model.properties().schemaContent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaVersionInner model = new SchemaVersionInner() - .withProperties(new SchemaVersionProperties().withDescription("t").withSchemaContent("qaqtdoqmcbxvwvxy")); - model = BinaryData.fromObject(model).toObject(SchemaVersionInner.class); - Assertions.assertEquals("t", model.properties().description()); - Assertions.assertEquals("qaqtdoqmcbxvwvxy", model.properties().schemaContent()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionListResultTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionListResultTests.java deleted file mode 100644 index 1ae95b9de94e..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionListResultTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.implementation.models.SchemaVersionListResult; -import org.junit.jupiter.api.Assertions; - -public final class SchemaVersionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaVersionListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"uuid\":\"otftpvjzbexilz\",\"description\":\"fqqnvwpmqtaruo\",\"schemaContent\":\"jmkcjhwqytj\",\"hash\":\"bnw\",\"provisioningState\":\"Deleting\"},\"id\":\"drjervnaenqpehin\",\"name\":\"oygmift\",\"type\":\"nzdndslgna\"}],\"nextLink\":\"igynduhavhqlk\"}") - .toObject(SchemaVersionListResult.class); - Assertions.assertEquals("fqqnvwpmqtaruo", model.value().get(0).properties().description()); - Assertions.assertEquals("jmkcjhwqytj", model.value().get(0).properties().schemaContent()); - Assertions.assertEquals("igynduhavhqlk", model.nextLink()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionPropertiesTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionPropertiesTests.java deleted file mode 100644 index c7e2d60e48af..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersionProperties; -import org.junit.jupiter.api.Assertions; - -public final class SchemaVersionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SchemaVersionProperties model = BinaryData.fromString( - "{\"uuid\":\"fovasr\",\"description\":\"v\",\"schemaContent\":\"bhsqfsubcgjbirxb\",\"hash\":\"bsrfbj\",\"provisioningState\":\"Deleting\"}") - .toObject(SchemaVersionProperties.class); - Assertions.assertEquals("v", model.description()); - Assertions.assertEquals("bhsqfsubcgjbirxb", model.schemaContent()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SchemaVersionProperties model - = new SchemaVersionProperties().withDescription("v").withSchemaContent("bhsqfsubcgjbirxb"); - model = BinaryData.fromObject(model).toObject(SchemaVersionProperties.class); - Assertions.assertEquals("v", model.description()); - Assertions.assertEquals("bhsqfsubcgjbirxb", model.schemaContent()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsCreateOrReplaceWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsCreateOrReplaceWithResponseMockTests.java deleted file mode 100644 index 0aa5c64f3ff6..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsCreateOrReplaceWithResponseMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersion; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersionProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemaVersionsCreateOrReplaceWithResponseMockTests { - @Test - public void testCreateOrReplaceWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"uuid\":\"hfssnrb\",\"description\":\"efr\",\"schemaContent\":\"msgaoj\",\"hash\":\"wncot\",\"provisioningState\":\"Accepted\"},\"id\":\"irctymoxoftpipiw\",\"name\":\"czuhxacpqjlihh\",\"type\":\"usps\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SchemaVersion response = manager.schemaVersions() - .define("ieoxorggufhyaomt") - .withExistingSchema("awnopqgikyzirtxd", "uxzejntpsew", "ioilqukrydxtq") - .withProperties(new SchemaVersionProperties().withDescription("ovjzhpjbibgjmfx").withSchemaContent("mv")) - .create(); - - Assertions.assertEquals("efr", response.properties().description()); - Assertions.assertEquals("msgaoj", response.properties().schemaContent()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsDeleteWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsDeleteWithResponseMockTests.java deleted file mode 100644 index 1bff9a8eb8b7..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemaVersionsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.schemaVersions() - .deleteWithResponse("wtovvtgsein", "fiufx", "knpirgnepttwq", "sniffc", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsGetWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsGetWithResponseMockTests.java deleted file mode 100644 index 1eeb0250aab2..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsGetWithResponseMockTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemaVersionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"uuid\":\"bfpncurdo\",\"description\":\"iithtywu\",\"schemaContent\":\"xcbihw\",\"hash\":\"nfdn\",\"provisioningState\":\"Deleting\"},\"id\":\"hrdgoihxumwcto\",\"name\":\"dzjlu\",\"type\":\"dfdlwggyts\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SchemaVersion response = manager.schemaVersions() - .getWithResponse("stotxh", "jujbypelmcuvhixb", "xyfwnylrcool", "ttpkiwkkbnujrywv", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("iithtywu", response.properties().description()); - Assertions.assertEquals("xcbihw", response.properties().schemaContent()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsListBySchemaMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsListBySchemaMockTests.java deleted file mode 100644 index 310798aeee94..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemaVersionsListBySchemaMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.SchemaVersion; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemaVersionsListBySchemaMockTests { - @Test - public void testListBySchema() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"uuid\":\"yzhftwesgogczh\",\"description\":\"nxkrlgnyhmossxkk\",\"schemaContent\":\"thrrgh\",\"hash\":\"bdhqxvcxgf\",\"provisioningState\":\"Canceled\"},\"id\":\"ofbshr\",\"name\":\"svbuswdvzyy\",\"type\":\"ycnunvjsrtk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.schemaVersions() - .listBySchema("mqnrojlpijnkr", "frddhcrati", "zronasxift", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nxkrlgnyhmossxkk", response.iterator().next().properties().description()); - Assertions.assertEquals("thrrgh", response.iterator().next().properties().schemaContent()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasCreateOrReplaceWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasCreateOrReplaceWithResponseMockTests.java deleted file mode 100644 index 3bf3c1d7afd7..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasCreateOrReplaceWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.Format; -import com.azure.resourcemanager.deviceregistry.models.Schema; -import com.azure.resourcemanager.deviceregistry.models.SchemaProperties; -import com.azure.resourcemanager.deviceregistry.models.SchemaType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemasCreateOrReplaceWithResponseMockTests { - @Test - public void testCreateOrReplaceWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"uuid\":\"zejjoqk\",\"displayName\":\"fhsxttaugz\",\"description\":\"faazpxdtnkdmkqjj\",\"format\":\"JsonSchema/draft-07\",\"schemaType\":\"MessageSchema\",\"provisioningState\":\"Accepted\",\"tags\":{\"j\":\"kpyouaibrebqaay\",\"ttezlw\":\"ixqtn\",\"pqqmted\":\"ffiakp\",\"wau\":\"tmmjihyeozph\"}},\"id\":\"ncyg\",\"name\":\"p\",\"type\":\"vipmdscwxqupevzh\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Schema response = manager.schemas() - .define("on") - .withExistingSchemaRegistry("ycxzbfvoo", "vrvmtgjqppyost") - .withProperties(new SchemaProperties().withDisplayName("krrjrea") - .withDescription("tsgumhj") - .withFormat(Format.JSON_SCHEMA_DRAFT7) - .withSchemaType(SchemaType.MESSAGE_SCHEMA) - .withTags(mapOf("qpvuzlmvfelf", "slol", "crpw", "tgp"))) - .create(); - - Assertions.assertEquals("fhsxttaugz", response.properties().displayName()); - Assertions.assertEquals("faazpxdtnkdmkqjj", response.properties().description()); - Assertions.assertEquals(Format.JSON_SCHEMA_DRAFT7, response.properties().format()); - Assertions.assertEquals(SchemaType.MESSAGE_SCHEMA, response.properties().schemaType()); - Assertions.assertEquals("kpyouaibrebqaay", response.properties().tags().get("j")); - } - - // Use "Map.of" if available - @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/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasDeleteWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasDeleteWithResponseMockTests.java deleted file mode 100644 index 7dba3ad0dff0..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasDeleteWithResponseMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemasDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.schemas().deleteWithResponse("gikdgsz", "w", "birryuzhl", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasGetWithResponseMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasGetWithResponseMockTests.java deleted file mode 100644 index 2eead55996ce..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.Format; -import com.azure.resourcemanager.deviceregistry.models.Schema; -import com.azure.resourcemanager.deviceregistry.models.SchemaType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemasGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"uuid\":\"psvuoymgc\",\"displayName\":\"lvez\",\"description\":\"pqlmfe\",\"format\":\"JsonSchema/draft-07\",\"schemaType\":\"MessageSchema\",\"provisioningState\":\"Deleting\",\"tags\":{\"opgxedkowepb\":\"yhko\",\"fkbw\":\"pc\",\"khtj\":\"csnjvcdwxlpqekft\"}},\"id\":\"i\",\"name\":\"gwfqatmt\",\"type\":\"htmdvy\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Schema response = manager.schemas() - .getWithResponse("lvdnkfx", "semdwzrmu", "apfcqdpsq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lvez", response.properties().displayName()); - Assertions.assertEquals("pqlmfe", response.properties().description()); - Assertions.assertEquals(Format.JSON_SCHEMA_DRAFT7, response.properties().format()); - Assertions.assertEquals(SchemaType.MESSAGE_SCHEMA, response.properties().schemaType()); - Assertions.assertEquals("yhko", response.properties().tags().get("opgxedkowepb")); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasListBySchemaRegistryMockTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasListBySchemaRegistryMockTests.java deleted file mode 100644 index a1a436d051f8..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SchemasListBySchemaRegistryMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.deviceregistry.DeviceRegistryManager; -import com.azure.resourcemanager.deviceregistry.models.Format; -import com.azure.resourcemanager.deviceregistry.models.Schema; -import com.azure.resourcemanager.deviceregistry.models.SchemaType; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class SchemasListBySchemaRegistryMockTests { - @Test - public void testListBySchemaRegistry() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"uuid\":\"jinrvgoupmfiibfg\",\"displayName\":\"ioolvrwxkvtkkgll\",\"description\":\"jygvjayvbl\",\"format\":\"JsonSchema/draft-07\",\"schemaType\":\"MessageSchema\",\"provisioningState\":\"Succeeded\",\"tags\":{\"opbyrqufegxu\":\"bxvvyhg\",\"bnhlmc\":\"wz\",\"dn\":\"l\",\"ijejvegrhbpn\":\"itvgbmhrixkwm\"}},\"id\":\"xexccbdreaxhcexd\",\"name\":\"rvqahqkghtpwi\",\"type\":\"nhyjsv\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - DeviceRegistryManager manager = DeviceRegistryManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.schemas().listBySchemaRegistry("kj", "qrvqq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ioolvrwxkvtkkgll", response.iterator().next().properties().displayName()); - Assertions.assertEquals("jygvjayvbl", response.iterator().next().properties().description()); - Assertions.assertEquals(Format.JSON_SCHEMA_DRAFT7, response.iterator().next().properties().format()); - Assertions.assertEquals(SchemaType.MESSAGE_SCHEMA, response.iterator().next().properties().schemaType()); - Assertions.assertEquals("bxvvyhg", response.iterator().next().properties().tags().get("opbyrqufegxu")); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SystemAssignedServiceIdentityTests.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SystemAssignedServiceIdentityTests.java deleted file mode 100644 index cb67f0006a34..000000000000 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/test/java/com/azure/resourcemanager/deviceregistry/generated/SystemAssignedServiceIdentityTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.deviceregistry.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentity; -import com.azure.resourcemanager.deviceregistry.models.SystemAssignedServiceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class SystemAssignedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemAssignedServiceIdentity model = BinaryData - .fromString("{\"principalId\":\"avxbniwdjswztsdb\",\"tenantId\":\"nxytxh\",\"type\":\"SystemAssigned\"}") - .toObject(SystemAssignedServiceIdentity.class); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemAssignedServiceIdentity model - = new SystemAssignedServiceIdentity().withType(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(SystemAssignedServiceIdentity.class); - Assertions.assertEquals(SystemAssignedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/tsp-location.yaml b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/tsp-location.yaml index a3c794017c7b..6d88f0127f19 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/tsp-location.yaml +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/deviceregistry/DeviceRegistry.Management -commit: 58740206b853320974ef5e4864f7be8120b15a27 +commit: f9431ab70018e9582da800318a02faa3e0559419 repo: Azure/azure-rest-api-specs additionalDirectories: