diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/CHANGELOG.md b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/CHANGELOG.md index 9bcb65aa9218..2c3f0352334a 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/CHANGELOG.md +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/CHANGELOG.md @@ -1,14 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2025-04-15) -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- 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 (2025-02-21) diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/SAMPLE.md b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/SAMPLE.md index c46a84377e44..39c5a7b6becc 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/SAMPLE.md +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/SAMPLE.md @@ -34,106 +34,68 @@ ### AssetEndpointProfiles_CreateOrReplace ```java -import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfileProperties; -import com.azure.resourcemanager.deviceregistry.models.Authentication; -import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; -import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; -import java.util.HashMap; -import java.util.Map; - /** - * Samples for AssetEndpointProfiles CreateOrReplace. + * Samples for Assets List. */ -public final class AssetEndpointProfilesCreateOrReplaceSamples { +public final class AssetsListSamples { /* - * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + * x-ms-original-file: 2024-11-01/List_Assets_Subscription.json */ /** - * Sample code: Create_AssetEndpointProfile_With_DiscoveredAepRef. + * Sample code: List_Assets_Subscription. * * @param manager Entry point to DeviceRegistryManager. */ - public static void createAssetEndpointProfileWithDiscoveredAepRef( - com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.assetEndpointProfiles() - .define("my-assetendpointprofile") - .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 AssetEndpointProfileProperties().withTargetAddress("https://www.example.com/myTargetAddress") - .withEndpointProfileType("myEndpointProfileType") - .withAuthentication(new Authentication().withMethod(AuthenticationMethod.ANONYMOUS)) - .withDiscoveredAssetEndpointProfileRef("discoveredAssetEndpointProfile1")) - .create(); + public static void listAssetsSubscription(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.assets().list(com.azure.core.util.Context.NONE); } +} +``` + +### AssetEndpointProfiles_Delete +```java +/** + * Samples for BillingContainers List. + */ +public final class BillingContainersListSamples { /* - * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json */ /** - * Sample code: Create_AssetEndpointProfile. + * Sample code: List_BillingContainers_Subscription. * * @param manager Entry point to DeviceRegistryManager. */ public static void - createAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.assetEndpointProfiles() - .define("my-assetendpointprofile") - .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 AssetEndpointProfileProperties().withTargetAddress("https://www.example.com/myTargetAddress") - .withEndpointProfileType("myEndpointProfileType") - .withAuthentication(new Authentication().withMethod(AuthenticationMethod.ANONYMOUS))) - .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; + listBillingContainersSubscription(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.billingContainers().list(com.azure.core.util.Context.NONE); } } ``` -### AssetEndpointProfiles_Delete +### AssetEndpointProfiles_GetByResourceGroup ```java /** - * Samples for AssetEndpointProfiles Delete. + * Samples for Assets ListByResourceGroup. */ -public final class AssetEndpointProfilesDeleteSamples { +public final class AssetsListByResourceGroupSamples { /* - * x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json */ /** - * Sample code: Delete_AssetEndpointProfile. + * Sample code: List_Assets_ResourceGroup. * * @param manager Entry point to DeviceRegistryManager. */ - public static void - deleteAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.assetEndpointProfiles() - .delete("myResourceGroup", "my-assetendpointprofile", com.azure.core.util.Context.NONE); + public static void listAssetsResourceGroup(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.assets().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); } } ``` -### AssetEndpointProfiles_GetByResourceGroup +### AssetEndpointProfiles_List ```java /** @@ -171,7 +133,7 @@ public final class AssetEndpointProfilesGetByResourceGroupSamples { } ``` -### AssetEndpointProfiles_List +### AssetEndpointProfiles_ListByResourceGroup ```java /** @@ -193,7 +155,7 @@ public final class AssetEndpointProfilesListSamples { } ``` -### AssetEndpointProfiles_ListByResourceGroup +### AssetEndpointProfiles_Update ```java /** @@ -215,39 +177,213 @@ public final class AssetEndpointProfilesListByResourceGroupSamples { } ``` -### AssetEndpointProfiles_Update +### Assets_CreateOrReplace ```java -import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfile; -import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfileUpdateProperties; +/** + * Samples for Assets GetByResourceGroup. + */ +public final class AssetsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-11-01/Get_Asset_With_SyncStatus.json + */ + /** + * Sample code: Get_Asset_With_SyncStatus. + * + * @param manager Entry point to DeviceRegistryManager. + */ + public static void getAssetWithSyncStatus(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.assets() + .getByResourceGroupWithResponse("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE); + } + /* + * x-ms-original-file: 2024-11-01/Get_Asset.json + */ + /** + * Sample code: Get_Asset. + * + * @param manager Entry point to DeviceRegistryManager. + */ + public static void getAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.assets() + .getByResourceGroupWithResponse("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE); + } +} +``` + +### Assets_Delete + +```java /** - * Samples for AssetEndpointProfiles Update. + * Samples for Assets Delete. */ -public final class AssetEndpointProfilesUpdateSamples { +public final class AssetsDeleteSamples { /* - * x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Delete_Asset.json */ /** - * Sample code: Update_AssetEndpointProfile. + * Sample code: Delete_Asset. * * @param manager Entry point to DeviceRegistryManager. */ - public static void - updateAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - AssetEndpointProfile resource = manager.assetEndpointProfiles() - .getByResourceGroupWithResponse("myResourceGroup", "my-assetendpointprofile", - com.azure.core.util.Context.NONE) + public static void deleteAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.assets().delete("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE); + } +} +``` + +### Assets_GetByResourceGroup + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2024-11-01/List_Operations.json + */ + /** + * Sample code: List_Operations. + * + * @param manager Entry point to DeviceRegistryManager. + */ + public static void listOperations(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Assets_List + +```java +import com.azure.resourcemanager.deviceregistry.models.Asset; +import com.azure.resourcemanager.deviceregistry.models.AssetUpdateProperties; + +/** + * Samples for Assets Update. + */ +public final class AssetsUpdateSamples { + /* + * x-ms-original-file: 2024-11-01/Update_Asset.json + */ + /** + * Sample code: Update_Asset. + * + * @param manager Entry point to DeviceRegistryManager. + */ + public static void updateAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + Asset resource = manager.assets() + .getByResourceGroupWithResponse("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withProperties( - new AssetEndpointProfileUpdateProperties().withTargetAddress("https://www.example.com/myTargetAddress")) + .withProperties(new AssetUpdateProperties().withEnabled(false).withDisplayName("NewAssetDisplayName")) .apply(); } } ``` -### Assets_CreateOrReplace +### Assets_ListByResourceGroup + +```java +/** + * Samples for BillingContainers Get. + */ +public final class BillingContainersGetSamples { + /* + * x-ms-original-file: 2024-11-01/Get_BillingContainer.json + */ + /** + * Sample code: Get_BillingContainer. + * + * @param manager Entry point to DeviceRegistryManager. + */ + public static void getBillingContainer(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.billingContainers().getWithResponse("my-billingContainer", com.azure.core.util.Context.NONE); + } +} +``` + +### Assets_Update + +```java +import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfileProperties; +import com.azure.resourcemanager.deviceregistry.models.Authentication; +import com.azure.resourcemanager.deviceregistry.models.AuthenticationMethod; +import com.azure.resourcemanager.deviceregistry.models.ExtendedLocation; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AssetEndpointProfiles CreateOrReplace. + */ +public final class AssetEndpointProfilesCreateOrReplaceSamples { + /* + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + */ + /** + * Sample code: Create_AssetEndpointProfile_With_DiscoveredAepRef. + * + * @param manager Entry point to DeviceRegistryManager. + */ + public static void createAssetEndpointProfileWithDiscoveredAepRef( + com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.assetEndpointProfiles() + .define("my-assetendpointprofile") + .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 AssetEndpointProfileProperties().withTargetAddress("https://www.example.com/myTargetAddress") + .withEndpointProfileType("myEndpointProfileType") + .withAuthentication(new Authentication().withMethod(AuthenticationMethod.ANONYMOUS)) + .withDiscoveredAssetEndpointProfileRef("discoveredAssetEndpointProfile1")) + .create(); + } + + /* + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json + */ + /** + * Sample code: Create_AssetEndpointProfile. + * + * @param manager Entry point to DeviceRegistryManager. + */ + public static void + createAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.assetEndpointProfiles() + .define("my-assetendpointprofile") + .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 AssetEndpointProfileProperties().withTargetAddress("https://www.example.com/myTargetAddress") + .withEndpointProfileType("myEndpointProfileType") + .withAuthentication(new Authentication().withMethod(AuthenticationMethod.ANONYMOUS))) + .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; + } +} +``` + +### BillingContainers_Get ```java import com.azure.resourcemanager.deviceregistry.models.AssetProperties; @@ -544,216 +680,80 @@ public final class AssetsCreateOrReplaceSamples { } ``` -### Assets_Delete - -```java -/** - * Samples for Assets Delete. - */ -public final class AssetsDeleteSamples { - /* - * x-ms-original-file: 2024-11-01/Delete_Asset.json - */ - /** - * Sample code: Delete_Asset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void deleteAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.assets().delete("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE); - } -} -``` - -### Assets_GetByResourceGroup - -```java -/** - * Samples for Assets GetByResourceGroup. - */ -public final class AssetsGetByResourceGroupSamples { - /* - * x-ms-original-file: 2024-11-01/Get_Asset_With_SyncStatus.json - */ - /** - * Sample code: Get_Asset_With_SyncStatus. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getAssetWithSyncStatus(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.assets() - .getByResourceGroupWithResponse("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: 2024-11-01/Get_Asset.json - */ - /** - * Sample code: Get_Asset. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.assets() - .getByResourceGroupWithResponse("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE); - } -} -``` - -### Assets_List +### BillingContainers_List ```java /** - * Samples for Assets List. + * Samples for OperationStatus Get. */ -public final class AssetsListSamples { +public final class OperationStatusGetSamples { /* - * x-ms-original-file: 2024-11-01/List_Assets_Subscription.json + * x-ms-original-file: 2024-11-01/Get_OperationStatus.json */ /** - * Sample code: List_Assets_Subscription. + * Sample code: Get_OperationStatus. * * @param manager Entry point to DeviceRegistryManager. */ - public static void listAssetsSubscription(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.assets().list(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); } } ``` -### Assets_ListByResourceGroup +### OperationStatus_Get ```java /** - * Samples for Assets ListByResourceGroup. + * Samples for AssetEndpointProfiles Delete. */ -public final class AssetsListByResourceGroupSamples { +public final class AssetEndpointProfilesDeleteSamples { /* - * x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json + * x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json */ /** - * Sample code: List_Assets_ResourceGroup. + * Sample code: Delete_AssetEndpointProfile. * * @param manager Entry point to DeviceRegistryManager. */ - public static void listAssetsResourceGroup(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.assets().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + public static void + deleteAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + manager.assetEndpointProfiles() + .delete("myResourceGroup", "my-assetendpointprofile", com.azure.core.util.Context.NONE); } } ``` -### Assets_Update +### Operations_List ```java -import com.azure.resourcemanager.deviceregistry.models.Asset; -import com.azure.resourcemanager.deviceregistry.models.AssetUpdateProperties; +import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfile; +import com.azure.resourcemanager.deviceregistry.models.AssetEndpointProfileUpdateProperties; /** - * Samples for Assets Update. + * Samples for AssetEndpointProfiles Update. */ -public final class AssetsUpdateSamples { +public final class AssetEndpointProfilesUpdateSamples { /* - * x-ms-original-file: 2024-11-01/Update_Asset.json + * x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json */ /** - * Sample code: Update_Asset. + * Sample code: Update_AssetEndpointProfile. * * @param manager Entry point to DeviceRegistryManager. */ - public static void updateAsset(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - Asset resource = manager.assets() - .getByResourceGroupWithResponse("myResourceGroup", "my-asset", com.azure.core.util.Context.NONE) + public static void + updateAssetEndpointProfile(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { + AssetEndpointProfile resource = manager.assetEndpointProfiles() + .getByResourceGroupWithResponse("myResourceGroup", "my-assetendpointprofile", + com.azure.core.util.Context.NONE) .getValue(); resource.update() - .withProperties(new AssetUpdateProperties().withEnabled(false).withDisplayName("NewAssetDisplayName")) + .withProperties( + new AssetEndpointProfileUpdateProperties().withTargetAddress("https://www.example.com/myTargetAddress")) .apply(); } } ``` -### BillingContainers_Get - -```java -/** - * Samples for BillingContainers Get. - */ -public final class BillingContainersGetSamples { - /* - * x-ms-original-file: 2024-11-01/Get_BillingContainer.json - */ - /** - * Sample code: Get_BillingContainer. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void getBillingContainer(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.billingContainers().getWithResponse("my-billingContainer", com.azure.core.util.Context.NONE); - } -} -``` - -### BillingContainers_List - -```java -/** - * Samples for BillingContainers List. - */ -public final class BillingContainersListSamples { - /* - * x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json - */ - /** - * Sample code: List_BillingContainers_Subscription. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void - listBillingContainersSubscription(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.billingContainers().list(com.azure.core.util.Context.NONE); - } -} -``` - -### OperationStatus_Get - -```java -/** - * Samples for OperationStatus Get. - */ -public final class OperationStatusGetSamples { - /* - * x-ms-original-file: 2024-11-01/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-11-01/List_Operations.json - */ - /** - * Sample code: List_Operations. - * - * @param manager Entry point to DeviceRegistryManager. - */ - public static void listOperations(com.azure.resourcemanager.deviceregistry.DeviceRegistryManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/pom.xml b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/pom.xml index 8708809cc4d8..8416de3a901b 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/pom.xml +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/pom.xml @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/tsp-location.yaml b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/tsp-location.yaml index bcdeb5605e50..f9fa2951306b 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: 6f175c9c006269a1d0f1928fbc768cacc6ac379a +commit: 6e702986ee542ebd38d0ab2e2f2c00ab48a50b45 repo: Azure/azure-rest-api-specs additionalDirectories: