diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md index 94b29cf68cccd..04dc0773cce30 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-01-31) + +- Azure Resource Manager HybridCompute client library for Java. This package contains Microsoft Azure SDK for HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2022-12. 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/hybridcompute/azure-resourcemanager-hybridcompute/README.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md index ab533a0ade0c5..b0a8f9c8c437c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HybridCompute client library for Java. -This package contains Microsoft Azure SDK for HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2021-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for HybridCompute Management SDK. The Hybrid Compute Management Client. Package tag package-preview-2022-12. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hybridcompute - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md index d138f23c8c8fb..33baabd34e6f1 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/SAMPLE.md @@ -1,6 +1,11 @@ # Code snippets and samples +## ExtensionMetadata + +- [Get](#extensionmetadata_get) +- [List](#extensionmetadata_list) + ## MachineExtensions - [CreateOrUpdate](#machineextensions_createorupdate) @@ -16,6 +21,14 @@ - [List](#machines_list) - [ListByResourceGroup](#machines_listbyresourcegroup) +## NetworkProfile + +- [Get](#networkprofile_get) + +## Operations + +- [List](#operations_list) + ## PrivateEndpointConnections - [CreateOrUpdate](#privateendpointconnections_createorupdate) @@ -38,18 +51,67 @@ - [List](#privatelinkscopes_list) - [ListByResourceGroup](#privatelinkscopes_listbyresourcegroup) - [UpdateTags](#privatelinkscopes_updatetags) + +## ResourceProvider + +- [UpgradeExtensions](#resourceprovider_upgradeextensions) +### ExtensionMetadata_Get + +```java +/** Samples for ExtensionMetadata Get. */ +public final class ExtensionMetadataGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/ExtensionMetadata_Get.json + */ + /** + * Sample code: GET an extensions metadata. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAnExtensionsMetadata(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .getWithResponse( + "EastUS", + "microsoft.azure.monitor", + "azuremonitorlinuxagent", + "1.9.1", + com.azure.core.util.Context.NONE); + } +} +``` + +### ExtensionMetadata_List + +```java +/** Samples for ExtensionMetadata List. */ +public final class ExtensionMetadataListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/ExtensionMetadata_List.json + */ + /** + * Sample code: GET a list of extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAListOfExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .list("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", com.azure.core.util.Context.NONE); + } +} +``` + ### MachineExtensions_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import java.io.IOException; +import java.util.HashMap; +import java.util.Map; /** Samples for MachineExtensions CreateOrUpdate. */ public final class MachineExtensionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PUTExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PUTExtension.json */ /** * Sample code: Create or Update a Machine Extension. @@ -57,27 +119,30 @@ public final class MachineExtensionsCreateOrUpdateSamples { * @param manager Entry point to HybridComputeManager. */ public static void createOrUpdateAMachineExtension( - com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) throws IOException { + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { manager .machineExtensions() .define("CustomScriptExtension") .withRegion("eastus2euap") .withExistingMachine("myResourceGroup", "myMachine") - .withProperties( - new MachineExtensionProperties() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt" - + " 10000 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"")) .create(); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` @@ -87,7 +152,7 @@ public final class MachineExtensionsCreateOrUpdateSamples { /** Samples for MachineExtensions Delete. */ public final class MachineExtensionsDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/DELETEExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/DELETEExtension.json */ /** * Sample code: Delete a Machine Extension. @@ -106,7 +171,7 @@ public final class MachineExtensionsDeleteSamples { /** Samples for MachineExtensions Get. */ public final class MachineExtensionsGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/GETExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/GETExtension.json */ /** * Sample code: GET Machine Extension. @@ -127,7 +192,7 @@ public final class MachineExtensionsGetSamples { /** Samples for MachineExtensions List. */ public final class MachineExtensionsListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/LISTExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/LISTExtension.json */ /** * Sample code: GET all Machine Extensions. @@ -143,16 +208,14 @@ public final class MachineExtensionsListSamples { ### MachineExtensions_Update ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; -import java.io.IOException; +import java.util.HashMap; +import java.util.Map; /** Samples for MachineExtensions Update. */ public final class MachineExtensionsUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/UpdateExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/UpdateExtension.json */ /** * Sample code: Create or Update a Machine Extension. @@ -160,7 +223,7 @@ public final class MachineExtensionsUpdateSamples { * @param manager Entry point to HybridComputeManager. */ public static void createOrUpdateAMachineExtension( - com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) throws IOException { + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { MachineExtension resource = manager .machineExtensions() @@ -169,21 +232,25 @@ public final class MachineExtensionsUpdateSamples { .getValue(); resource .update() - .withProperties( - new MachineExtensionUpdateProperties() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt" - + " 100 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + .withPublisher("Microsoft.Compute") + .withType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(true) + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"")) .apply(); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } ``` @@ -193,7 +260,7 @@ public final class MachineExtensionsUpdateSamples { /** Samples for Machines Delete. */ public final class MachinesDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_Delete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Machines_Delete.json */ /** * Sample code: Delete a Machine. @@ -214,7 +281,7 @@ public final class MachinesDeleteSamples { /** Samples for Machines GetByResourceGroup. */ public final class MachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_Get.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Machines_Get.json */ /** * Sample code: Get Machine. @@ -235,7 +302,7 @@ public final class MachinesGetByResourceGroupSamples { /** Samples for Machines List. */ public final class MachinesListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_ListBySubscription.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Machines_ListBySubscription.json */ /** * Sample code: List Machines by resource group. @@ -255,7 +322,7 @@ public final class MachinesListSamples { /** Samples for Machines ListByResourceGroup. */ public final class MachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_ListByResourceGroup.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Machines_ListByResourceGroup.json */ /** * Sample code: List Machines by resource group. @@ -269,6 +336,45 @@ public final class MachinesListByResourceGroupSamples { } ``` +### NetworkProfile_Get + +```java +/** Samples for NetworkProfile Get. */ +public final class NetworkProfileGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/GETNetworkProfile.json + */ + /** + * Sample code: GET Network Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETNetworkProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.networkProfiles().getWithResponse("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Operations_List.json + */ + /** + * Sample code: List Hybrid Compute Provider Operations. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listHybridComputeProviderOperations( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + ### PrivateEndpointConnections_CreateOrUpdate ```java @@ -278,7 +384,7 @@ import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnecti /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateEndpointConnectionUpdate.json */ /** * Sample code: Approve or reject a private endpoint connection with a given name. @@ -308,7 +414,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateEndpointConnectionDelete.json */ /** * Sample code: Deletes a private endpoint connection with a given name. @@ -334,7 +440,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateEndpointConnectionGet.json */ /** * Sample code: Gets private endpoint connection. @@ -360,7 +466,7 @@ public final class PrivateEndpointConnectionsGetSamples { /** Samples for PrivateEndpointConnections ListByPrivateLinkScope. */ public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionList.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateEndpointConnectionList.json */ /** * Sample code: Gets list of private endpoint connections on a private link scope. @@ -382,7 +488,7 @@ public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { /** Samples for PrivateLinkResources Get. */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json */ /** * Sample code: Gets private endpoint connection. @@ -405,7 +511,7 @@ public final class PrivateLinkResourcesGetSamples { /** Samples for PrivateLinkResources ListByPrivateLinkScope. */ public final class PrivateLinkResourcesListByPrivateLinkScopeSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json */ /** * Sample code: Gets private endpoint connection. @@ -430,7 +536,7 @@ import java.util.Map; /** Samples for PrivateLinkScopes CreateOrUpdate. */ public final class PrivateLinkScopesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesCreate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesCreate.json */ /** * Sample code: PrivateLinkScopeCreate. @@ -447,7 +553,7 @@ public final class PrivateLinkScopesCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesUpdate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesUpdate.json */ /** * Sample code: PrivateLinkScopeUpdate. @@ -483,7 +589,7 @@ public final class PrivateLinkScopesCreateOrUpdateSamples { /** Samples for PrivateLinkScopes Delete. */ public final class PrivateLinkScopesDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesDelete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesDelete.json */ /** * Sample code: PrivateLinkScopesDelete. @@ -504,7 +610,7 @@ public final class PrivateLinkScopesDeleteSamples { /** Samples for PrivateLinkScopes GetByResourceGroup. */ public final class PrivateLinkScopesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesGet.json */ /** * Sample code: PrivateLinkScopeGet. @@ -526,7 +632,7 @@ public final class PrivateLinkScopesGetByResourceGroupSamples { /** Samples for PrivateLinkScopes GetValidationDetails. */ public final class PrivateLinkScopesGetValidationDetailsSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGetValidation.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesGetValidation.json */ /** * Sample code: PrivateLinkScopeGet. @@ -548,7 +654,7 @@ public final class PrivateLinkScopesGetValidationDetailsSamples { /** Samples for PrivateLinkScopes GetValidationDetailsForMachine. */ public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGetValidationForMachine.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesGetValidationForMachine.json */ /** * Sample code: PrivateLinkScopeGet. @@ -570,7 +676,7 @@ public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { /** Samples for PrivateLinkScopes List. */ public final class PrivateLinkScopesListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesList.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesList.json */ /** * Sample code: PrivateLinkScopesList.json. @@ -589,7 +695,7 @@ public final class PrivateLinkScopesListSamples { /** Samples for PrivateLinkScopes ListByResourceGroup. */ public final class PrivateLinkScopesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesListByResourceGroup.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesListByResourceGroup.json */ /** * Sample code: PrivateLinkScopeListByResourceGroup. @@ -613,7 +719,7 @@ import java.util.Map; /** Samples for PrivateLinkScopes UpdateTags. */ public final class PrivateLinkScopesUpdateTagsSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesUpdateTagsOnly.json */ /** * Sample code: PrivateLinkScopeUpdateTagsOnly. @@ -644,3 +750,50 @@ public final class PrivateLinkScopesUpdateTagsSamples { } ``` +### ResourceProvider_UpgradeExtensions + +```java +import com.azure.resourcemanager.hybridcompute.models.ExtensionTargetProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ResourceProvider UpgradeExtensions. */ +public final class ResourceProviderUpgradeExtensionsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Extensions_Upgrade.json + */ + /** + * Sample code: Upgrade Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void upgradeMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .resourceProviders() + .upgradeExtensions( + "myResourceGroup", + "myMachine", + new MachineExtensionUpgrade() + .withExtensionTargets( + mapOf( + "Microsoft.Azure.Monitoring", + new ExtensionTargetProperties().withTargetVersion("2.0"), + "Microsoft.Compute.CustomScriptExtension", + new ExtensionTargetProperties().withTargetVersion("1.10"))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml index 8cd62a19cca0a..a80065efedee9 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for HybridCompute Management - This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2021-03. + This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2022-12. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java index 1a8a7225a1197..a6d47842a56c0 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/HybridComputeManager.java @@ -24,19 +24,25 @@ import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridcompute.fluent.HybridComputeManagementClient; +import com.azure.resourcemanager.hybridcompute.implementation.ExtensionMetadatasImpl; import com.azure.resourcemanager.hybridcompute.implementation.HybridComputeManagementClientBuilder; import com.azure.resourcemanager.hybridcompute.implementation.MachineExtensionsImpl; import com.azure.resourcemanager.hybridcompute.implementation.MachinesImpl; +import com.azure.resourcemanager.hybridcompute.implementation.NetworkProfilesImpl; import com.azure.resourcemanager.hybridcompute.implementation.OperationsImpl; import com.azure.resourcemanager.hybridcompute.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.hybridcompute.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.hybridcompute.implementation.PrivateLinkScopesImpl; +import com.azure.resourcemanager.hybridcompute.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.hybridcompute.models.ExtensionMetadatas; import com.azure.resourcemanager.hybridcompute.models.MachineExtensions; import com.azure.resourcemanager.hybridcompute.models.Machines; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfiles; import com.azure.resourcemanager.hybridcompute.models.Operations; import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnections; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResources; import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopes; +import com.azure.resourcemanager.hybridcompute.models.ResourceProviders; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -50,8 +56,14 @@ public final class HybridComputeManager { private MachineExtensions machineExtensions; + private ResourceProviders resourceProviders; + + private ExtensionMetadatas extensionMetadatas; + private Operations operations; + private NetworkProfiles networkProfiles; + private PrivateLinkScopes privateLinkScopes; private PrivateLinkResources privateLinkResources; @@ -223,7 +235,7 @@ public HybridComputeManager authenticate(TokenCredential credential, AzureProfil .append("-") .append("com.azure.resourcemanager.hybridcompute") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -304,6 +316,30 @@ public MachineExtensions machineExtensions() { return machineExtensions; } + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of ExtensionMetadatas. + * + * @return Resource collection API of ExtensionMetadatas. + */ + public ExtensionMetadatas extensionMetadatas() { + if (this.extensionMetadatas == null) { + this.extensionMetadatas = new ExtensionMetadatasImpl(clientObject.getExtensionMetadatas(), this); + } + return extensionMetadatas; + } + /** * Gets the resource collection API of Operations. * @@ -316,6 +352,18 @@ public Operations operations() { return operations; } + /** + * Gets the resource collection API of NetworkProfiles. + * + * @return Resource collection API of NetworkProfiles. + */ + public NetworkProfiles networkProfiles() { + if (this.networkProfiles == null) { + this.networkProfiles = new NetworkProfilesImpl(clientObject.getNetworkProfiles(), this); + } + return networkProfiles; + } + /** * Gets the resource collection API of PrivateLinkScopes. It manages HybridComputePrivateLinkScope. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java new file mode 100644 index 0000000000000..0c4503ecb66e0 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ExtensionMetadatasClient.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.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.hybridcompute.fluent.models.ExtensionValueInner; + +/** An instance of this class provides access to all the operations defined in ExtensionMetadatasClient. */ +public interface ExtensionMetadatasClient { + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context); + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExtensionValueInner get(String location, String publisher, String extensionType, String version); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String publisher, String extensionType); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, String publisher, String extensionType, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java index 9363ab1e34962..7d3fd6cbd0104 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/HybridComputeManagementClient.java @@ -58,6 +58,20 @@ public interface HybridComputeManagementClient { */ MachineExtensionsClient getMachineExtensions(); + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the ExtensionMetadatasClient object to access its operations. + * + * @return the ExtensionMetadatasClient object. + */ + ExtensionMetadatasClient getExtensionMetadatas(); + /** * Gets the OperationsClient object to access its operations. * @@ -65,6 +79,13 @@ public interface HybridComputeManagementClient { */ OperationsClient getOperations(); + /** + * Gets the NetworkProfilesClient object to access its operations. + * + * @return the NetworkProfilesClient object. + */ + NetworkProfilesClient getNetworkProfiles(); + /** * Gets the PrivateLinkScopesClient object to access its operations. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java index d0ecfaa568607..052a74eb4a8fc 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/MachinesClient.java @@ -15,7 +15,7 @@ /** An instance of this class provides access to all the operations defined in MachinesClient. */ public interface MachinesClient { /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -29,7 +29,7 @@ public interface MachinesClient { Response deleteWithResponse(String resourceGroupName, String machineName, Context context); /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/NetworkProfilesClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/NetworkProfilesClient.java new file mode 100644 index 0000000000000..12bad427e256b --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/NetworkProfilesClient.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; + +/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ +public interface NetworkProfilesClient { + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String machineName, Context context); + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkProfileInner get(String resourceGroupName, String machineName); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..22c4e9a1c6958 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/ResourceProvidersClient.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions 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> beginUpgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @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> beginUpgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions 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 upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @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 upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java new file mode 100644 index 0000000000000..2dbed12fa9426 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueInner.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes a Extension Metadata. */ +@Immutable +public final class ExtensionValueInner extends ProxyResource { + /* + * The single extension based on search criteria + */ + @JsonProperty(value = "properties") + private ExtensionValueProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** Creates an instance of ExtensionValueInner class. */ + public ExtensionValueInner() { + } + + /** + * Get the innerProperties property: The single extension based on search criteria. + * + * @return the innerProperties value. + */ + private ExtensionValueProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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 version property: The version of the Extension being received. + * + * @return the version value. + */ + public String version() { + return this.innerProperties() == null ? null : this.innerProperties().version(); + } + + /** + * Get the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.innerProperties() == null ? null : this.innerProperties().extensionType(); + } + + /** + * Get the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java new file mode 100644 index 0000000000000..e4d1cd9242230 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/ExtensionValueProperties.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes Extension Metadata properties. */ +@Immutable +public final class ExtensionValueProperties { + /* + * The version of the Extension being received. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * The type of the Extension being received. + */ + @JsonProperty(value = "extensionType", access = JsonProperty.Access.WRITE_ONLY) + private String extensionType; + + /* + * The publisher of the Extension being received. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /** Creates an instance of ExtensionValueProperties class. */ + public ExtensionValueProperties() { + } + + /** + * Get the version property: The version of the Extension being received. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + public String extensionType() { + return this.extensionType; + } + + /** + * Get the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java index 1f893b5ee14f7..0dac2a8317fe7 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionInner.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -18,10 +18,10 @@ public final class MachineExtensionInner extends Resource { * Describes Machine Extension Properties. */ @JsonProperty(value = "properties") - private MachineExtensionProperties properties; + private MachineExtensionProperties innerProperties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -31,27 +31,16 @@ public MachineExtensionInner() { } /** - * Get the properties property: Describes Machine Extension Properties. + * Get the innerProperties property: Describes Machine Extension Properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineExtensionProperties properties() { - return this.properties; + private MachineExtensionProperties innerProperties() { + return this.innerProperties; } /** - * Set the properties property: Describes Machine Extension Properties. - * - * @param properties the properties value to set. - * @return the MachineExtensionInner object itself. - */ - public MachineExtensionInner withProperties(MachineExtensionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -73,14 +62,240 @@ public MachineExtensionInner withTags(Map tags) { return this; } + /** + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); + return this; + } + + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withTypePropertiesType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Map settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withSettings(Map settings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Map protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withProtectedSettings(Map protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the instanceView property: The machine extension instance view. + * + * @return the instanceView value. + */ + public MachineExtensionInstanceView instanceView() { + return this.innerProperties() == null ? null : this.innerProperties().instanceView(); + } + + /** + * Set the instanceView property: The machine extension instance view. + * + * @param instanceView the instanceView value to set. + * @return the MachineExtensionInner object itself. + */ + public MachineExtensionInner withInstanceView(MachineExtensionInstanceView instanceView) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionProperties(); + } + this.innerProperties().withInstanceView(instanceView); + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionProperties.java similarity index 81% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionProperties.java index 454bea5796e04..3d1f8b5d626af 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionProperties.java @@ -2,10 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Describes the properties of a Machine Extension. */ @Fluent @@ -34,6 +37,13 @@ public final class MachineExtensionProperties { @JsonProperty(value = "typeHandlerVersion") private String typeHandlerVersion; + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + /* * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set @@ -46,14 +56,16 @@ public final class MachineExtensionProperties { * Json formatted public settings for the extension. */ @JsonProperty(value = "settings") - private Object settings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map settings; /* * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at * all. */ @JsonProperty(value = "protectedSettings") - private Object protectedSettings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map protectedSettings; /* * The provisioning state, which only appears in the response. @@ -153,6 +165,28 @@ public MachineExtensionProperties withTypeHandlerVersion(String typeHandlerVersi return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionProperties object itself. + */ + public MachineExtensionProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + /** * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless @@ -182,7 +216,7 @@ public MachineExtensionProperties withAutoUpgradeMinorVersion(Boolean autoUpgrad * * @return the settings value. */ - public Object settings() { + public Map settings() { return this.settings; } @@ -192,7 +226,7 @@ public Object settings() { * @param settings the settings value to set. * @return the MachineExtensionProperties object itself. */ - public MachineExtensionProperties withSettings(Object settings) { + public MachineExtensionProperties withSettings(Map settings) { this.settings = settings; return this; } @@ -203,7 +237,7 @@ public MachineExtensionProperties withSettings(Object settings) { * * @return the protectedSettings value. */ - public Object protectedSettings() { + public Map protectedSettings() { return this.protectedSettings; } @@ -214,7 +248,7 @@ public Object protectedSettings() { * @param protectedSettings the protectedSettings value to set. * @return the MachineExtensionProperties object itself. */ - public MachineExtensionProperties withProtectedSettings(Object protectedSettings) { + public MachineExtensionProperties withProtectedSettings(Map protectedSettings) { this.protectedSettings = protectedSettings; return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java similarity index 79% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java index 113b394ab1288..18a4c376960b6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdateProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineExtensionUpdateProperties.java @@ -2,10 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; /** Describes the properties of a Machine Extension. */ @Fluent @@ -34,6 +36,13 @@ public final class MachineExtensionUpdateProperties { @JsonProperty(value = "typeHandlerVersion") private String typeHandlerVersion; + /* + * Indicates whether the extension should be automatically upgraded by the platform if there is a newer version + * available. + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + /* * Indicates whether the extension should use a newer minor version if one is available at deployment time. Once * deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set @@ -46,14 +55,16 @@ public final class MachineExtensionUpdateProperties { * Json formatted public settings for the extension. */ @JsonProperty(value = "settings") - private Object settings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map settings; /* * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at * all. */ @JsonProperty(value = "protectedSettings") - private Object protectedSettings; + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map protectedSettings; /** Creates an instance of MachineExtensionUpdateProperties class. */ public MachineExtensionUpdateProperties() { @@ -141,6 +152,28 @@ public MachineExtensionUpdateProperties withTypeHandlerVersion(String typeHandle return this; } + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionUpdateProperties object itself. + */ + public MachineExtensionUpdateProperties withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + /** * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless @@ -170,7 +203,7 @@ public MachineExtensionUpdateProperties withAutoUpgradeMinorVersion(Boolean auto * * @return the settings value. */ - public Object settings() { + public Map settings() { return this.settings; } @@ -180,7 +213,7 @@ public Object settings() { * @param settings the settings value to set. * @return the MachineExtensionUpdateProperties object itself. */ - public MachineExtensionUpdateProperties withSettings(Object settings) { + public MachineExtensionUpdateProperties withSettings(Map settings) { this.settings = settings; return this; } @@ -191,7 +224,7 @@ public MachineExtensionUpdateProperties withSettings(Object settings) { * * @return the protectedSettings value. */ - public Object protectedSettings() { + public Map protectedSettings() { return this.protectedSettings; } @@ -202,7 +235,7 @@ public Object protectedSettings() { * @param protectedSettings the protectedSettings value to set. * @return the MachineExtensionUpdateProperties object itself. */ - public MachineExtensionUpdateProperties withProtectedSettings(Object protectedSettings) { + public MachineExtensionUpdateProperties withProtectedSettings(Map protectedSettings) { this.protectedSettings = protectedSettings; return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java index c883d1849d630..3596fcdb9c330 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineInner.java @@ -7,9 +7,19 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; import com.azure.resourcemanager.hybridcompute.models.Identity; -import com.azure.resourcemanager.hybridcompute.models.MachineProperties; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** Describes a hybrid machine. */ @@ -19,7 +29,13 @@ public final class MachineInner extends Resource { * Hybrid Compute Machine properties */ @JsonProperty(value = "properties") - private MachineProperties properties; + private MachineProperties innerProperties; + + /* + * The list of extensions affiliated to the machine + */ + @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY) + private List resources; /* * Identity for the resource. @@ -28,7 +44,7 @@ public final class MachineInner extends Resource { private Identity identity; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -38,23 +54,21 @@ public MachineInner() { } /** - * Get the properties property: Hybrid Compute Machine properties. + * Get the innerProperties property: Hybrid Compute Machine properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineProperties properties() { - return this.properties; + private MachineProperties innerProperties() { + return this.innerProperties; } /** - * Set the properties property: Hybrid Compute Machine properties. + * Get the resources property: The list of extensions affiliated to the machine. * - * @param properties the properties value to set. - * @return the MachineInner object itself. + * @return the resources value. */ - public MachineInner withProperties(MachineProperties properties) { - this.properties = properties; - return this; + public List resources() { + return this.resources; } /** @@ -78,7 +92,7 @@ public MachineInner withIdentity(Identity identity) { } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -100,14 +114,444 @@ public MachineInner withTags(Map tags) { return this; } + /** + * Get the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + public LocationData locationData() { + return this.innerProperties() == null ? null : this.innerProperties().locationData(); + } + + /** + * Set the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @param locationData the locationData value to set. + * @return the MachineInner object itself. + */ + public MachineInner withLocationData(LocationData locationData) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withLocationData(locationData); + return this; + } + + /** + * Get the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + public AgentConfiguration agentConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().agentConfiguration(); + } + + /** + * Get the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + public ServiceStatuses serviceStatuses() { + return this.innerProperties() == null ? null : this.innerProperties().serviceStatuses(); + } + + /** + * Set the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @param serviceStatuses the serviceStatuses value to set. + * @return the MachineInner object itself. + */ + public MachineInner withServiceStatuses(ServiceStatuses serviceStatuses) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withServiceStatuses(serviceStatuses); + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().cloudMetadata(); + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineInner object itself. + */ + public MachineInner withCloudMetadata(CloudMetadata cloudMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withCloudMetadata(cloudMetadata); + return this; + } + + /** + * Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + public AgentUpgrade agentUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().agentUpgrade(); + } + + /** + * Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @param agentUpgrade the agentUpgrade value to set. + * @return the MachineInner object itself. + */ + public MachineInner withAgentUpgrade(AgentUpgrade agentUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withAgentUpgrade(agentUpgrade); + return this; + } + + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineInner object itself. + */ + public MachineInner withOsProfile(OSProfile osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the status property: The status of the hybrid machine agent. + * + * @return the status value. + */ + public StatusTypes status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the lastStatusChange property: The time of the last status change. + * + * @return the lastStatusChange value. + */ + public OffsetDateTime lastStatusChange() { + return this.innerProperties() == null ? null : this.innerProperties().lastStatusChange(); + } + + /** + * Get the errorDetails property: Details about the error state. + * + * @return the errorDetails value. + */ + public List errorDetails() { + return this.innerProperties() == null ? null : this.innerProperties().errorDetails(); + } + + /** + * Get the agentVersion property: The hybrid machine agent full version. + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.innerProperties() == null ? null : this.innerProperties().agentVersion(); + } + + /** + * Get the vmId property: Specifies the hybrid machine unique ID. + * + * @return the vmId value. + */ + public String vmId() { + return this.innerProperties() == null ? null : this.innerProperties().vmId(); + } + + /** + * Set the vmId property: Specifies the hybrid machine unique ID. + * + * @param vmId the vmId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withVmId(String vmId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withVmId(vmId); + return this; + } + + /** + * Get the displayName property: Specifies the hybrid machine display name. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Get the machineFqdn property: Specifies the hybrid machine FQDN. + * + * @return the machineFqdn value. + */ + public String machineFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().machineFqdn(); + } + + /** + * Get the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @return the clientPublicKey value. + */ + public String clientPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().clientPublicKey(); + } + + /** + * Set the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @param clientPublicKey the clientPublicKey value to set. + * @return the MachineInner object itself. + */ + public MachineInner withClientPublicKey(String clientPublicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withClientPublicKey(clientPublicKey); + return this; + } + + /** + * Get the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + public String osName() { + return this.innerProperties() == null ? null : this.innerProperties().osName(); + } + + /** + * Get the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + public String osVersion() { + return this.innerProperties() == null ? null : this.innerProperties().osVersion(); + } + + /** + * Get the osType property: The type of Operating System (windows/linux). + * + * @return the osType value. + */ + public String osType() { + return this.innerProperties() == null ? null : this.innerProperties().osType(); + } + + /** + * Set the osType property: The type of Operating System (windows/linux). + * + * @param osType the osType value to set. + * @return the MachineInner object itself. + */ + public MachineInner withOsType(String osType) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withOsType(osType); + return this; + } + + /** + * Get the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * + * @return the vmUuid value. + */ + public String vmUuid() { + return this.innerProperties() == null ? null : this.innerProperties().vmUuid(); + } + + /** + * Get the extensions property: Machine Extensions information (deprecated field). + * + * @return the extensions value. + */ + public List extensions() { + return this.innerProperties() == null ? null : this.innerProperties().extensions(); + } + + /** + * Set the extensions property: Machine Extensions information (deprecated field). + * + * @param extensions the extensions value to set. + * @return the MachineInner object itself. + */ + public MachineInner withExtensions(List extensions) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withExtensions(extensions); + return this; + } + + /** + * Get the osSku property: Specifies the Operating System product SKU. + * + * @return the osSku value. + */ + public String osSku() { + return this.innerProperties() == null ? null : this.innerProperties().osSku(); + } + + /** + * Get the domainName property: Specifies the Windows domain name. + * + * @return the domainName value. + */ + public String domainName() { + return this.innerProperties() == null ? null : this.innerProperties().domainName(); + } + + /** + * Get the adFqdn property: Specifies the AD fully qualified display name. + * + * @return the adFqdn value. + */ + public String adFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().adFqdn(); + } + + /** + * Get the dnsFqdn property: Specifies the DNS fully qualified display name. + * + * @return the dnsFqdn value. + */ + public String dnsFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().dnsFqdn(); + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopeResourceId(); + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } + + /** + * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + public String parentClusterResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().parentClusterResourceId(); + } + + /** + * Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @param parentClusterResourceId the parentClusterResourceId value to set. + * @return the MachineInner object itself. + */ + public MachineInner withParentClusterResourceId(String parentClusterResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withParentClusterResourceId(parentClusterResourceId); + return this; + } + + /** + * Get the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + public String mssqlDiscovered() { + return this.innerProperties() == null ? null : this.innerProperties().mssqlDiscovered(); + } + + /** + * Set the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @param mssqlDiscovered the mssqlDiscovered value to set. + * @return the MachineInner object itself. + */ + public MachineInner withMssqlDiscovered(String mssqlDiscovered) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineProperties(); + } + this.innerProperties().withMssqlDiscovered(mssqlDiscovered); + return this; + } + + /** + * Get the detectedProperties property: Detected properties from the machine. + * + * @return the detectedProperties value. + */ + public Map detectedProperties() { + return this.innerProperties() == null ? null : this.innerProperties().detectedProperties(); + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } + if (resources() != null) { + resources().forEach(e -> e.validate()); } if (identity() != null) { identity().validate(); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineProperties.java similarity index 67% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineProperties.java index 44b66c12f682a..2b9dd67002769 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineProperties.java @@ -2,10 +2,18 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -21,10 +29,34 @@ public final class MachineProperties { @JsonProperty(value = "locationData") private LocationData locationData; + /* + * Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + */ + @JsonProperty(value = "agentConfiguration", access = JsonProperty.Access.WRITE_ONLY) + private AgentConfiguration agentConfiguration; + + /* + * Statuses of dependent services that are reported back to ARM. + */ + @JsonProperty(value = "serviceStatuses") + private ServiceStatuses serviceStatuses; + + /* + * The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + */ + @JsonProperty(value = "cloudMetadata") + private CloudMetadata cloudMetadata; + + /* + * The info of the machine w.r.t Agent Upgrade + */ + @JsonProperty(value = "agentUpgrade") + private AgentUpgrade agentUpgrade; + /* * Specifies the operating system settings for the hybrid machine. */ - @JsonProperty(value = "osProfile", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "osProfile") private OSProfile osProfile; /* @@ -93,6 +125,12 @@ public final class MachineProperties { @JsonProperty(value = "osVersion", access = JsonProperty.Access.WRITE_ONLY) private String osVersion; + /* + * The type of Operating System (windows/linux). + */ + @JsonProperty(value = "osType") + private String osType; + /* * Specifies the Arc Machine's unique SMBIOS ID */ @@ -100,7 +138,7 @@ public final class MachineProperties { private String vmUuid; /* - * Machine Extensions information + * Machine Extensions information (deprecated field) */ @JsonProperty(value = "extensions") private List extensions; @@ -141,6 +179,12 @@ public final class MachineProperties { @JsonProperty(value = "parentClusterResourceId") private String parentClusterResourceId; + /* + * Specifies whether any MS SQL instance is discovered on the machine. + */ + @JsonProperty(value = "mssqlDiscovered") + private String mssqlDiscovered; + /* * Detected properties from the machine. */ @@ -172,6 +216,76 @@ public MachineProperties withLocationData(LocationData locationData) { return this; } + /** + * Get the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + public AgentConfiguration agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Get the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + public ServiceStatuses serviceStatuses() { + return this.serviceStatuses; + } + + /** + * Set the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @param serviceStatuses the serviceStatuses value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withServiceStatuses(ServiceStatuses serviceStatuses) { + this.serviceStatuses = serviceStatuses; + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.cloudMetadata; + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withCloudMetadata(CloudMetadata cloudMetadata) { + this.cloudMetadata = cloudMetadata; + return this; + } + + /** + * Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + public AgentUpgrade agentUpgrade() { + return this.agentUpgrade; + } + + /** + * Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @param agentUpgrade the agentUpgrade value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withAgentUpgrade(AgentUpgrade agentUpgrade) { + this.agentUpgrade = agentUpgrade; + return this; + } + /** * Get the osProfile property: Specifies the operating system settings for the hybrid machine. * @@ -181,6 +295,17 @@ public OSProfile osProfile() { return this.osProfile; } + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + /** * Get the provisioningState property: The provisioning state, which only appears in the response. * @@ -304,6 +429,26 @@ public String osVersion() { return this.osVersion; } + /** + * Get the osType property: The type of Operating System (windows/linux). + * + * @return the osType value. + */ + public String osType() { + return this.osType; + } + + /** + * Set the osType property: The type of Operating System (windows/linux). + * + * @param osType the osType value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withOsType(String osType) { + this.osType = osType; + return this; + } + /** * Get the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. * @@ -314,7 +459,7 @@ public String vmUuid() { } /** - * Get the extensions property: Machine Extensions information. + * Get the extensions property: Machine Extensions information (deprecated field). * * @return the extensions value. */ @@ -323,7 +468,7 @@ public List extensions() { } /** - * Set the extensions property: Machine Extensions information. + * Set the extensions property: Machine Extensions information (deprecated field). * * @param extensions the extensions value to set. * @return the MachineProperties object itself. @@ -413,6 +558,26 @@ public MachineProperties withParentClusterResourceId(String parentClusterResourc return this; } + /** + * Get the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + public String mssqlDiscovered() { + return this.mssqlDiscovered; + } + + /** + * Set the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @param mssqlDiscovered the mssqlDiscovered value to set. + * @return the MachineProperties object itself. + */ + public MachineProperties withMssqlDiscovered(String mssqlDiscovered) { + this.mssqlDiscovered = mssqlDiscovered; + return this; + } + /** * Get the detectedProperties property: Detected properties from the machine. * @@ -431,6 +596,18 @@ public void validate() { if (locationData() != null) { locationData().validate(); } + if (agentConfiguration() != null) { + agentConfiguration().validate(); + } + if (serviceStatuses() != null) { + serviceStatuses().validate(); + } + if (cloudMetadata() != null) { + cloudMetadata().validate(); + } + if (agentUpgrade() != null) { + agentUpgrade().validate(); + } if (osProfile() != null) { osProfile().validate(); } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java similarity index 55% rename from sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java rename to sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java index a1e9e601abf02..4ddd5a76ca2b0 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdateProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/MachineUpdateProperties.java @@ -2,9 +2,13 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.hybridcompute.models; +package com.azure.resourcemanager.hybridcompute.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; +import com.azure.resourcemanager.hybridcompute.models.LocationData; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; import com.fasterxml.jackson.annotation.JsonProperty; /** Describes the ARM updatable properties of a hybrid machine. */ @@ -16,6 +20,24 @@ public final class MachineUpdateProperties { @JsonProperty(value = "locationData") private LocationData locationData; + /* + * Specifies the operating system settings for the hybrid machine. + */ + @JsonProperty(value = "osProfile") + private OSProfile osProfile; + + /* + * The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + */ + @JsonProperty(value = "cloudMetadata") + private CloudMetadata cloudMetadata; + + /* + * The info of the machine w.r.t Agent Upgrade + */ + @JsonProperty(value = "agentUpgrade") + private AgentUpgrade agentUpgrade; + /* * The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. */ @@ -52,6 +74,66 @@ public MachineUpdateProperties withLocationData(LocationData locationData) { return this; } + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.cloudMetadata; + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withCloudMetadata(CloudMetadata cloudMetadata) { + this.cloudMetadata = cloudMetadata; + return this; + } + + /** + * Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + public AgentUpgrade agentUpgrade() { + return this.agentUpgrade; + } + + /** + * Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @param agentUpgrade the agentUpgrade value to set. + * @return the MachineUpdateProperties object itself. + */ + public MachineUpdateProperties withAgentUpgrade(AgentUpgrade agentUpgrade) { + this.agentUpgrade = agentUpgrade; + return this; + } + /** * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is * assigned to, if any. @@ -105,5 +187,14 @@ public void validate() { if (locationData() != null) { locationData().validate(); } + if (osProfile() != null) { + osProfile().validate(); + } + if (cloudMetadata() != null) { + cloudMetadata().validate(); + } + if (agentUpgrade() != null) { + agentUpgrade().validate(); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/NetworkProfileInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/NetworkProfileInner.java new file mode 100644 index 0000000000000..41cdc8378ef09 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/NetworkProfileInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.NetworkInterface; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes the network information on this machine. */ +@Fluent +public final class NetworkProfileInner { + /* + * The list of network interfaces. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** Creates an instance of NetworkProfileInner class. */ + public NetworkProfileInner() { + } + + /** + * Get the networkInterfaces property: The list of network interfaces. + * + * @return the networkInterfaces value. + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces property: The list of network interfaces. + * + * @param networkInterfaces the networkInterfaces value to set. + * @return the NetworkProfileInner object itself. + */ + public NetworkProfileInner withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (networkInterfaces() != null) { + networkInterfaces().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java index 2f663ffbd5f3b..3db00f32a5f0c 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/OperationValueInner.java @@ -29,6 +29,12 @@ public final class OperationValueInner { @JsonProperty(value = "display") private OperationValueDisplay display; + /* + * This property indicates if the operation is an action or a data action + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + /** Creates an instance of OperationValueInner class. */ public OperationValueInner() { } @@ -71,6 +77,15 @@ public OperationValueInner withDisplay(OperationValueDisplay display) { return this; } + /** + * Get the isDataAction property: This property indicates if the operation is an action or a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + /** * Validates the instance. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java new file mode 100644 index 0000000000000..d92448aa83ca9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PatchSettings.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.models.AssessmentModeTypes; +import com.azure.resourcemanager.hybridcompute.models.PatchModeTypes; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the patch settings. */ +@Fluent +public final class PatchSettings { + /* + * Specifies the assessment mode. + */ + @JsonProperty(value = "assessmentMode") + private AssessmentModeTypes assessmentMode; + + /* + * Specifies the patch mode. + */ + @JsonProperty(value = "patchMode") + private PatchModeTypes patchMode; + + /** Creates an instance of PatchSettings class. */ + public PatchSettings() { + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.assessmentMode; + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withAssessmentMode(AssessmentModeTypes assessmentMode) { + this.assessmentMode = assessmentMode; + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.patchMode; + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the PatchSettings object itself. + */ + public PatchSettings withPatchMode(PatchModeTypes patchMode) { + this.patchMode = patchMode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java index 457a90a2c289a..26906cb0a4f50 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateEndpointConnectionInner.java @@ -20,7 +20,7 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { private PrivateEndpointConnectionProperties properties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -50,7 +50,7 @@ public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionPr } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java index 6994d21ca666c..de347adac351e 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/fluent/models/PrivateLinkResourceInner.java @@ -20,7 +20,7 @@ public final class PrivateLinkResourceInner extends ProxyResource { private PrivateLinkResourceProperties properties; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -50,7 +50,7 @@ public PrivateLinkResourceInner withProperties(PrivateLinkResourceProperties pro } /** - * Get the systemData property: The system meta data relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java new file mode 100644 index 0000000000000..a5a44dac4fce1 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasClientImpl.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +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.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.hybridcompute.fluent.ExtensionMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValueListResult; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ExtensionMetadatasClient. */ +public final class ExtensionMetadatasClientImpl implements ExtensionMetadatasClient { + /** The proxy service used to perform REST calls. */ + private final ExtensionMetadatasService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of ExtensionMetadatasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExtensionMetadatasClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(ExtensionMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientExtensionMetadatas to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface ExtensionMetadatasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers" + + "/{publisher}/extensionTypes/{extensionType}/versions/{version}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("publisher") String publisher, + @PathParam("extensionType") String extensionType, + @PathParam("version") String version, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers" + + "/{publisher}/extensionTypes/{extensionType}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, + @PathParam("publisher") String publisher, + @PathParam("extensionType") String extensionType, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisher, String extensionType, String version) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version 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(), + location, + publisher, + extensionType, + version, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String location, String publisher, String extensionType, String version, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType is required and cannot be null.")); + } + if (version == null) { + return Mono.error(new IllegalArgumentException("Parameter version 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(), + location, + publisher, + extensionType, + version, + accept, + context); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String location, String publisher, String extensionType, String version) { + return getWithResponseAsync(location, publisher, extensionType, version) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context) { + return getWithResponseAsync(location, publisher, extensionType, version, context).block(); + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExtensionValueInner get(String location, String publisher, String extensionType, String version) { + return getWithResponse(location, publisher, extensionType, version, Context.NONE).getValue(); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publisher, String extensionType) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType 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(), + location, + publisher, + extensionType, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String location, String publisher, String extensionType, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (publisher == null) { + return Mono.error(new IllegalArgumentException("Parameter publisher is required and cannot be null.")); + } + if (extensionType == null) { + return Mono.error(new IllegalArgumentException("Parameter extensionType 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(), + location, + publisher, + extensionType, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, String publisher, String extensionType) { + return new PagedFlux<>(() -> listSinglePageAsync(location, publisher, extensionType)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String location, String publisher, String extensionType, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, publisher, extensionType, context)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, String publisher, String extensionType) { + return new PagedIterable<>(listAsync(location, publisher, extensionType)); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String location, String publisher, String extensionType, Context context) { + return new PagedIterable<>(listAsync(location, publisher, extensionType, context)); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java new file mode 100644 index 0000000000000..bbcaeb86922d2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionMetadatasImpl.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.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.hybridcompute.fluent.ExtensionMetadatasClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionMetadatas; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValue; + +public final class ExtensionMetadatasImpl implements ExtensionMetadatas { + private static final ClientLogger LOGGER = new ClientLogger(ExtensionMetadatasImpl.class); + + private final ExtensionMetadatasClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public ExtensionMetadatasImpl( + ExtensionMetadatasClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context) { + Response inner = + this.serviceClient().getWithResponse(location, publisher, extensionType, version, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ExtensionValueImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ExtensionValue get(String location, String publisher, String extensionType, String version) { + ExtensionValueInner inner = this.serviceClient().get(location, publisher, extensionType, version); + if (inner != null) { + return new ExtensionValueImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String location, String publisher, String extensionType) { + PagedIterable inner = this.serviceClient().list(location, publisher, extensionType); + return Utils.mapPage(inner, inner1 -> new ExtensionValueImpl(inner1, this.manager())); + } + + public PagedIterable list( + String location, String publisher, String extensionType, Context context) { + PagedIterable inner = + this.serviceClient().list(location, publisher, extensionType, context); + return Utils.mapPage(inner, inner1 -> new ExtensionValueImpl(inner1, this.manager())); + } + + private ExtensionMetadatasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java new file mode 100644 index 0000000000000..a39bbab312c23 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ExtensionValueImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.azure.resourcemanager.hybridcompute.models.ExtensionValue; + +public final class ExtensionValueImpl implements ExtensionValue { + private ExtensionValueInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + ExtensionValueImpl( + ExtensionValueInner innerObject, com.azure.resourcemanager.hybridcompute.HybridComputeManager 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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public String version() { + return this.innerModel().version(); + } + + public String extensionType() { + return this.innerModel().extensionType(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public ExtensionValueInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java index fac37bfdac2bc..24d3c0e27e004 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/HybridComputeManagementClientImpl.java @@ -22,13 +22,16 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.hybridcompute.fluent.ExtensionMetadatasClient; import com.azure.resourcemanager.hybridcompute.fluent.HybridComputeManagementClient; import com.azure.resourcemanager.hybridcompute.fluent.MachineExtensionsClient; import com.azure.resourcemanager.hybridcompute.fluent.MachinesClient; +import com.azure.resourcemanager.hybridcompute.fluent.NetworkProfilesClient; import com.azure.resourcemanager.hybridcompute.fluent.OperationsClient; import com.azure.resourcemanager.hybridcompute.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.hybridcompute.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.hybridcompute.fluent.PrivateLinkScopesClient; +import com.azure.resourcemanager.hybridcompute.fluent.ResourceProvidersClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -137,6 +140,30 @@ public MachineExtensionsClient getMachineExtensions() { return this.machineExtensions; } + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The ExtensionMetadatasClient object to access its operations. */ + private final ExtensionMetadatasClient extensionMetadatas; + + /** + * Gets the ExtensionMetadatasClient object to access its operations. + * + * @return the ExtensionMetadatasClient object. + */ + public ExtensionMetadatasClient getExtensionMetadatas() { + return this.extensionMetadatas; + } + /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -149,6 +176,18 @@ public OperationsClient getOperations() { return this.operations; } + /** The NetworkProfilesClient object to access its operations. */ + private final NetworkProfilesClient networkProfiles; + + /** + * Gets the NetworkProfilesClient object to access its operations. + * + * @return the NetworkProfilesClient object. + */ + public NetworkProfilesClient getNetworkProfiles() { + return this.networkProfiles; + } + /** The PrivateLinkScopesClient object to access its operations. */ private final PrivateLinkScopesClient privateLinkScopes; @@ -207,10 +246,13 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-25-preview"; + this.apiVersion = "2022-12-27-preview"; this.machines = new MachinesClientImpl(this); this.machineExtensions = new MachineExtensionsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.extensionMetadatas = new ExtensionMetadatasClientImpl(this); this.operations = new OperationsClientImpl(this); + this.networkProfiles = new NetworkProfilesClientImpl(this); this.privateLinkScopes = new PrivateLinkScopesClientImpl(this); this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java index d73a366c2728e..41a707a762783 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineExtensionImpl.java @@ -9,9 +9,8 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdate; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; import java.util.Collections; import java.util.Map; @@ -46,14 +45,60 @@ public Map tags() { } } - public MachineExtensionProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } + public String forceUpdateTag() { + return this.innerModel().forceUpdateTag(); + } + + public String publisher() { + return this.innerModel().publisher(); + } + + public String typePropertiesType() { + return this.innerModel().typePropertiesType(); + } + + public String typeHandlerVersion() { + return this.innerModel().typeHandlerVersion(); + } + + public Boolean enableAutomaticUpgrade() { + return this.innerModel().enableAutomaticUpgrade(); + } + + public Boolean autoUpgradeMinorVersion() { + return this.innerModel().autoUpgradeMinorVersion(); + } + + public Map settings() { + Map inner = this.innerModel().settings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public Map protectedSettings() { + Map inner = this.innerModel().protectedSettings(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public MachineExtensionInstanceView instanceView() { + return this.innerModel().instanceView(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -185,13 +230,88 @@ public MachineExtensionImpl withTags(Map tags) { } } - public MachineExtensionImpl withProperties(MachineExtensionProperties properties) { - this.innerModel().withProperties(properties); + public MachineExtensionImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.innerModel().withForceUpdateTag(forceUpdateTag); + return this; + } else { + this.updateExtensionParameters.withForceUpdateTag(forceUpdateTag); + return this; + } + } + + public MachineExtensionImpl withPublisher(String publisher) { + if (isInCreateMode()) { + this.innerModel().withPublisher(publisher); + return this; + } else { + this.updateExtensionParameters.withPublisher(publisher); + return this; + } + } + + public MachineExtensionImpl withTypePropertiesType(String typePropertiesType) { + this.innerModel().withTypePropertiesType(typePropertiesType); + return this; + } + + public MachineExtensionImpl withTypeHandlerVersion(String typeHandlerVersion) { + if (isInCreateMode()) { + this.innerModel().withTypeHandlerVersion(typeHandlerVersion); + return this; + } else { + this.updateExtensionParameters.withTypeHandlerVersion(typeHandlerVersion); + return this; + } + } + + public MachineExtensionImpl withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (isInCreateMode()) { + this.innerModel().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } else { + this.updateExtensionParameters.withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + } + + public MachineExtensionImpl withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (isInCreateMode()) { + this.innerModel().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } else { + this.updateExtensionParameters.withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + } + + public MachineExtensionImpl withSettings(Map settings) { + if (isInCreateMode()) { + this.innerModel().withSettings(settings); + return this; + } else { + this.updateExtensionParameters.withSettings(settings); + return this; + } + } + + public MachineExtensionImpl withProtectedSettings(Map protectedSettings) { + if (isInCreateMode()) { + this.innerModel().withProtectedSettings(protectedSettings); + return this; + } else { + this.updateExtensionParameters.withProtectedSettings(protectedSettings); + return this; + } + } + + public MachineExtensionImpl withInstanceView(MachineExtensionInstanceView instanceView) { + this.innerModel().withInstanceView(instanceView); return this; } - public MachineExtensionImpl withProperties(MachineExtensionUpdateProperties properties) { - this.updateExtensionParameters.withProperties(properties); + public MachineExtensionImpl withType(String type) { + this.updateExtensionParameters.withType(type); return this; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java index f1e216d83e41c..96f4124045632 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachineImpl.java @@ -5,12 +5,25 @@ package com.azure.resourcemanager.hybridcompute.implementation; import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import com.azure.resourcemanager.hybridcompute.models.AgentConfiguration; +import com.azure.resourcemanager.hybridcompute.models.AgentUpgrade; +import com.azure.resourcemanager.hybridcompute.models.CloudMetadata; import com.azure.resourcemanager.hybridcompute.models.Identity; +import com.azure.resourcemanager.hybridcompute.models.LocationData; import com.azure.resourcemanager.hybridcompute.models.Machine; -import com.azure.resourcemanager.hybridcompute.models.MachineProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtension; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; +import com.azure.resourcemanager.hybridcompute.models.OSProfile; +import com.azure.resourcemanager.hybridcompute.models.ServiceStatuses; +import com.azure.resourcemanager.hybridcompute.models.StatusTypes; +import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class MachineImpl implements Machine { private MachineInner innerObject; @@ -47,8 +60,18 @@ public Map tags() { } } - public MachineProperties properties() { - return this.innerModel().properties(); + public List resources() { + List inner = this.innerModel().resources(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new MachineExtensionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } } public Identity identity() { @@ -59,6 +82,133 @@ public SystemData systemData() { return this.innerModel().systemData(); } + public LocationData locationData() { + return this.innerModel().locationData(); + } + + public AgentConfiguration agentConfiguration() { + return this.innerModel().agentConfiguration(); + } + + public ServiceStatuses serviceStatuses() { + return this.innerModel().serviceStatuses(); + } + + public CloudMetadata cloudMetadata() { + return this.innerModel().cloudMetadata(); + } + + public AgentUpgrade agentUpgrade() { + return this.innerModel().agentUpgrade(); + } + + public OSProfile osProfile() { + return this.innerModel().osProfile(); + } + + public String provisioningState() { + return this.innerModel().provisioningState(); + } + + public StatusTypes status() { + return this.innerModel().status(); + } + + public OffsetDateTime lastStatusChange() { + return this.innerModel().lastStatusChange(); + } + + public List errorDetails() { + List inner = this.innerModel().errorDetails(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String agentVersion() { + return this.innerModel().agentVersion(); + } + + public String vmId() { + return this.innerModel().vmId(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String machineFqdn() { + return this.innerModel().machineFqdn(); + } + + public String clientPublicKey() { + return this.innerModel().clientPublicKey(); + } + + public String osName() { + return this.innerModel().osName(); + } + + public String osVersion() { + return this.innerModel().osVersion(); + } + + public String osType() { + return this.innerModel().osType(); + } + + public String vmUuid() { + return this.innerModel().vmUuid(); + } + + public List extensions() { + List inner = this.innerModel().extensions(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String osSku() { + return this.innerModel().osSku(); + } + + public String domainName() { + return this.innerModel().domainName(); + } + + public String adFqdn() { + return this.innerModel().adFqdn(); + } + + public String dnsFqdn() { + return this.innerModel().dnsFqdn(); + } + + public String privateLinkScopeResourceId() { + return this.innerModel().privateLinkScopeResourceId(); + } + + public String parentClusterResourceId() { + return this.innerModel().parentClusterResourceId(); + } + + public String mssqlDiscovered() { + return this.innerModel().mssqlDiscovered(); + } + + public Map detectedProperties() { + Map inner = this.innerModel().detectedProperties(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public MachineInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java index e6567b29de31f..baa727e18a5e1 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/MachinesClientImpl.java @@ -135,7 +135,7 @@ Mono> listBySubscriptionNext( } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -182,7 +182,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -228,7 +228,7 @@ private Mono> deleteWithResponseAsync( } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -243,7 +243,7 @@ private Mono deleteAsync(String resourceGroupName, String machineName) { } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -259,7 +259,7 @@ public Response deleteWithResponse(String resourceGroupName, String machin } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfileImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfileImpl.java new file mode 100644 index 0000000000000..8ae7c8220cd14 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfileImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.hybridcompute.models.NetworkInterface; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfile; +import java.util.Collections; +import java.util.List; + +public final class NetworkProfileImpl implements NetworkProfile { + private NetworkProfileInner innerObject; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + NetworkProfileImpl( + NetworkProfileInner innerObject, com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List networkInterfaces() { + List inner = this.innerModel().networkInterfaces(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public NetworkProfileInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesClientImpl.java new file mode 100644 index 0000000000000..c722c9bb01613 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesClientImpl.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +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.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.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.hybridcompute.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in NetworkProfilesClient. */ +public final class NetworkProfilesClientImpl implements NetworkProfilesClient { + /** The proxy service used to perform REST calls. */ + private final NetworkProfilesService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of NetworkProfilesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkProfilesClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(NetworkProfilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientNetworkProfiles to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface NetworkProfilesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" + + "/machines/{machineName}/networkProfile") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String machineName) { + 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 (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName 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, + machineName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String machineName, 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 (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName 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, + machineName, + accept, + context); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String machineName) { + return getWithResponseAsync(resourceGroupName, machineName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String machineName, Context context) { + return getWithResponseAsync(resourceGroupName, machineName, context).block(); + } + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkProfileInner get(String resourceGroupName, String machineName) { + return getWithResponse(resourceGroupName, machineName, Context.NONE).getValue(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesImpl.java new file mode 100644 index 0000000000000..3ed703f3f3929 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/NetworkProfilesImpl.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +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.hybridcompute.fluent.NetworkProfilesClient; +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfile; +import com.azure.resourcemanager.hybridcompute.models.NetworkProfiles; + +public final class NetworkProfilesImpl implements NetworkProfiles { + private static final ClientLogger LOGGER = new ClientLogger(NetworkProfilesImpl.class); + + private final NetworkProfilesClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public NetworkProfilesImpl( + NetworkProfilesClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String machineName, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, machineName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NetworkProfileImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkProfile get(String resourceGroupName, String machineName) { + NetworkProfileInner inner = this.serviceClient().get(resourceGroupName, machineName); + if (inner != null) { + return new NetworkProfileImpl(inner, this.manager()); + } else { + return null; + } + } + + private NetworkProfilesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java index df3cc1e8dd4f5..323ba788ca213 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationValueImpl.java @@ -31,6 +31,10 @@ public OperationValueDisplay display() { return this.innerModel().display(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationValueInner innerModel() { return this.innerObject; } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..ed81d24d6eb21 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +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.Post; +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.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.hybridcompute.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +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 ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final HybridComputeManagementClientImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(HybridComputeManagementClientImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridComputeManagementClientResourceProviders to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "HybridComputeManagem") + public interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute" + + "/machines/{machineName}/upgradeExtensions") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> upgradeExtensions( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("machineName") String machineName, + @BodyParam("application/json") MachineExtensionUpgrade extensionUpgradeParameters, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions 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>> upgradeExtensionsWithResponseAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + 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 (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .upgradeExtensions( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + extensionUpgradeParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @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>> upgradeExtensionsWithResponseAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + 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 (machineName == null) { + return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null.")); + } + if (extensionUpgradeParameters == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter extensionUpgradeParameters is required and cannot be null.")); + } else { + extensionUpgradeParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .upgradeExtensions( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + machineName, + extensionUpgradeParameters, + accept, + context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions 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> beginUpgradeExtensionsAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + Mono>> mono = + upgradeExtensionsWithResponseAsync(resourceGroupName, machineName, extensionUpgradeParameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @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> beginUpgradeExtensionsAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + upgradeExtensionsWithResponseAsync(resourceGroupName, machineName, extensionUpgradeParameters, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions 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> beginUpgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + return this + .beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters) + .getSyncPoller(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @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> beginUpgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + return this + .beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context) + .getSyncPoller(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions 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 upgradeExtensionsAsync( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + return beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @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 upgradeExtensionsAsync( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + return beginUpgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions 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 upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + upgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters).block(); + } + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @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 upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + upgradeExtensionsAsync(resourceGroupName, machineName, extensionUpgradeParameters, context).block(); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..cea28dc9778fd --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/ResourceProvidersImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridcompute.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import com.azure.resourcemanager.hybridcompute.models.ResourceProviders; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, + com.azure.resourcemanager.hybridcompute.HybridComputeManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters) { + this.serviceClient().upgradeExtensions(resourceGroupName, machineName, extensionUpgradeParameters); + } + + public void upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context) { + this.serviceClient().upgradeExtensions(resourceGroupName, machineName, extensionUpgradeParameters, context); + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridcompute.HybridComputeManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java new file mode 100644 index 0000000000000..ac3b543a3ed29 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfiguration.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. */ +@Immutable +public final class AgentConfiguration { + /* + * Specifies the URL of the proxy to be used. + */ + @JsonProperty(value = "proxyUrl", access = JsonProperty.Access.WRITE_ONLY) + private String proxyUrl; + + /* + * Specifies the list of ports that the agent will be able to listen on. + */ + @JsonProperty(value = "incomingConnectionsPorts", access = JsonProperty.Access.WRITE_ONLY) + private List incomingConnectionsPorts; + + /* + * Array of extensions that are allowed to be installed or updated. + */ + @JsonProperty(value = "extensionsAllowList", access = JsonProperty.Access.WRITE_ONLY) + private List extensionsAllowList; + + /* + * Array of extensions that are blocked (cannot be installed or updated) + */ + @JsonProperty(value = "extensionsBlockList", access = JsonProperty.Access.WRITE_ONLY) + private List extensionsBlockList; + + /* + * List of service names which should not use the specified proxy server. + */ + @JsonProperty(value = "proxyBypass", access = JsonProperty.Access.WRITE_ONLY) + private List proxyBypass; + + /* + * Specifies whether the extension service is enabled or disabled. + */ + @JsonProperty(value = "extensionsEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String extensionsEnabled; + + /* + * Specified whether the guest configuration service is enabled or disabled. + */ + @JsonProperty(value = "guestConfigurationEnabled", access = JsonProperty.Access.WRITE_ONLY) + private String guestConfigurationEnabled; + + /* + * Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension + * allowlists and guest configuration, maintained by Microsoft. + */ + @JsonProperty(value = "configMode", access = JsonProperty.Access.WRITE_ONLY) + private AgentConfigurationMode configMode; + + /** Creates an instance of AgentConfiguration class. */ + public AgentConfiguration() { + } + + /** + * Get the proxyUrl property: Specifies the URL of the proxy to be used. + * + * @return the proxyUrl value. + */ + public String proxyUrl() { + return this.proxyUrl; + } + + /** + * Get the incomingConnectionsPorts property: Specifies the list of ports that the agent will be able to listen on. + * + * @return the incomingConnectionsPorts value. + */ + public List incomingConnectionsPorts() { + return this.incomingConnectionsPorts; + } + + /** + * Get the extensionsAllowList property: Array of extensions that are allowed to be installed or updated. + * + * @return the extensionsAllowList value. + */ + public List extensionsAllowList() { + return this.extensionsAllowList; + } + + /** + * Get the extensionsBlockList property: Array of extensions that are blocked (cannot be installed or updated). + * + * @return the extensionsBlockList value. + */ + public List extensionsBlockList() { + return this.extensionsBlockList; + } + + /** + * Get the proxyBypass property: List of service names which should not use the specified proxy server. + * + * @return the proxyBypass value. + */ + public List proxyBypass() { + return this.proxyBypass; + } + + /** + * Get the extensionsEnabled property: Specifies whether the extension service is enabled or disabled. + * + * @return the extensionsEnabled value. + */ + public String extensionsEnabled() { + return this.extensionsEnabled; + } + + /** + * Get the guestConfigurationEnabled property: Specified whether the guest configuration service is enabled or + * disabled. + * + * @return the guestConfigurationEnabled value. + */ + public String guestConfigurationEnabled() { + return this.guestConfigurationEnabled; + } + + /** + * Get the configMode property: Name of configuration mode to use. Modes are pre-defined configurations of security + * controls, extension allowlists and guest configuration, maintained by Microsoft. + * + * @return the configMode value. + */ + public AgentConfigurationMode configMode() { + return this.configMode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionsAllowList() != null) { + extensionsAllowList().forEach(e -> e.validate()); + } + if (extensionsBlockList() != null) { + extensionsBlockList().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java new file mode 100644 index 0000000000000..5d9bfbdbe5ce2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentConfigurationMode.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension allowlists + * and guest configuration, maintained by Microsoft. + */ +public final class AgentConfigurationMode extends ExpandableStringEnum { + /** Static value full for AgentConfigurationMode. */ + public static final AgentConfigurationMode FULL = fromString("full"); + + /** Static value monitor for AgentConfigurationMode. */ + public static final AgentConfigurationMode MONITOR = fromString("monitor"); + + /** + * Creates a new instance of AgentConfigurationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentConfigurationMode() { + } + + /** + * Creates or finds a AgentConfigurationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentConfigurationMode. + */ + @JsonCreator + public static AgentConfigurationMode fromString(String name) { + return fromString(name, AgentConfigurationMode.class); + } + + /** + * Gets known AgentConfigurationMode values. + * + * @return known AgentConfigurationMode values. + */ + public static Collection values() { + return values(AgentConfigurationMode.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentUpgrade.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentUpgrade.java new file mode 100644 index 0000000000000..9c3c05c18ab02 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AgentUpgrade.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The info w.r.t Agent Upgrade. */ +@Fluent +public final class AgentUpgrade { + /* + * Specifies the version info w.r.t AgentUpgrade for the machine. + */ + @JsonProperty(value = "desiredVersion") + private String desiredVersion; + + /* + * The correlation ID passed in from RSM per upgrade. + */ + @JsonProperty(value = "correlationId") + private String correlationId; + + /* + * Specifies if RSM should try to upgrade this machine + */ + @JsonProperty(value = "enableAutomaticUpgrade") + private Boolean enableAutomaticUpgrade; + + /* + * Timestamp of last upgrade attempt + */ + @JsonProperty(value = "lastAttemptTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private String lastAttemptTimestamp; + + /* + * Specifies the status of Agent Upgrade. + */ + @JsonProperty(value = "lastAttemptStatus", access = JsonProperty.Access.WRITE_ONLY) + private LastAttemptStatusEnum lastAttemptStatus; + + /* + * Failure message of last upgrade attempt if any. + */ + @JsonProperty(value = "lastAttemptMessage", access = JsonProperty.Access.WRITE_ONLY) + private String lastAttemptMessage; + + /** Creates an instance of AgentUpgrade class. */ + public AgentUpgrade() { + } + + /** + * Get the desiredVersion property: Specifies the version info w.r.t AgentUpgrade for the machine. + * + * @return the desiredVersion value. + */ + public String desiredVersion() { + return this.desiredVersion; + } + + /** + * Set the desiredVersion property: Specifies the version info w.r.t AgentUpgrade for the machine. + * + * @param desiredVersion the desiredVersion value to set. + * @return the AgentUpgrade object itself. + */ + public AgentUpgrade withDesiredVersion(String desiredVersion) { + this.desiredVersion = desiredVersion; + return this; + } + + /** + * Get the correlationId property: The correlation ID passed in from RSM per upgrade. + * + * @return the correlationId value. + */ + public String correlationId() { + return this.correlationId; + } + + /** + * Set the correlationId property: The correlation ID passed in from RSM per upgrade. + * + * @param correlationId the correlationId value to set. + * @return the AgentUpgrade object itself. + */ + public AgentUpgrade withCorrelationId(String correlationId) { + this.correlationId = correlationId; + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Specifies if RSM should try to upgrade this machine. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.enableAutomaticUpgrade; + } + + /** + * Set the enableAutomaticUpgrade property: Specifies if RSM should try to upgrade this machine. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the AgentUpgrade object itself. + */ + public AgentUpgrade withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + this.enableAutomaticUpgrade = enableAutomaticUpgrade; + return this; + } + + /** + * Get the lastAttemptTimestamp property: Timestamp of last upgrade attempt. + * + * @return the lastAttemptTimestamp value. + */ + public String lastAttemptTimestamp() { + return this.lastAttemptTimestamp; + } + + /** + * Get the lastAttemptStatus property: Specifies the status of Agent Upgrade. + * + * @return the lastAttemptStatus value. + */ + public LastAttemptStatusEnum lastAttemptStatus() { + return this.lastAttemptStatus; + } + + /** + * Get the lastAttemptMessage property: Failure message of last upgrade attempt if any. + * + * @return the lastAttemptMessage value. + */ + public String lastAttemptMessage() { + return this.lastAttemptMessage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java new file mode 100644 index 0000000000000..8ecd309c1751f --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/AssessmentModeTypes.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the assessment mode. */ +public final class AssessmentModeTypes extends ExpandableStringEnum { + /** Static value ImageDefault for AssessmentModeTypes. */ + public static final AssessmentModeTypes IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for AssessmentModeTypes. */ + public static final AssessmentModeTypes AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** + * Creates a new instance of AssessmentModeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AssessmentModeTypes() { + } + + /** + * Creates or finds a AssessmentModeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding AssessmentModeTypes. + */ + @JsonCreator + public static AssessmentModeTypes fromString(String name) { + return fromString(name, AssessmentModeTypes.class); + } + + /** + * Gets known AssessmentModeTypes values. + * + * @return known AssessmentModeTypes values. + */ + public static Collection values() { + return values(AssessmentModeTypes.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java new file mode 100644 index 0000000000000..ac65d2743e4fa --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/CloudMetadata.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The metadata of the cloud environment (Azure/GCP/AWS/OCI...). */ +@Immutable +public final class CloudMetadata { + /* + * Specifies the cloud provider (Azure/AWS/GCP...). + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** Creates an instance of CloudMetadata class. */ + public CloudMetadata() { + } + + /** + * Get the provider property: Specifies the cloud provider (Azure/AWS/GCP...). + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java new file mode 100644 index 0000000000000..096d36407fd92 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ConfigurationExtension.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties that can identify extensions. */ +@Immutable +public final class ConfigurationExtension { + /* + * Publisher of the extension. + */ + @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) + private String publisher; + + /* + * Type of the extension. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** Creates an instance of ConfigurationExtension class. */ + public ConfigurationExtension() { + } + + /** + * Get the publisher property: Publisher of the extension. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Get the type property: Type of the extension. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java new file mode 100644 index 0000000000000..9c2700b105289 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionMetadatas.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.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 ExtensionMetadatas. */ +public interface ExtensionMetadatas { + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version along with {@link + * Response}. + */ + Response getWithResponse( + String location, String publisher, String extensionType, String version, Context context); + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @param version The version of the Extension being received. + * @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 an Extension Metadata based on location, publisher, extensionType and version. + */ + ExtensionValue get(String location, String publisher, String extensionType, String version); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String location, String publisher, String extensionType); + + /** + * Gets all Extension versions based on location, publisher, extensionType. + * + * @param location The location of the Extension being received. + * @param publisher The publisher of the Extension being received. + * @param extensionType The extensionType of the Extension being received. + * @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 all Extension versions based on location, publisher, extensionType as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(String location, String publisher, String extensionType, Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java new file mode 100644 index 0000000000000..a7c0c522490ec --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionTargetProperties.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the Machine Extension Target Version Properties. */ +@Fluent +public final class ExtensionTargetProperties { + /* + * Properties for the specified Extension to Upgrade. + */ + @JsonProperty(value = "targetVersion") + private String targetVersion; + + /** Creates an instance of ExtensionTargetProperties class. */ + public ExtensionTargetProperties() { + } + + /** + * Get the targetVersion property: Properties for the specified Extension to Upgrade. + * + * @return the targetVersion value. + */ + public String targetVersion() { + return this.targetVersion; + } + + /** + * Set the targetVersion property: Properties for the specified Extension to Upgrade. + * + * @param targetVersion the targetVersion value to set. + * @return the ExtensionTargetProperties object itself. + */ + public ExtensionTargetProperties withTargetVersion(String targetVersion) { + this.targetVersion = targetVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java new file mode 100644 index 0000000000000..1538a450b3c18 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValue.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; + +/** An immutable client-side representation of ExtensionValue. */ +public interface ExtensionValue { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the version property: The version of the Extension being received. + * + * @return the version value. + */ + String version(); + + /** + * Gets the extensionType property: The type of the Extension being received. + * + * @return the extensionType value. + */ + String extensionType(); + + /** + * Gets the publisher property: The publisher of the Extension being received. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner object. + * + * @return the inner object. + */ + ExtensionValueInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java new file mode 100644 index 0000000000000..c773218ee9aae --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ExtensionValueListResult.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.hybridcompute.fluent.models.ExtensionValueInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The List Extension Metadata response. */ +@Immutable +public final class ExtensionValueListResult { + /* + * The list of extension metadata + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** Creates an instance of ExtensionValueListResult class. */ + public ExtensionValueListResult() { + } + + /** + * Get the value property: The list of extension metadata. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java index 505090624185d..c21577f80bc21 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/HybridComputePrivateLinkScopeProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Properties that define a Azure Arc PrivateLinkScope resource. */ @Fluent @@ -31,6 +32,12 @@ public final class HybridComputePrivateLinkScopeProperties { @JsonProperty(value = "privateLinkScopeId", access = JsonProperty.Access.WRITE_ONLY) private String privateLinkScopeId; + /* + * The collection of associated Private Endpoint Connections. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + /** Creates an instance of HybridComputePrivateLinkScopeProperties class. */ public HybridComputePrivateLinkScopeProperties() { } @@ -78,11 +85,23 @@ public String privateLinkScopeId() { return this.privateLinkScopeId; } + /** + * Get the privateEndpointConnections property: The collection of associated Private Endpoint Connections. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/IpAddress.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/IpAddress.java new file mode 100644 index 0000000000000..8adedcdbb937f --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/IpAddress.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes properties of the IP address. */ +@Fluent +public final class IpAddress { + /* + * Represents the IP Address. + */ + @JsonProperty(value = "address") + private String address; + + /* + * Represents the Ip Address Version. + */ + @JsonProperty(value = "ipAddressVersion") + private String ipAddressVersion; + + /* + * The subnet to which this IP address belongs. + */ + @JsonProperty(value = "subnet", access = JsonProperty.Access.WRITE_ONLY) + private Subnet subnet; + + /** Creates an instance of IpAddress class. */ + public IpAddress() { + } + + /** + * Get the address property: Represents the IP Address. + * + * @return the address value. + */ + public String address() { + return this.address; + } + + /** + * Set the address property: Represents the IP Address. + * + * @param address the address value to set. + * @return the IpAddress object itself. + */ + public IpAddress withAddress(String address) { + this.address = address; + return this; + } + + /** + * Get the ipAddressVersion property: Represents the Ip Address Version. + * + * @return the ipAddressVersion value. + */ + public String ipAddressVersion() { + return this.ipAddressVersion; + } + + /** + * Set the ipAddressVersion property: Represents the Ip Address Version. + * + * @param ipAddressVersion the ipAddressVersion value to set. + * @return the IpAddress object itself. + */ + public IpAddress withIpAddressVersion(String ipAddressVersion) { + this.ipAddressVersion = ipAddressVersion; + return this; + } + + /** + * Get the subnet property: The subnet to which this IP address belongs. + * + * @return the subnet value. + */ + public Subnet subnet() { + return this.subnet; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnet() != null) { + subnet().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LastAttemptStatusEnum.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LastAttemptStatusEnum.java new file mode 100644 index 0000000000000..d111040e7a7a9 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/LastAttemptStatusEnum.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the status of Agent Upgrade. */ +public final class LastAttemptStatusEnum extends ExpandableStringEnum { + /** Static value Success for LastAttemptStatusEnum. */ + public static final LastAttemptStatusEnum SUCCESS = fromString("Success"); + + /** Static value Failed for LastAttemptStatusEnum. */ + public static final LastAttemptStatusEnum FAILED = fromString("Failed"); + + /** + * Creates a new instance of LastAttemptStatusEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LastAttemptStatusEnum() { + } + + /** + * Creates or finds a LastAttemptStatusEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding LastAttemptStatusEnum. + */ + @JsonCreator + public static LastAttemptStatusEnum fromString(String name) { + return fromString(name, LastAttemptStatusEnum.class); + } + + /** + * Gets known LastAttemptStatusEnum values. + * + * @return known LastAttemptStatusEnum values. + */ + public static Collection values() { + return values(LastAttemptStatusEnum.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java index 4d18ab209beb8..d9d2946d03e23 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machine.java @@ -5,7 +5,10 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; import com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** An immutable client-side representation of Machine. */ @@ -46,11 +49,11 @@ public interface Machine { Map tags(); /** - * Gets the properties property: Hybrid Compute Machine properties. + * Gets the resources property: The list of extensions affiliated to the machine. * - * @return the properties value. + * @return the resources value. */ - MachineProperties properties(); + List resources(); /** * Gets the identity property: Identity for the resource. @@ -60,12 +63,212 @@ public interface Machine { Identity identity(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); + /** + * Gets the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + LocationData locationData(); + + /** + * Gets the agentConfiguration property: Configurable properties that the user can set locally via the azcmagent + * config command, or remotely via ARM. + * + * @return the agentConfiguration value. + */ + AgentConfiguration agentConfiguration(); + + /** + * Gets the serviceStatuses property: Statuses of dependent services that are reported back to ARM. + * + * @return the serviceStatuses value. + */ + ServiceStatuses serviceStatuses(); + + /** + * Gets the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + CloudMetadata cloudMetadata(); + + /** + * Gets the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + AgentUpgrade agentUpgrade(); + + /** + * Gets the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + OSProfile osProfile(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the status property: The status of the hybrid machine agent. + * + * @return the status value. + */ + StatusTypes status(); + + /** + * Gets the lastStatusChange property: The time of the last status change. + * + * @return the lastStatusChange value. + */ + OffsetDateTime lastStatusChange(); + + /** + * Gets the errorDetails property: Details about the error state. + * + * @return the errorDetails value. + */ + List errorDetails(); + + /** + * Gets the agentVersion property: The hybrid machine agent full version. + * + * @return the agentVersion value. + */ + String agentVersion(); + + /** + * Gets the vmId property: Specifies the hybrid machine unique ID. + * + * @return the vmId value. + */ + String vmId(); + + /** + * Gets the displayName property: Specifies the hybrid machine display name. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the machineFqdn property: Specifies the hybrid machine FQDN. + * + * @return the machineFqdn value. + */ + String machineFqdn(); + + /** + * Gets the clientPublicKey property: Public Key that the client provides to be used during initial resource + * onboarding. + * + * @return the clientPublicKey value. + */ + String clientPublicKey(); + + /** + * Gets the osName property: The Operating System running on the hybrid machine. + * + * @return the osName value. + */ + String osName(); + + /** + * Gets the osVersion property: The version of Operating System running on the hybrid machine. + * + * @return the osVersion value. + */ + String osVersion(); + + /** + * Gets the osType property: The type of Operating System (windows/linux). + * + * @return the osType value. + */ + String osType(); + + /** + * Gets the vmUuid property: Specifies the Arc Machine's unique SMBIOS ID. + * + * @return the vmUuid value. + */ + String vmUuid(); + + /** + * Gets the extensions property: Machine Extensions information (deprecated field). + * + * @return the extensions value. + */ + List extensions(); + + /** + * Gets the osSku property: Specifies the Operating System product SKU. + * + * @return the osSku value. + */ + String osSku(); + + /** + * Gets the domainName property: Specifies the Windows domain name. + * + * @return the domainName value. + */ + String domainName(); + + /** + * Gets the adFqdn property: Specifies the AD fully qualified display name. + * + * @return the adFqdn value. + */ + String adFqdn(); + + /** + * Gets the dnsFqdn property: Specifies the DNS fully qualified display name. + * + * @return the dnsFqdn value. + */ + String dnsFqdn(); + + /** + * Gets the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + String privateLinkScopeResourceId(); + + /** + * Gets the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + String parentClusterResourceId(); + + /** + * Gets the mssqlDiscovered property: Specifies whether any MS SQL instance is discovered on the machine. + * + * @return the mssqlDiscovered value. + */ + String mssqlDiscovered(); + + /** + * Gets the detectedProperties property: Detected properties from the machine. + * + * @return the detectedProperties value. + */ + Map detectedProperties(); + /** * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.MachineInner object. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java index f6f0ffd27e979..e4ae52de3ecce 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtension.java @@ -48,18 +48,86 @@ public interface MachineExtension { Map tags(); /** - * Gets the properties property: Describes Machine Extension Properties. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - MachineExtensionProperties properties(); + SystemData systemData(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. * - * @return the systemData value. + * @return the forceUpdateTag value. */ - SystemData systemData(); + String forceUpdateTag(); + + /** + * Gets the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + String publisher(); + + /** + * Gets the typePropertiesType property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the typePropertiesType value. + */ + String typePropertiesType(); + + /** + * Gets the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + String typeHandlerVersion(); + + /** + * Gets the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + Boolean enableAutomaticUpgrade(); + + /** + * Gets the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if + * one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + Boolean autoUpgradeMinorVersion(); + + /** + * Gets the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + Map settings(); + + /** + * Gets the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + Map protectedSettings(); + + /** + * Gets the provisioningState property: The provisioning state, which only appears in the response. + * + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * Gets the instanceView property: The machine extension instance view. + * + * @return the instanceView value. + */ + MachineExtensionInstanceView instanceView(); /** * Gets the region of the resource. @@ -134,7 +202,17 @@ interface WithParentResource { * The stage of the MachineExtension 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 { + interface WithCreate + extends DefinitionStages.WithTags, + DefinitionStages.WithForceUpdateTag, + DefinitionStages.WithPublisher, + DefinitionStages.WithTypePropertiesType, + DefinitionStages.WithTypeHandlerVersion, + DefinitionStages.WithEnableAutomaticUpgrade, + DefinitionStages.WithAutoUpgradeMinorVersion, + DefinitionStages.WithSettings, + DefinitionStages.WithProtectedSettings, + DefinitionStages.WithInstanceView { /** * Executes the create request. * @@ -160,15 +238,106 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the MachineExtension definition allowing to specify properties. */ - interface WithProperties { + /** The stage of the MachineExtension definition allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { /** - * Specifies the properties property: Describes Machine Extension Properties.. + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. * - * @param properties Describes Machine Extension Properties. + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. * @return the next definition stage. */ - WithCreate withProperties(MachineExtensionProperties properties); + WithCreate withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the MachineExtension definition allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + WithCreate withPublisher(String publisher); + } + /** The stage of the MachineExtension definition allowing to specify typePropertiesType. */ + interface WithTypePropertiesType { + /** + * Specifies the typePropertiesType property: Specifies the type of the extension; an example is + * "CustomScriptExtension".. + * + * @param typePropertiesType Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + WithCreate withTypePropertiesType(String typePropertiesType); + } + /** The stage of the MachineExtension definition allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + WithCreate withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the MachineExtension definition allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + WithCreate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the MachineExtension definition allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + WithCreate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the MachineExtension definition allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + WithCreate withSettings(Map settings); + } + /** The stage of the MachineExtension definition allowing to specify protectedSettings. */ + interface WithProtectedSettings { + /** + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. + * + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * @return the next definition stage. + */ + WithCreate withProtectedSettings(Map protectedSettings); + } + /** The stage of the MachineExtension definition allowing to specify instanceView. */ + interface WithInstanceView { + /** + * Specifies the instanceView property: The machine extension instance view.. + * + * @param instanceView The machine extension instance view. + * @return the next definition stage. + */ + WithCreate withInstanceView(MachineExtensionInstanceView instanceView); } } /** @@ -179,7 +348,16 @@ interface WithProperties { MachineExtension.Update update(); /** The template for MachineExtension update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithForceUpdateTag, + UpdateStages.WithPublisher, + UpdateStages.WithType, + UpdateStages.WithTypeHandlerVersion, + UpdateStages.WithEnableAutomaticUpgrade, + UpdateStages.WithAutoUpgradeMinorVersion, + UpdateStages.WithSettings, + UpdateStages.WithProtectedSettings { /** * Executes the update request. * @@ -207,15 +385,95 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the MachineExtension update allowing to specify properties. */ - interface WithProperties { + /** The stage of the MachineExtension update allowing to specify forceUpdateTag. */ + interface WithForceUpdateTag { + /** + * Specifies the forceUpdateTag property: How the extension handler should be forced to update even if the + * extension configuration has not changed.. + * + * @param forceUpdateTag How the extension handler should be forced to update even if the extension + * configuration has not changed. + * @return the next definition stage. + */ + Update withForceUpdateTag(String forceUpdateTag); + } + /** The stage of the MachineExtension update allowing to specify publisher. */ + interface WithPublisher { + /** + * Specifies the publisher property: The name of the extension handler publisher.. + * + * @param publisher The name of the extension handler publisher. + * @return the next definition stage. + */ + Update withPublisher(String publisher); + } + /** The stage of the MachineExtension update allowing to specify type. */ + interface WithType { + /** + * Specifies the type property: Specifies the type of the extension; an example is "CustomScriptExtension".. + * + * @param type Specifies the type of the extension; an example is "CustomScriptExtension". + * @return the next definition stage. + */ + Update withType(String type); + } + /** The stage of the MachineExtension update allowing to specify typeHandlerVersion. */ + interface WithTypeHandlerVersion { + /** + * Specifies the typeHandlerVersion property: Specifies the version of the script handler.. + * + * @param typeHandlerVersion Specifies the version of the script handler. + * @return the next definition stage. + */ + Update withTypeHandlerVersion(String typeHandlerVersion); + } + /** The stage of the MachineExtension update allowing to specify enableAutomaticUpgrade. */ + interface WithEnableAutomaticUpgrade { + /** + * Specifies the enableAutomaticUpgrade property: Indicates whether the extension should be automatically + * upgraded by the platform if there is a newer version available.. + * + * @param enableAutomaticUpgrade Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * @return the next definition stage. + */ + Update withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade); + } + /** The stage of the MachineExtension update allowing to specify autoUpgradeMinorVersion. */ + interface WithAutoUpgradeMinorVersion { + /** + * Specifies the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor + * version if one is available at deployment time. Once deployed, however, the extension will not upgrade + * minor versions unless redeployed, even with this property set to true.. + * + * @param autoUpgradeMinorVersion Indicates whether the extension should use a newer minor version if one is + * available at deployment time. Once deployed, however, the extension will not upgrade minor versions + * unless redeployed, even with this property set to true. + * @return the next definition stage. + */ + Update withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion); + } + /** The stage of the MachineExtension update allowing to specify settings. */ + interface WithSettings { + /** + * Specifies the settings property: Json formatted public settings for the extension.. + * + * @param settings Json formatted public settings for the extension. + * @return the next definition stage. + */ + Update withSettings(Map settings); + } + /** The stage of the MachineExtension update allowing to specify protectedSettings. */ + interface WithProtectedSettings { /** - * Specifies the properties property: Describes Machine Extension Update Properties.. + * Specifies the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all.. * - * @param properties Describes Machine Extension Update Properties. + * @param protectedSettings The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. * @return the next definition stage. */ - Update withProperties(MachineExtensionUpdateProperties properties); + Update withProtectedSettings(Map protectedSettings); } } /** diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java index 9cb5254f457b3..3931bb1c5bfba 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpdate.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -15,36 +16,219 @@ public final class MachineExtensionUpdate extends ResourceUpdate { * Describes Machine Extension Update Properties. */ @JsonProperty(value = "properties") - private MachineExtensionUpdateProperties properties; + private MachineExtensionUpdateProperties innerProperties; /** Creates an instance of MachineExtensionUpdate class. */ public MachineExtensionUpdate() { } /** - * Get the properties property: Describes Machine Extension Update Properties. + * Get the innerProperties property: Describes Machine Extension Update Properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineExtensionUpdateProperties properties() { - return this.properties; + private MachineExtensionUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MachineExtensionUpdate withTags(Map tags) { + super.withTags(tags); + return this; } /** - * Set the properties property: Describes Machine Extension Update Properties. + * Get the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. * - * @param properties the properties value to set. + * @return the forceUpdateTag value. + */ + public String forceUpdateTag() { + return this.innerProperties() == null ? null : this.innerProperties().forceUpdateTag(); + } + + /** + * Set the forceUpdateTag property: How the extension handler should be forced to update even if the extension + * configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set. * @return the MachineExtensionUpdate object itself. */ - public MachineExtensionUpdate withProperties(MachineExtensionUpdateProperties properties) { - this.properties = properties; + public MachineExtensionUpdate withForceUpdateTag(String forceUpdateTag) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withForceUpdateTag(forceUpdateTag); return this; } - /** {@inheritDoc} */ - @Override - public MachineExtensionUpdate withTags(Map tags) { - super.withTags(tags); + /** + * Get the publisher property: The name of the extension handler publisher. + * + * @return the publisher value. + */ + public String publisher() { + return this.innerProperties() == null ? null : this.innerProperties().publisher(); + } + + /** + * Set the publisher property: The name of the extension handler publisher. + * + * @param publisher the publisher value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withPublisher(String publisher) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withPublisher(publisher); + return this; + } + + /** + * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @return the type value. + */ + public String type() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Specifies the type of the extension; an example is "CustomScriptExtension". + * + * @param type the type value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withType(String type) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the typeHandlerVersion property: Specifies the version of the script handler. + * + * @return the typeHandlerVersion value. + */ + public String typeHandlerVersion() { + return this.innerProperties() == null ? null : this.innerProperties().typeHandlerVersion(); + } + + /** + * Set the typeHandlerVersion property: Specifies the version of the script handler. + * + * @param typeHandlerVersion the typeHandlerVersion value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withTypeHandlerVersion(String typeHandlerVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withTypeHandlerVersion(typeHandlerVersion); + return this; + } + + /** + * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @return the enableAutomaticUpgrade value. + */ + public Boolean enableAutomaticUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().enableAutomaticUpgrade(); + } + + /** + * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * platform if there is a newer version available. + * + * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withEnableAutomaticUpgrade(Boolean enableAutomaticUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withEnableAutomaticUpgrade(enableAutomaticUpgrade); + return this; + } + + /** + * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @return the autoUpgradeMinorVersion value. + */ + public Boolean autoUpgradeMinorVersion() { + return this.innerProperties() == null ? null : this.innerProperties().autoUpgradeMinorVersion(); + } + + /** + * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one + * is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless + * redeployed, even with this property set to true. + * + * @param autoUpgradeMinorVersion the autoUpgradeMinorVersion value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withAutoUpgradeMinorVersion(Boolean autoUpgradeMinorVersion) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withAutoUpgradeMinorVersion(autoUpgradeMinorVersion); + return this; + } + + /** + * Get the settings property: Json formatted public settings for the extension. + * + * @return the settings value. + */ + public Map settings() { + return this.innerProperties() == null ? null : this.innerProperties().settings(); + } + + /** + * Set the settings property: Json formatted public settings for the extension. + * + * @param settings the settings value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withSettings(Map settings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withSettings(settings); + return this; + } + + /** + * Get the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @return the protectedSettings value. + */ + public Map protectedSettings() { + return this.innerProperties() == null ? null : this.innerProperties().protectedSettings(); + } + + /** + * Set the protectedSettings property: The extension can contain either protectedSettings or + * protectedSettingsFromKeyVault or no protected settings at all. + * + * @param protectedSettings the protectedSettings value to set. + * @return the MachineExtensionUpdate object itself. + */ + public MachineExtensionUpdate withProtectedSettings(Map protectedSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineExtensionUpdateProperties(); + } + this.innerProperties().withProtectedSettings(protectedSettings); return this; } @@ -56,8 +240,8 @@ public MachineExtensionUpdate withTags(Map tags) { @Override public void validate() { super.validate(); - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java new file mode 100644 index 0000000000000..e6948cd70ddcc --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineExtensionUpgrade.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Describes the Machine Extension Upgrade Properties. */ +@Fluent +public final class MachineExtensionUpgrade { + /* + * Describes the Extension Target Properties. + */ + @JsonProperty(value = "extensionTargets") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map extensionTargets; + + /** Creates an instance of MachineExtensionUpgrade class. */ + public MachineExtensionUpgrade() { + } + + /** + * Get the extensionTargets property: Describes the Extension Target Properties. + * + * @return the extensionTargets value. + */ + public Map extensionTargets() { + return this.extensionTargets; + } + + /** + * Set the extensionTargets property: Describes the Extension Target Properties. + * + * @param extensionTargets the extensionTargets value to set. + * @return the MachineExtensionUpgrade object itself. + */ + public MachineExtensionUpgrade withExtensionTargets(Map extensionTargets) { + this.extensionTargets = extensionTargets; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionTargets() != null) { + extensionTargets() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java index 74d60c9cac345..9779b2c91b235 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/MachineUpdate.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.hybridcompute.models; import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.MachineUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -21,7 +22,7 @@ public final class MachineUpdate extends ResourceUpdate { * Hybrid Compute Machine properties */ @JsonProperty(value = "properties") - private MachineUpdateProperties properties; + private MachineUpdateProperties innerProperties; /** Creates an instance of MachineUpdate class. */ public MachineUpdate() { @@ -48,29 +49,160 @@ public MachineUpdate withIdentity(Identity identity) { } /** - * Get the properties property: Hybrid Compute Machine properties. + * Get the innerProperties property: Hybrid Compute Machine properties. * - * @return the properties value. + * @return the innerProperties value. */ - public MachineUpdateProperties properties() { - return this.properties; + private MachineUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public MachineUpdate withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the locationData property: Metadata pertaining to the geographic location of the resource. + * + * @return the locationData value. + */ + public LocationData locationData() { + return this.innerProperties() == null ? null : this.innerProperties().locationData(); } /** - * Set the properties property: Hybrid Compute Machine properties. + * Set the locationData property: Metadata pertaining to the geographic location of the resource. * - * @param properties the properties value to set. + * @param locationData the locationData value to set. * @return the MachineUpdate object itself. */ - public MachineUpdate withProperties(MachineUpdateProperties properties) { - this.properties = properties; + public MachineUpdate withLocationData(LocationData locationData) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withLocationData(locationData); return this; } - /** {@inheritDoc} */ - @Override - public MachineUpdate withTags(Map tags) { - super.withTags(tags); + /** + * Get the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @return the osProfile value. + */ + public OSProfile osProfile() { + return this.innerProperties() == null ? null : this.innerProperties().osProfile(); + } + + /** + * Set the osProfile property: Specifies the operating system settings for the hybrid machine. + * + * @param osProfile the osProfile value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withOsProfile(OSProfile osProfile) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withOsProfile(osProfile); + return this; + } + + /** + * Get the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @return the cloudMetadata value. + */ + public CloudMetadata cloudMetadata() { + return this.innerProperties() == null ? null : this.innerProperties().cloudMetadata(); + } + + /** + * Set the cloudMetadata property: The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + * + * @param cloudMetadata the cloudMetadata value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withCloudMetadata(CloudMetadata cloudMetadata) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withCloudMetadata(cloudMetadata); + return this; + } + + /** + * Get the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @return the agentUpgrade value. + */ + public AgentUpgrade agentUpgrade() { + return this.innerProperties() == null ? null : this.innerProperties().agentUpgrade(); + } + + /** + * Set the agentUpgrade property: The info of the machine w.r.t Agent Upgrade. + * + * @param agentUpgrade the agentUpgrade value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withAgentUpgrade(AgentUpgrade agentUpgrade) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withAgentUpgrade(agentUpgrade); + return this; + } + + /** + * Get the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @return the parentClusterResourceId value. + */ + public String parentClusterResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().parentClusterResourceId(); + } + + /** + * Set the parentClusterResourceId property: The resource id of the parent cluster (Azure HCI) this machine is + * assigned to, if any. + * + * @param parentClusterResourceId the parentClusterResourceId value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withParentClusterResourceId(String parentClusterResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withParentClusterResourceId(parentClusterResourceId); + return this; + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.innerProperties() == null ? null : this.innerProperties().privateLinkScopeResourceId(); + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this machine is assigned + * to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the MachineUpdate object itself. + */ + public MachineUpdate withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (this.innerProperties() == null) { + this.innerProperties = new MachineUpdateProperties(); + } + this.innerProperties().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); return this; } @@ -85,8 +217,8 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java index ff4f81343e525..7f5e84f6e8e53 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Machines.java @@ -11,7 +11,7 @@ /** Resource collection API of Machines. */ public interface Machines { /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. @@ -24,7 +24,7 @@ public interface Machines { Response deleteByResourceGroupWithResponse(String resourceGroupName, String machineName, Context context); /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkInterface.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkInterface.java new file mode 100644 index 0000000000000..45ca31d40b88d --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkInterface.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Describes a network interface. */ +@Fluent +public final class NetworkInterface { + /* + * The list of IP addresses in this interface. + */ + @JsonProperty(value = "ipAddresses") + private List ipAddresses; + + /** Creates an instance of NetworkInterface class. */ + public NetworkInterface() { + } + + /** + * Get the ipAddresses property: The list of IP addresses in this interface. + * + * @return the ipAddresses value. + */ + public List ipAddresses() { + return this.ipAddresses; + } + + /** + * Set the ipAddresses property: The list of IP addresses in this interface. + * + * @param ipAddresses the ipAddresses value to set. + * @return the NetworkInterface object itself. + */ + public NetworkInterface withIpAddresses(List ipAddresses) { + this.ipAddresses = ipAddresses; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ipAddresses() != null) { + ipAddresses().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfile.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfile.java new file mode 100644 index 0000000000000..d930f090cb4d2 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfile.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner; +import java.util.List; + +/** An immutable client-side representation of NetworkProfile. */ +public interface NetworkProfile { + /** + * Gets the networkInterfaces property: The list of network interfaces. + * + * @return the networkInterfaces value. + */ + List networkInterfaces(); + + /** + * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.NetworkProfileInner object. + * + * @return the inner object. + */ + NetworkProfileInner innerModel(); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfiles.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfiles.java new file mode 100644 index 0000000000000..5528756cb9302 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/NetworkProfiles.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of NetworkProfiles. */ +public interface NetworkProfiles { + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String machineName, Context context); + + /** + * The operation to get network information of hybrid machine. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @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 describes the network information on this machine. + */ + NetworkProfile get(String resourceGroupName, String machineName); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java index d56ede1bf09d3..13fc8f1552b92 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfile.java @@ -4,11 +4,11 @@ package com.azure.resourcemanager.hybridcompute.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; /** Specifies the operating system settings for the hybrid machine. */ -@Immutable +@Fluent public final class OSProfile { /* * Specifies the host OS name of the hybrid machine. @@ -16,6 +16,18 @@ public final class OSProfile { @JsonProperty(value = "computerName", access = JsonProperty.Access.WRITE_ONLY) private String computerName; + /* + * Specifies the windows configuration for update management. + */ + @JsonProperty(value = "windowsConfiguration") + private OSProfileWindowsConfiguration windowsConfiguration; + + /* + * Specifies the linux configuration for update management. + */ + @JsonProperty(value = "linuxConfiguration") + private OSProfileLinuxConfiguration linuxConfiguration; + /** Creates an instance of OSProfile class. */ public OSProfile() { } @@ -29,11 +41,57 @@ public String computerName() { return this.computerName; } + /** + * Get the windowsConfiguration property: Specifies the windows configuration for update management. + * + * @return the windowsConfiguration value. + */ + public OSProfileWindowsConfiguration windowsConfiguration() { + return this.windowsConfiguration; + } + + /** + * Set the windowsConfiguration property: Specifies the windows configuration for update management. + * + * @param windowsConfiguration the windowsConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withWindowsConfiguration(OSProfileWindowsConfiguration windowsConfiguration) { + this.windowsConfiguration = windowsConfiguration; + return this; + } + + /** + * Get the linuxConfiguration property: Specifies the linux configuration for update management. + * + * @return the linuxConfiguration value. + */ + public OSProfileLinuxConfiguration linuxConfiguration() { + return this.linuxConfiguration; + } + + /** + * Set the linuxConfiguration property: Specifies the linux configuration for update management. + * + * @param linuxConfiguration the linuxConfiguration value to set. + * @return the OSProfile object itself. + */ + public OSProfile withLinuxConfiguration(OSProfileLinuxConfiguration linuxConfiguration) { + this.linuxConfiguration = linuxConfiguration; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (windowsConfiguration() != null) { + windowsConfiguration().validate(); + } + if (linuxConfiguration() != null) { + linuxConfiguration().validate(); + } } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java new file mode 100644 index 0000000000000..a0e71ea90fa39 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileLinuxConfiguration.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.PatchSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the linux configuration for update management. */ +@Fluent +public final class OSProfileLinuxConfiguration { + /* + * Specifies the patch settings. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings innerPatchSettings; + + /** Creates an instance of OSProfileLinuxConfiguration class. */ + public OSProfileLinuxConfiguration() { + } + + /** + * Get the innerPatchSettings property: Specifies the patch settings. + * + * @return the innerPatchSettings value. + */ + private PatchSettings innerPatchSettings() { + return this.innerPatchSettings; + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the OSProfileLinuxConfiguration object itself. + */ + public OSProfileLinuxConfiguration withAssessmentMode(AssessmentModeTypes assessmentMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withAssessmentMode(assessmentMode); + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the OSProfileLinuxConfiguration object itself. + */ + public OSProfileLinuxConfiguration withPatchMode(PatchModeTypes patchMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withPatchMode(patchMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPatchSettings() != null) { + innerPatchSettings().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java new file mode 100644 index 0000000000000..94a0146e8bb70 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OSProfileWindowsConfiguration.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.hybridcompute.fluent.models.PatchSettings; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifies the windows configuration for update management. */ +@Fluent +public final class OSProfileWindowsConfiguration { + /* + * Specifies the patch settings. + */ + @JsonProperty(value = "patchSettings") + private PatchSettings innerPatchSettings; + + /** Creates an instance of OSProfileWindowsConfiguration class. */ + public OSProfileWindowsConfiguration() { + } + + /** + * Get the innerPatchSettings property: Specifies the patch settings. + * + * @return the innerPatchSettings value. + */ + private PatchSettings innerPatchSettings() { + return this.innerPatchSettings; + } + + /** + * Get the assessmentMode property: Specifies the assessment mode. + * + * @return the assessmentMode value. + */ + public AssessmentModeTypes assessmentMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().assessmentMode(); + } + + /** + * Set the assessmentMode property: Specifies the assessment mode. + * + * @param assessmentMode the assessmentMode value to set. + * @return the OSProfileWindowsConfiguration object itself. + */ + public OSProfileWindowsConfiguration withAssessmentMode(AssessmentModeTypes assessmentMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withAssessmentMode(assessmentMode); + return this; + } + + /** + * Get the patchMode property: Specifies the patch mode. + * + * @return the patchMode value. + */ + public PatchModeTypes patchMode() { + return this.innerPatchSettings() == null ? null : this.innerPatchSettings().patchMode(); + } + + /** + * Set the patchMode property: Specifies the patch mode. + * + * @param patchMode the patchMode value to set. + * @return the OSProfileWindowsConfiguration object itself. + */ + public OSProfileWindowsConfiguration withPatchMode(PatchModeTypes patchMode) { + if (this.innerPatchSettings() == null) { + this.innerPatchSettings = new PatchSettings(); + } + this.innerPatchSettings().withPatchMode(patchMode); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerPatchSettings() != null) { + innerPatchSettings().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java index 55fd882ca6eff..d9d9443f385b6 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/OperationValue.java @@ -29,6 +29,13 @@ public interface OperationValue { */ OperationValueDisplay display(); + /** + * Gets the isDataAction property: This property indicates if the operation is an action or a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + /** * Gets the inner com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner object. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java new file mode 100644 index 0000000000000..92b9381bf0bf7 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PatchModeTypes.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Specifies the patch mode. */ +public final class PatchModeTypes extends ExpandableStringEnum { + /** Static value ImageDefault for PatchModeTypes. */ + public static final PatchModeTypes IMAGE_DEFAULT = fromString("ImageDefault"); + + /** Static value AutomaticByPlatform for PatchModeTypes. */ + public static final PatchModeTypes AUTOMATIC_BY_PLATFORM = fromString("AutomaticByPlatform"); + + /** Static value AutomaticByOS for PatchModeTypes. */ + public static final PatchModeTypes AUTOMATIC_BY_OS = fromString("AutomaticByOS"); + + /** Static value Manual for PatchModeTypes. */ + public static final PatchModeTypes MANUAL = fromString("Manual"); + + /** + * Creates a new instance of PatchModeTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PatchModeTypes() { + } + + /** + * Creates or finds a PatchModeTypes from its string representation. + * + * @param name a name to look for. + * @return the corresponding PatchModeTypes. + */ + @JsonCreator + public static PatchModeTypes fromString(String name) { + return fromString(name, PatchModeTypes.class); + } + + /** + * Gets known PatchModeTypes values. + * + * @return known PatchModeTypes values. + */ + public static Collection values() { + return values(PatchModeTypes.class); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java index 70f2cd3c227c0..1e05e2391b4a1 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnection.java @@ -39,7 +39,7 @@ public interface PrivateEndpointConnection { PrivateEndpointConnectionProperties properties(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java new file mode 100644 index 0000000000000..3c6a86dfefaf3 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionDataModel.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The Data Model for a Private Endpoint Connection associated with a Private Link Scope. */ +@Fluent +public final class PrivateEndpointConnectionDataModel { + /* + * The ARM Resource Id of the Private Endpoint. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /* + * The Name of the Private Endpoint. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /* + * Azure resource type + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /* + * The Private Endpoint Connection properties. + */ + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties properties; + + /** Creates an instance of PrivateEndpointConnectionDataModel class. */ + public PrivateEndpointConnectionDataModel() { + } + + /** + * Get the id property: The ARM Resource Id of the Private Endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: The Name of the Private Endpoint. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the type property: Azure resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the properties property: The Private Endpoint Connection properties. + * + * @return the properties value. + */ + public PrivateEndpointConnectionProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The Private Endpoint Connection properties. + * + * @param properties the properties value to set. + * @return the PrivateEndpointConnectionDataModel object itself. + */ + public PrivateEndpointConnectionDataModel withProperties(PrivateEndpointConnectionProperties 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(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java index b87dd7aa666e5..b274d8abd3673 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateEndpointConnectionProperties.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** Properties of a private endpoint connection. */ @Fluent @@ -28,6 +29,12 @@ public final class PrivateEndpointConnectionProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; + /* + * List of group IDs. + */ + @JsonProperty(value = "groupIds", access = JsonProperty.Access.WRITE_ONLY) + private List groupIds; + /** Creates an instance of PrivateEndpointConnectionProperties class. */ public PrivateEndpointConnectionProperties() { } @@ -82,6 +89,15 @@ public String provisioningState() { return this.provisioningState; } + /** + * Get the groupIds property: List of group IDs. + * + * @return the groupIds value. + */ + public List groupIds() { + return this.groupIds; + } + /** * Validates the instance. * diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java index 08854540c62b5..4cc8d1e89a25f 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/PrivateLinkResource.java @@ -38,7 +38,7 @@ public interface PrivateLinkResource { PrivateLinkResourceProperties properties(); /** - * Gets the systemData property: The system meta data relating to this resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java new file mode 100644 index 0000000000000..03fb8081c7387 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ResourceProviders.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.util.Context; + +/** Resource collection API of ResourceProviders. */ +public interface ResourceProviders { + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions 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 upgradeExtensions( + String resourceGroupName, String machineName, MachineExtensionUpgrade extensionUpgradeParameters); + + /** + * The operation to Upgrade Machine Extensions. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param machineName The name of the hybrid machine. + * @param extensionUpgradeParameters Parameters supplied to the Upgrade Extensions operation. + * @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 upgradeExtensions( + String resourceGroupName, + String machineName, + MachineExtensionUpgrade extensionUpgradeParameters, + Context context); +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java new file mode 100644 index 0000000000000..3542d05c0dd80 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the status and behavior of a service. */ +@Fluent +public final class ServiceStatus { + /* + * The current status of the service. + */ + @JsonProperty(value = "status") + private String status; + + /* + * The behavior of the service when the Arc-enabled machine starts up. + */ + @JsonProperty(value = "startupType") + private String startupType; + + /** Creates an instance of ServiceStatus class. */ + public ServiceStatus() { + } + + /** + * Get the status property: The current status of the service. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: The current status of the service. + * + * @param status the status value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the startupType property: The behavior of the service when the Arc-enabled machine starts up. + * + * @return the startupType value. + */ + public String startupType() { + return this.startupType; + } + + /** + * Set the startupType property: The behavior of the service when the Arc-enabled machine starts up. + * + * @param startupType the startupType value to set. + * @return the ServiceStatus object itself. + */ + public ServiceStatus withStartupType(String startupType) { + this.startupType = startupType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java new file mode 100644 index 0000000000000..5506fa84ce22e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/ServiceStatuses.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Reports the state and behavior of dependent services. */ +@Fluent +public final class ServiceStatuses { + /* + * The state of the extension service on the Arc-enabled machine. + */ + @JsonProperty(value = "extensionService") + private ServiceStatus extensionService; + + /* + * The state of the guest configuration service on the Arc-enabled machine. + */ + @JsonProperty(value = "guestConfigurationService") + private ServiceStatus guestConfigurationService; + + /** Creates an instance of ServiceStatuses class. */ + public ServiceStatuses() { + } + + /** + * Get the extensionService property: The state of the extension service on the Arc-enabled machine. + * + * @return the extensionService value. + */ + public ServiceStatus extensionService() { + return this.extensionService; + } + + /** + * Set the extensionService property: The state of the extension service on the Arc-enabled machine. + * + * @param extensionService the extensionService value to set. + * @return the ServiceStatuses object itself. + */ + public ServiceStatuses withExtensionService(ServiceStatus extensionService) { + this.extensionService = extensionService; + return this; + } + + /** + * Get the guestConfigurationService property: The state of the guest configuration service on the Arc-enabled + * machine. + * + * @return the guestConfigurationService value. + */ + public ServiceStatus guestConfigurationService() { + return this.guestConfigurationService; + } + + /** + * Set the guestConfigurationService property: The state of the guest configuration service on the Arc-enabled + * machine. + * + * @param guestConfigurationService the guestConfigurationService value to set. + * @return the ServiceStatuses object itself. + */ + public ServiceStatuses withGuestConfigurationService(ServiceStatus guestConfigurationService) { + this.guestConfigurationService = guestConfigurationService; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (extensionService() != null) { + extensionService().validate(); + } + if (guestConfigurationService() != null) { + guestConfigurationService().validate(); + } + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Subnet.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Subnet.java new file mode 100644 index 0000000000000..2e0e669052807 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/models/Subnet.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the subnet. */ +@Fluent +public final class Subnet { + /* + * Represents address prefix. + */ + @JsonProperty(value = "addressPrefix") + private String addressPrefix; + + /** Creates an instance of Subnet class. */ + public Subnet() { + } + + /** + * Get the addressPrefix property: Represents address prefix. + * + * @return the addressPrefix value. + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the addressPrefix property: Represents address prefix. + * + * @param addressPrefix the addressPrefix value to set. + * @return the Subnet object itself. + */ + public Subnet withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java new file mode 100644 index 0000000000000..fa0e22e7b260e --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for ExtensionMetadata Get. */ +public final class ExtensionMetadataGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/ExtensionMetadata_Get.json + */ + /** + * Sample code: GET an extensions metadata. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAnExtensionsMetadata(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .getWithResponse( + "EastUS", + "microsoft.azure.monitor", + "azuremonitorlinuxagent", + "1.9.1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java new file mode 100644 index 0000000000000..01554c4fe0499 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ExtensionMetadataListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for ExtensionMetadata List. */ +public final class ExtensionMetadataListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/ExtensionMetadata_List.json + */ + /** + * Sample code: GET a list of extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETAListOfExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .extensionMetadatas() + .list("EastUS", "microsoft.azure.monitor", "azuremonitorlinuxagent", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java index 153bc630c01da..d1bb01b94df9b 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateSamples.java @@ -4,15 +4,13 @@ package com.azure.resourcemanager.hybridcompute.generated; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import java.io.IOException; +import java.util.HashMap; +import java.util.Map; /** Samples for MachineExtensions CreateOrUpdate. */ public final class MachineExtensionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PUTExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PUTExtension.json */ /** * Sample code: Create or Update a Machine Extension. @@ -20,25 +18,28 @@ public final class MachineExtensionsCreateOrUpdateSamples { * @param manager Entry point to HybridComputeManager. */ public static void createOrUpdateAMachineExtension( - com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) throws IOException { + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { manager .machineExtensions() .define("CustomScriptExtension") .withRegion("eastus2euap") .withExistingMachine("myResourceGroup", "myMachine") - .withProperties( - new MachineExtensionProperties() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt" - + " 10000 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + .withPublisher("Microsoft.Compute") + .withTypePropertiesType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\"")) .create(); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java index b1c172035d44b..5835c8be32db0 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for MachineExtensions Delete. */ public final class MachineExtensionsDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/DELETEExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/DELETEExtension.json */ /** * Sample code: Delete a Machine Extension. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java index 416dd1991c20b..06863a55eea42 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for MachineExtensions Get. */ public final class MachineExtensionsGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/GETExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/GETExtension.json */ /** * Sample code: GET Machine Extension. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java index c2842b61fa850..05cdaba34f968 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListSamples.java @@ -7,7 +7,7 @@ /** Samples for MachineExtensions List. */ public final class MachineExtensionsListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/LISTExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/LISTExtension.json */ /** * Sample code: GET all Machine Extensions. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java index 4f1f52674c6e3..3770f2fa5b2d8 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsUpdateSamples.java @@ -4,16 +4,14 @@ package com.azure.resourcemanager.hybridcompute.generated; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; -import java.io.IOException; +import java.util.HashMap; +import java.util.Map; /** Samples for MachineExtensions Update. */ public final class MachineExtensionsUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/UpdateExtension.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/UpdateExtension.json */ /** * Sample code: Create or Update a Machine Extension. @@ -21,7 +19,7 @@ public final class MachineExtensionsUpdateSamples { * @param manager Entry point to HybridComputeManager. */ public static void createOrUpdateAMachineExtension( - com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) throws IOException { + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { MachineExtension resource = manager .machineExtensions() @@ -30,19 +28,23 @@ public static void createOrUpdateAMachineExtension( .getValue(); resource .update() - .withProperties( - new MachineExtensionUpdateProperties() - .withPublisher("Microsoft.Compute") - .withType("CustomScriptExtension") - .withTypeHandlerVersion("1.10") - .withSettings( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt" - + " 100 }\\\"\"}", - Object.class, - SerializerEncoding.JSON))) + .withPublisher("Microsoft.Compute") + .withType("CustomScriptExtension") + .withTypeHandlerVersion("1.10") + .withEnableAutomaticUpgrade(true) + .withSettings( + mapOf("commandToExecute", "powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\"")) .apply(); } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } } diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java index 38e90f672b9ac..ab6df9cfc4eaf 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for Machines Delete. */ public final class MachinesDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_Delete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Machines_Delete.json */ /** * Sample code: Delete a Machine. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java index 216fe91a0e011..4caee85397537 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Machines GetByResourceGroup. */ public final class MachinesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_Get.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Machines_Get.json */ /** * Sample code: Get Machine. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java index f360b6dbce48d..d42a3a2a23685 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for Machines ListByResourceGroup. */ public final class MachinesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_ListByResourceGroup.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Machines_ListByResourceGroup.json */ /** * Sample code: List Machines by resource group. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java index d841661f85f5f..52e98b22f39bc 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/MachinesListSamples.java @@ -7,7 +7,7 @@ /** Samples for Machines List. */ public final class MachinesListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/Machines_ListBySubscription.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Machines_ListBySubscription.json */ /** * Sample code: List Machines by resource group. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/NetworkProfileGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/NetworkProfileGetSamples.java new file mode 100644 index 0000000000000..448cdac9b3624 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/NetworkProfileGetSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for NetworkProfile Get. */ +public final class NetworkProfileGetSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/GETNetworkProfile.json + */ + /** + * Sample code: GET Network Profile. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void gETNetworkProfile(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.networkProfiles().getWithResponse("myResourceGroup", "myMachine", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..e0e213a282a41 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/OperationsListSamples.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Operations_List.json + */ + /** + * Sample code: List Hybrid Compute Provider Operations. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void listHybridComputeProviderOperations( + com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index 66b1497a01f20..61996c9d47e73 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -10,7 +10,7 @@ /** Samples for PrivateEndpointConnections CreateOrUpdate. */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateEndpointConnectionUpdate.json */ /** * Sample code: Approve or reject a private endpoint connection with a given name. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java index a6df55810a3f9..96036325387aa 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Delete. */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateEndpointConnectionDelete.json */ /** * Sample code: Deletes a private endpoint connection with a given name. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java index 543bdb673ce60..f43ea235e2ab7 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections Get. */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateEndpointConnectionGet.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java index f8ded908706e3..0e400af301c0e 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateEndpointConnections ListByPrivateLinkScope. */ public final class PrivateEndpointConnectionsListByPrivateLinkScopeSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateEndpointConnectionList.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateEndpointConnectionList.json */ /** * Sample code: Gets list of private endpoint connections on a private link scope. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java index 85c142b8fe4e4..1ad1291904514 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkResources Get. */ public final class PrivateLinkResourcesGetSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java index f6b06f55ae03f..178dc4a3667fa 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkResources ListByPrivateLinkScope. */ public final class PrivateLinkResourcesListByPrivateLinkScopeSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json */ /** * Sample code: Gets private endpoint connection. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java index ed63b880a03ce..6055c587da8ff 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateSamples.java @@ -10,7 +10,7 @@ /** Samples for PrivateLinkScopes CreateOrUpdate. */ public final class PrivateLinkScopesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesCreate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesCreate.json */ /** * Sample code: PrivateLinkScopeCreate. @@ -27,7 +27,7 @@ public static void privateLinkScopeCreate(com.azure.resourcemanager.hybridcomput } /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesUpdate.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesUpdate.json */ /** * Sample code: PrivateLinkScopeUpdate. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java index 152618abf0dc5..53801d23f0972 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes Delete. */ public final class PrivateLinkScopesDeleteSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesDelete.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesDelete.json */ /** * Sample code: PrivateLinkScopesDelete. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java index 9d7668ba127e1..0872e53678702 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes GetByResourceGroup. */ public final class PrivateLinkScopesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGet.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesGet.json */ /** * Sample code: PrivateLinkScopeGet. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java index ef50d70f95de4..560ebc22c2a28 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes GetValidationDetailsForMachine. */ public final class PrivateLinkScopesGetValidationDetailsForMachineSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGetValidationForMachine.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesGetValidationForMachine.json */ /** * Sample code: PrivateLinkScopeGet. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java index b197109101def..12641cfb00559 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes GetValidationDetails. */ public final class PrivateLinkScopesGetValidationDetailsSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesGetValidation.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesGetValidation.json */ /** * Sample code: PrivateLinkScopeGet. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java index 7156df7a89065..cb7df22068e29 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes ListByResourceGroup. */ public final class PrivateLinkScopesListByResourceGroupSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesListByResourceGroup.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesListByResourceGroup.json */ /** * Sample code: PrivateLinkScopeListByResourceGroup. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java index c5cb7770a8781..e391e573838e0 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListSamples.java @@ -7,7 +7,7 @@ /** Samples for PrivateLinkScopes List. */ public final class PrivateLinkScopesListSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesList.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesList.json */ /** * Sample code: PrivateLinkScopesList.json. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java index 133463cda217d..3dc73acc5ccb8 100644 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesUpdateTagsSamples.java @@ -11,7 +11,7 @@ /** Samples for PrivateLinkScopes UpdateTags. */ public final class PrivateLinkScopesUpdateTagsSamples { /* - * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2021-03-25-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/PrivateLinkScopesUpdateTagsOnly.json */ /** * Sample code: PrivateLinkScopeUpdateTagsOnly. diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java new file mode 100644 index 0000000000000..bf4d1816b9de3 --- /dev/null +++ b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/samples/java/com/azure/resourcemanager/hybridcompute/generated/ResourceProviderUpgradeExtensionsSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridcompute.generated; + +import com.azure.resourcemanager.hybridcompute.models.ExtensionTargetProperties; +import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpgrade; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ResourceProvider UpgradeExtensions. */ +public final class ResourceProviderUpgradeExtensionsSamples { + /* + * x-ms-original-file: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-12-27-preview/examples/Extensions_Upgrade.json + */ + /** + * Sample code: Upgrade Machine Extensions. + * + * @param manager Entry point to HybridComputeManager. + */ + public static void upgradeMachineExtensions(com.azure.resourcemanager.hybridcompute.HybridComputeManager manager) { + manager + .resourceProviders() + .upgradeExtensions( + "myResourceGroup", + "myMachine", + new MachineExtensionUpgrade() + .withExtensionTargets( + mapOf( + "Microsoft.Azure.Monitoring", + new ExtensionTargetProperties().withTargetVersion("2.0"), + "Microsoft.Compute.CustomScriptExtension", + new ExtensionTargetProperties().withTargetVersion("1.10"))), + com.azure.core.util.Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ConnectionDetailTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ConnectionDetailTests.java deleted file mode 100644 index d256ccdab5356..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ConnectionDetailTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.ConnectionDetail; - -public final class ConnectionDetailTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionDetail model = - BinaryData - .fromString( - "{\"id\":\"ocmnyyazttbtwwrq\",\"privateIpAddress\":\"edckzywbiexzfey\",\"linkIdentifier\":\"axibxujw\",\"groupId\":\"qwalmuzyoxaepd\",\"memberName\":\"jancu\"}") - .toObject(ConnectionDetail.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionDetail model = new ConnectionDetail(); - model = BinaryData.fromObject(model).toObject(ConnectionDetail.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeInnerTests.java deleted file mode 100644 index 941e9e6e7242c..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.HybridComputePrivateLinkScopeInner; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class HybridComputePrivateLinkScopeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HybridComputePrivateLinkScopeInner model = - BinaryData - .fromString( - "{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"kcglhslaz\",\"privateLinkScopeId\":\"yggdtjixh\"},\"location\":\"uofqwe\",\"tags\":{\"bcibvyvdcsitynn\":\"menevfyexfwh\",\"f\":\"amdecte\",\"eypvhezrkg\":\"qsc\",\"sle\":\"hcjrefovgmk\"},\"id\":\"yvxyqjp\",\"name\":\"cattpngjcrcczsq\",\"type\":\"jh\"}") - .toObject(HybridComputePrivateLinkScopeInner.class); - Assertions.assertEquals("uofqwe", model.location()); - Assertions.assertEquals("menevfyexfwh", model.tags().get("bcibvyvdcsitynn")); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.properties().publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HybridComputePrivateLinkScopeInner model = - new HybridComputePrivateLinkScopeInner() - .withLocation("uofqwe") - .withTags( - mapOf("bcibvyvdcsitynn", "menevfyexfwh", "f", "amdecte", "eypvhezrkg", "qsc", "sle", "hcjrefovgmk")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED)); - model = BinaryData.fromObject(model).toObject(HybridComputePrivateLinkScopeInner.class); - Assertions.assertEquals("uofqwe", model.location()); - Assertions.assertEquals("menevfyexfwh", model.tags().get("bcibvyvdcsitynn")); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.properties().publicNetworkAccess()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeListResultTests.java deleted file mode 100644 index 99925c07c2664..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopeListResultTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.HybridComputePrivateLinkScopeInner; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeListResult; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class HybridComputePrivateLinkScopeListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HybridComputePrivateLinkScopeListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"provisioningState\":\"e\",\"privateLinkScopeId\":\"a\"},\"location\":\"uhrzayvvt\",\"tags\":{\"ftutqxlngxlefgu\":\"dfgiot\",\"qmi\":\"nxkrx\"},\"id\":\"tthzrvqd\",\"name\":\"abhjybi\",\"type\":\"ehoqfbowskan\"},{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"cuiywgqyw\",\"privateLinkScopeId\":\"drvyn\"},\"location\":\"gpphrcgyn\",\"tags\":{\"vmmcoofs\":\"pec\",\"y\":\"lzevgbmqjqab\",\"wnfnbacf\":\"mivkwlzuvcc\",\"bqqwxrj\":\"onlebxetqgtzxdpn\"},\"id\":\"eallnwsubisnj\",\"name\":\"mpmngnzscxaqwoo\",\"type\":\"hcbonqvpkvlr\"},{\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"provisioningState\":\"seiphe\",\"privateLinkScopeId\":\"lokeyy\"},\"location\":\"nj\",\"tags\":{\"masxazjpqyegu\":\"wtgrhpdjpj\",\"wdslfhotwmcy\":\"lhbxxhejjzzvdud\",\"cftadeh\":\"pwlbjnpg\"},\"id\":\"nltyfsoppusuesnz\",\"name\":\"dejbavo\",\"type\":\"xzdmohctb\"}],\"nextLink\":\"udwxdndnvowguj\"}") - .toObject(HybridComputePrivateLinkScopeListResult.class); - Assertions.assertEquals("uhrzayvvt", model.value().get(0).location()); - Assertions.assertEquals("dfgiot", model.value().get(0).tags().get("ftutqxlngxlefgu")); - Assertions - .assertEquals(PublicNetworkAccessType.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("udwxdndnvowguj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HybridComputePrivateLinkScopeListResult model = - new HybridComputePrivateLinkScopeListResult() - .withValue( - Arrays - .asList( - new HybridComputePrivateLinkScopeInner() - .withLocation("uhrzayvvt") - .withTags(mapOf("ftutqxlngxlefgu", "dfgiot", "qmi", "nxkrx")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED)), - new HybridComputePrivateLinkScopeInner() - .withLocation("gpphrcgyn") - .withTags( - mapOf( - "vmmcoofs", - "pec", - "y", - "lzevgbmqjqab", - "wnfnbacf", - "mivkwlzuvcc", - "bqqwxrj", - "onlebxetqgtzxdpn")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED)), - new HybridComputePrivateLinkScopeInner() - .withLocation("nj") - .withTags( - mapOf( - "masxazjpqyegu", - "wtgrhpdjpj", - "wdslfhotwmcy", - "lhbxxhejjzzvdud", - "cftadeh", - "pwlbjnpg")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED)))) - .withNextLink("udwxdndnvowguj"); - model = BinaryData.fromObject(model).toObject(HybridComputePrivateLinkScopeListResult.class); - Assertions.assertEquals("uhrzayvvt", model.value().get(0).location()); - Assertions.assertEquals("dfgiot", model.value().get(0).tags().get("ftutqxlngxlefgu")); - Assertions - .assertEquals(PublicNetworkAccessType.ENABLED, model.value().get(0).properties().publicNetworkAccess()); - Assertions.assertEquals("udwxdndnvowguj", model.nextLink()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopePropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopePropertiesTests.java deleted file mode 100644 index fc16fd745b0b3..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/HybridComputePrivateLinkScopePropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import org.junit.jupiter.api.Assertions; - -public final class HybridComputePrivateLinkScopePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HybridComputePrivateLinkScopeProperties model = - BinaryData - .fromString( - "{\"publicNetworkAccess\":\"Enabled\",\"provisioningState\":\"jvnysounqe\",\"privateLinkScopeId\":\"noae\"}") - .toObject(HybridComputePrivateLinkScopeProperties.class); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HybridComputePrivateLinkScopeProperties model = - new HybridComputePrivateLinkScopeProperties().withPublicNetworkAccess(PublicNetworkAccessType.ENABLED); - model = BinaryData.fromObject(model).toObject(HybridComputePrivateLinkScopeProperties.class); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/IdentityTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/IdentityTests.java deleted file mode 100644 index a2e3fc674fb3f..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/IdentityTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.Identity; -import com.azure.resourcemanager.hybridcompute.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString( - "{\"principalId\":\"scnpqxuhivy\",\"tenantId\":\"iwbybrkxvdumjg\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/LocationDataTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/LocationDataTests.java deleted file mode 100644 index b050b13c6523c..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/LocationDataTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.LocationData; -import org.junit.jupiter.api.Assertions; - -public final class LocationDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LocationData model = - BinaryData - .fromString( - "{\"name\":\"ekuksjtx\",\"city\":\"cdm\",\"district\":\"rcryuanzwuxzdxta\",\"countryOrRegion\":\"lhmwhfpmrqobm\"}") - .toObject(LocationData.class); - Assertions.assertEquals("ekuksjtx", model.name()); - Assertions.assertEquals("cdm", model.city()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.district()); - Assertions.assertEquals("lhmwhfpmrqobm", model.countryOrRegion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LocationData model = - new LocationData() - .withName("ekuksjtx") - .withCity("cdm") - .withDistrict("rcryuanzwuxzdxta") - .withCountryOrRegion("lhmwhfpmrqobm"); - model = BinaryData.fromObject(model).toObject(LocationData.class); - Assertions.assertEquals("ekuksjtx", model.name()); - Assertions.assertEquals("cdm", model.city()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.district()); - Assertions.assertEquals("lhmwhfpmrqobm", model.countryOrRegion()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionInnerTests.java deleted file mode 100644 index 208af6901063a..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionInnerTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MachineExtensionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineExtensionInner model = - BinaryData - .fromString( - "{\"properties\":{\"forceUpdateTag\":\"jwyahuxinpmqnja\",\"publisher\":\"ixjsprozvcputeg\",\"type\":\"wmfdatscmdvpjhul\",\"typeHandlerVersion\":\"uvm\",\"autoUpgradeMinorVersion\":true,\"settings\":\"datak\",\"protectedSettings\":\"dataf\",\"provisioningState\":\"iodjp\",\"instanceView\":{\"name\":\"ej\",\"type\":\"vwryoqpso\",\"typeHandlerVersion\":\"ctazakljlahbcryf\"}},\"location\":\"dosyg\",\"tags\":{\"vdphlxaolthqtr\":\"aojakhmsbzjhcrz\",\"gvfcj\":\"qjbpfzfsin\",\"xjtfelluwfzit\":\"wzo\",\"qfpjk\":\"np\"},\"id\":\"lxofpdvhpfxxypin\",\"name\":\"nmayhuybb\",\"type\":\"podepoo\"}") - .toObject(MachineExtensionInner.class); - Assertions.assertEquals("dosyg", model.location()); - Assertions.assertEquals("aojakhmsbzjhcrz", model.tags().get("vdphlxaolthqtr")); - Assertions.assertEquals("jwyahuxinpmqnja", model.properties().forceUpdateTag()); - Assertions.assertEquals("ixjsprozvcputeg", model.properties().publisher()); - Assertions.assertEquals("wmfdatscmdvpjhul", model.properties().type()); - Assertions.assertEquals("uvm", model.properties().typeHandlerVersion()); - Assertions.assertEquals(true, model.properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("ej", model.properties().instanceView().name()); - Assertions.assertEquals("vwryoqpso", model.properties().instanceView().type()); - Assertions.assertEquals("ctazakljlahbcryf", model.properties().instanceView().typeHandlerVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineExtensionInner model = - new MachineExtensionInner() - .withLocation("dosyg") - .withTags( - mapOf( - "vdphlxaolthqtr", - "aojakhmsbzjhcrz", - "gvfcj", - "qjbpfzfsin", - "xjtfelluwfzit", - "wzo", - "qfpjk", - "np")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("jwyahuxinpmqnja") - .withPublisher("ixjsprozvcputeg") - .withType("wmfdatscmdvpjhul") - .withTypeHandlerVersion("uvm") - .withAutoUpgradeMinorVersion(true) - .withSettings("datak") - .withProtectedSettings("dataf") - .withInstanceView( - new MachineExtensionInstanceView() - .withName("ej") - .withType("vwryoqpso") - .withTypeHandlerVersion("ctazakljlahbcryf"))); - model = BinaryData.fromObject(model).toObject(MachineExtensionInner.class); - Assertions.assertEquals("dosyg", model.location()); - Assertions.assertEquals("aojakhmsbzjhcrz", model.tags().get("vdphlxaolthqtr")); - Assertions.assertEquals("jwyahuxinpmqnja", model.properties().forceUpdateTag()); - Assertions.assertEquals("ixjsprozvcputeg", model.properties().publisher()); - Assertions.assertEquals("wmfdatscmdvpjhul", model.properties().type()); - Assertions.assertEquals("uvm", model.properties().typeHandlerVersion()); - Assertions.assertEquals(true, model.properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("ej", model.properties().instanceView().name()); - Assertions.assertEquals("vwryoqpso", model.properties().instanceView().type()); - Assertions.assertEquals("ctazakljlahbcryf", model.properties().instanceView().typeHandlerVersion()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdatePropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdatePropertiesTests.java deleted file mode 100644 index cb4cf2bed193d..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdatePropertiesTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class MachineExtensionUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineExtensionUpdateProperties model = - BinaryData - .fromString( - "{\"forceUpdateTag\":\"gphuticndvka\",\"publisher\":\"wyiftyhxhur\",\"type\":\"ftyxolniw\",\"typeHandlerVersion\":\"cukjf\",\"autoUpgradeMinorVersion\":false,\"settings\":\"dataw\",\"protectedSettings\":\"datalryplwckbasyy\"}") - .toObject(MachineExtensionUpdateProperties.class); - Assertions.assertEquals("gphuticndvka", model.forceUpdateTag()); - Assertions.assertEquals("wyiftyhxhur", model.publisher()); - Assertions.assertEquals("ftyxolniw", model.type()); - Assertions.assertEquals("cukjf", model.typeHandlerVersion()); - Assertions.assertEquals(false, model.autoUpgradeMinorVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineExtensionUpdateProperties model = - new MachineExtensionUpdateProperties() - .withForceUpdateTag("gphuticndvka") - .withPublisher("wyiftyhxhur") - .withType("ftyxolniw") - .withTypeHandlerVersion("cukjf") - .withAutoUpgradeMinorVersion(false) - .withSettings("dataw") - .withProtectedSettings("datalryplwckbasyy"); - model = BinaryData.fromObject(model).toObject(MachineExtensionUpdateProperties.class); - Assertions.assertEquals("gphuticndvka", model.forceUpdateTag()); - Assertions.assertEquals("wyiftyhxhur", model.publisher()); - Assertions.assertEquals("ftyxolniw", model.type()); - Assertions.assertEquals("cukjf", model.typeHandlerVersion()); - Assertions.assertEquals(false, model.autoUpgradeMinorVersion()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdateTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdateTests.java deleted file mode 100644 index ad22030e74b47..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionUpdateTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdate; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionUpdateProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MachineExtensionUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineExtensionUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"forceUpdateTag\":\"njbiksqrglssain\",\"publisher\":\"jwnzlljfmp\",\"type\":\"ebvmgxsabkyqd\",\"typeHandlerVersion\":\"jitcjczdzevn\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datawpdappdsbdkv\",\"protectedSettings\":\"datawjfeusnhutjel\"},\"tags\":{\"cdgea\":\"ldhugjzzdatqxh\"}}") - .toObject(MachineExtensionUpdate.class); - Assertions.assertEquals("ldhugjzzdatqxh", model.tags().get("cdgea")); - Assertions.assertEquals("njbiksqrglssain", model.properties().forceUpdateTag()); - Assertions.assertEquals("jwnzlljfmp", model.properties().publisher()); - Assertions.assertEquals("ebvmgxsabkyqd", model.properties().type()); - Assertions.assertEquals("jitcjczdzevn", model.properties().typeHandlerVersion()); - Assertions.assertEquals(false, model.properties().autoUpgradeMinorVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineExtensionUpdate model = - new MachineExtensionUpdate() - .withTags(mapOf("cdgea", "ldhugjzzdatqxh")) - .withProperties( - new MachineExtensionUpdateProperties() - .withForceUpdateTag("njbiksqrglssain") - .withPublisher("jwnzlljfmp") - .withType("ebvmgxsabkyqd") - .withTypeHandlerVersion("jitcjczdzevn") - .withAutoUpgradeMinorVersion(false) - .withSettings("datawpdappdsbdkv") - .withProtectedSettings("datawjfeusnhutjel")); - model = BinaryData.fromObject(model).toObject(MachineExtensionUpdate.class); - Assertions.assertEquals("ldhugjzzdatqxh", model.tags().get("cdgea")); - Assertions.assertEquals("njbiksqrglssain", model.properties().forceUpdateTag()); - Assertions.assertEquals("jwnzlljfmp", model.properties().publisher()); - Assertions.assertEquals("ebvmgxsabkyqd", model.properties().type()); - Assertions.assertEquals("jitcjczdzevn", model.properties().typeHandlerVersion()); - Assertions.assertEquals(false, model.properties().autoUpgradeMinorVersion()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateMockTests.java deleted file mode 100644 index ea9130e996538..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionInstanceView; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachineExtensionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"forceUpdateTag\":\"yq\",\"publisher\":\"ynduha\",\"type\":\"qlkth\",\"typeHandlerVersion\":\"aqolbgycduiertg\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datavaolpsslqlf\",\"protectedSettings\":\"datadnbbglzps\",\"provisioningState\":\"Succeeded\",\"instanceView\":{\"name\":\"mnvdfzn\",\"type\":\"ao\",\"typeHandlerVersion\":\"xzb\"}},\"location\":\"lylpstdb\",\"tags\":{\"nevf\":\"srzdzucerscdn\"},\"id\":\"wjmy\",\"name\":\"tdss\",\"type\":\"s\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MachineExtension response = - manager - .machineExtensions() - .define("u") - .withRegion("asrru") - .withExistingMachine("j", "n") - .withTags( - mapOf( - "bsrfbj", - "hsqfsubcgjbirxbp", - "otftpvjzbexilz", - "dtws", - "qtaruoujmkcjhwq", - "nfqqnvwp", - "ervnaenqpehi", - "tjrybnwjewgdr")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("krtswbxqz") - .withPublisher("zjf") - .withType("vjfdx") - .withTypeHandlerVersion("vetvt") - .withAutoUpgradeMinorVersion(true) - .withSettings("datatdo") - .withProtectedSettings("datacbxvwvxyslqbh") - .withInstanceView( - new MachineExtensionInstanceView() - .withName("wwwfbkr") - .withType("nsvs") - .withTypeHandlerVersion("johxcrsb"))) - .create(); - - Assertions.assertEquals("lylpstdb", response.location()); - Assertions.assertEquals("srzdzucerscdn", response.tags().get("nevf")); - Assertions.assertEquals("yq", response.properties().forceUpdateTag()); - Assertions.assertEquals("ynduha", response.properties().publisher()); - Assertions.assertEquals("qlkth", response.properties().type()); - Assertions.assertEquals("aqolbgycduiertg", response.properties().typeHandlerVersion()); - Assertions.assertEquals(false, response.properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("mnvdfzn", response.properties().instanceView().name()); - Assertions.assertEquals("ao", response.properties().instanceView().type()); - Assertions.assertEquals("xzb", response.properties().instanceView().typeHandlerVersion()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteMockTests.java deleted file mode 100644 index eca69296e1582..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachineExtensionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.machineExtensions().delete("qwgxhniskx", "bkpyc", "klwndnhjdauwhv", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetWithResponseMockTests.java deleted file mode 100644 index 10bb9dfd845eb..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsGetWithResponseMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachineExtensionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"forceUpdateTag\":\"zqlveualupjmkhf\",\"publisher\":\"bbcswsrtjri\",\"type\":\"rbpbewtghfgblcg\",\"typeHandlerVersion\":\"zvlvqhjkbegib\",\"autoUpgradeMinorVersion\":false,\"settings\":\"dataiebwwaloayqcgwrt\",\"protectedSettings\":\"datauzgwyzmhtx\",\"provisioningState\":\"gmtsavjcbpwxqpsr\",\"instanceView\":{\"name\":\"tguvriuhp\",\"type\":\"mdyvxqtayriw\",\"typeHandlerVersion\":\"oyq\"}},\"location\":\"rmcqiby\",\"tags\":{\"e\":\"jvkn\",\"zhpvgqzcjrvxd\":\"qsgzvahapj\",\"vawjvzunlu\":\"zlmwlxkvugfhz\",\"xipeilpjzuaejx\":\"hnnpr\"},\"id\":\"ultskzbbtdz\",\"name\":\"mv\",\"type\":\"ekg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MachineExtension response = - manager - .machineExtensions() - .getWithResponse("l", "zbtd", "xujznbmpowu", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rmcqiby", response.location()); - Assertions.assertEquals("jvkn", response.tags().get("e")); - Assertions.assertEquals("zqlveualupjmkhf", response.properties().forceUpdateTag()); - Assertions.assertEquals("bbcswsrtjri", response.properties().publisher()); - Assertions.assertEquals("rbpbewtghfgblcg", response.properties().type()); - Assertions.assertEquals("zvlvqhjkbegib", response.properties().typeHandlerVersion()); - Assertions.assertEquals(false, response.properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("tguvriuhp", response.properties().instanceView().name()); - Assertions.assertEquals("mdyvxqtayriw", response.properties().instanceView().type()); - Assertions.assertEquals("oyq", response.properties().instanceView().typeHandlerVersion()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListMockTests.java deleted file mode 100644 index b25bd3dd8a48b..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.MachineExtension; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachineExtensionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"forceUpdateTag\":\"kqvkelnsmvbxwyjs\",\"publisher\":\"hhcaal\",\"type\":\"ixisxyawjoy\",\"typeHandlerVersion\":\"cslyjpk\",\"autoUpgradeMinorVersion\":true,\"settings\":\"datayexz\",\"protectedSettings\":\"datalixhnrztfol\",\"provisioningState\":\"nxknalaulp\",\"instanceView\":{\"name\":\"dtpnapnyiropuhp\",\"type\":\"vpgylgqgitxmed\",\"typeHandlerVersion\":\"c\"}},\"location\":\"n\",\"tags\":{\"zhxgktrmgucn\":\"ncw\",\"llwptfdy\":\"pkteo\",\"rhhuaopppcqeqx\":\"pfqbuaceopzf\",\"izpost\":\"lzdahzxctobgbkdm\"},\"id\":\"grcfb\",\"name\":\"nrmfqjhhk\",\"type\":\"bpvjymjhx\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.machineExtensions().list("wozuhkf", "bsjyofdx", "uusdttouwa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("n", response.iterator().next().location()); - Assertions.assertEquals("ncw", response.iterator().next().tags().get("zhxgktrmgucn")); - Assertions.assertEquals("kqvkelnsmvbxwyjs", response.iterator().next().properties().forceUpdateTag()); - Assertions.assertEquals("hhcaal", response.iterator().next().properties().publisher()); - Assertions.assertEquals("ixisxyawjoy", response.iterator().next().properties().type()); - Assertions.assertEquals("cslyjpk", response.iterator().next().properties().typeHandlerVersion()); - Assertions.assertEquals(true, response.iterator().next().properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("dtpnapnyiropuhp", response.iterator().next().properties().instanceView().name()); - Assertions.assertEquals("vpgylgqgitxmed", response.iterator().next().properties().instanceView().type()); - Assertions.assertEquals("c", response.iterator().next().properties().instanceView().typeHandlerVersion()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListResultTests.java deleted file mode 100644 index 109208762c9f6..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineExtensionsListResultTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.MachineExtensionInner; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionProperties; -import com.azure.resourcemanager.hybridcompute.models.MachineExtensionsListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MachineExtensionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineExtensionsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"forceUpdateTag\":\"kzsmodm\",\"publisher\":\"ougpbkwt\",\"type\":\"tduqktapspwgcuer\",\"typeHandlerVersion\":\"mkdo\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datahbmdgbbjfdd\",\"protectedSettings\":\"databmbexppbhtqqro\",\"provisioningState\":\"p\"},\"location\":\"algbquxigjyjg\",\"tags\":{\"fhrtxilnerkujysv\":\"o\",\"fqawrlyxw\":\"eju\",\"xgjvtbv\":\"kcprbnw\",\"uouq\":\"ysszdnrujqguh\"},\"id\":\"prwzwbnguitnwui\",\"name\":\"gazxuf\",\"type\":\"zuckyfi\"},{\"properties\":{\"forceUpdateTag\":\"idf\",\"publisher\":\"wdzuhtymwisd\",\"type\":\"thwxmnteiwaopvkm\",\"typeHandlerVersion\":\"c\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datacufufsrpymz\",\"protectedSettings\":\"datansez\",\"provisioningState\":\"tbzsgfyccs\"},\"location\":\"mdwzjeiachboo\",\"tags\":{\"hzzvypyq\":\"nrosfqpte\",\"z\":\"i\"},\"id\":\"npvswjdkirso\",\"name\":\"dqxhcrmnohjtckwh\",\"type\":\"soifiyipjxsqw\"},{\"properties\":{\"forceUpdateTag\":\"jbznorc\",\"publisher\":\"vsnb\",\"type\":\"qabnmoc\",\"typeHandlerVersion\":\"ysh\",\"autoUpgradeMinorVersion\":false,\"settings\":\"datafblj\",\"protectedSettings\":\"datapbtoqcjmkl\",\"provisioningState\":\"vbqid\"},\"location\":\"jzyulpk\",\"tags\":{\"gqexzlocxs\":\"krlkhbzhfepg\",\"bcsglumma\":\"paierh\",\"xkqpxo\":\"tjaodxobnb\",\"po\":\"ajionpimexgstxg\"},\"id\":\"gmaajrm\",\"name\":\"djwzrlov\",\"type\":\"clwhijcoejctbz\"}],\"nextLink\":\"s\"}") - .toObject(MachineExtensionsListResult.class); - Assertions.assertEquals("algbquxigjyjg", model.value().get(0).location()); - Assertions.assertEquals("o", model.value().get(0).tags().get("fhrtxilnerkujysv")); - Assertions.assertEquals("kzsmodm", model.value().get(0).properties().forceUpdateTag()); - Assertions.assertEquals("ougpbkwt", model.value().get(0).properties().publisher()); - Assertions.assertEquals("tduqktapspwgcuer", model.value().get(0).properties().type()); - Assertions.assertEquals("mkdo", model.value().get(0).properties().typeHandlerVersion()); - Assertions.assertEquals(false, model.value().get(0).properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("s", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineExtensionsListResult model = - new MachineExtensionsListResult() - .withValue( - Arrays - .asList( - new MachineExtensionInner() - .withLocation("algbquxigjyjg") - .withTags( - mapOf( - "fhrtxilnerkujysv", - "o", - "fqawrlyxw", - "eju", - "xgjvtbv", - "kcprbnw", - "uouq", - "ysszdnrujqguh")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("kzsmodm") - .withPublisher("ougpbkwt") - .withType("tduqktapspwgcuer") - .withTypeHandlerVersion("mkdo") - .withAutoUpgradeMinorVersion(false) - .withSettings("datahbmdgbbjfdd") - .withProtectedSettings("databmbexppbhtqqro")), - new MachineExtensionInner() - .withLocation("mdwzjeiachboo") - .withTags(mapOf("hzzvypyq", "nrosfqpte", "z", "i")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("idf") - .withPublisher("wdzuhtymwisd") - .withType("thwxmnteiwaopvkm") - .withTypeHandlerVersion("c") - .withAutoUpgradeMinorVersion(false) - .withSettings("datacufufsrpymz") - .withProtectedSettings("datansez")), - new MachineExtensionInner() - .withLocation("jzyulpk") - .withTags( - mapOf( - "gqexzlocxs", - "krlkhbzhfepg", - "bcsglumma", - "paierh", - "xkqpxo", - "tjaodxobnb", - "po", - "ajionpimexgstxg")) - .withProperties( - new MachineExtensionProperties() - .withForceUpdateTag("jbznorc") - .withPublisher("vsnb") - .withType("qabnmoc") - .withTypeHandlerVersion("ysh") - .withAutoUpgradeMinorVersion(false) - .withSettings("datafblj") - .withProtectedSettings("datapbtoqcjmkl")))) - .withNextLink("s"); - model = BinaryData.fromObject(model).toObject(MachineExtensionsListResult.class); - Assertions.assertEquals("algbquxigjyjg", model.value().get(0).location()); - Assertions.assertEquals("o", model.value().get(0).tags().get("fhrtxilnerkujysv")); - Assertions.assertEquals("kzsmodm", model.value().get(0).properties().forceUpdateTag()); - Assertions.assertEquals("ougpbkwt", model.value().get(0).properties().publisher()); - Assertions.assertEquals("tduqktapspwgcuer", model.value().get(0).properties().type()); - Assertions.assertEquals("mkdo", model.value().get(0).properties().typeHandlerVersion()); - Assertions.assertEquals(false, model.value().get(0).properties().autoUpgradeMinorVersion()); - Assertions.assertEquals("s", model.nextLink()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdatePropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdatePropertiesTests.java deleted file mode 100644 index da85e3423d8cd..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdatePropertiesTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.LocationData; -import com.azure.resourcemanager.hybridcompute.models.MachineUpdateProperties; -import org.junit.jupiter.api.Assertions; - -public final class MachineUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineUpdateProperties model = - BinaryData - .fromString( - "{\"locationData\":{\"name\":\"hdwbavxbniwdjs\",\"city\":\"tsdbpgn\",\"district\":\"txhp\",\"countryOrRegion\":\"bzpfzab\"},\"parentClusterResourceId\":\"cuh\",\"privateLinkScopeResourceId\":\"tcty\"}") - .toObject(MachineUpdateProperties.class); - Assertions.assertEquals("hdwbavxbniwdjs", model.locationData().name()); - Assertions.assertEquals("tsdbpgn", model.locationData().city()); - Assertions.assertEquals("txhp", model.locationData().district()); - Assertions.assertEquals("bzpfzab", model.locationData().countryOrRegion()); - Assertions.assertEquals("cuh", model.parentClusterResourceId()); - Assertions.assertEquals("tcty", model.privateLinkScopeResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineUpdateProperties model = - new MachineUpdateProperties() - .withLocationData( - new LocationData() - .withName("hdwbavxbniwdjs") - .withCity("tsdbpgn") - .withDistrict("txhp") - .withCountryOrRegion("bzpfzab")) - .withParentClusterResourceId("cuh") - .withPrivateLinkScopeResourceId("tcty"); - model = BinaryData.fromObject(model).toObject(MachineUpdateProperties.class); - Assertions.assertEquals("hdwbavxbniwdjs", model.locationData().name()); - Assertions.assertEquals("tsdbpgn", model.locationData().city()); - Assertions.assertEquals("txhp", model.locationData().district()); - Assertions.assertEquals("bzpfzab", model.locationData().countryOrRegion()); - Assertions.assertEquals("cuh", model.parentClusterResourceId()); - Assertions.assertEquals("tcty", model.privateLinkScopeResourceId()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdateTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdateTests.java deleted file mode 100644 index d1f7cc517be41..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachineUpdateTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.Identity; -import com.azure.resourcemanager.hybridcompute.models.LocationData; -import com.azure.resourcemanager.hybridcompute.models.MachineUpdate; -import com.azure.resourcemanager.hybridcompute.models.MachineUpdateProperties; -import com.azure.resourcemanager.hybridcompute.models.ResourceIdentityType; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class MachineUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MachineUpdate model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"lbbovplw\",\"tenantId\":\"hvgyuguosvmk\",\"type\":\"SystemAssigned\"},\"properties\":{\"locationData\":{\"name\":\"ukkfplgmgs\",\"city\":\"kjz\",\"district\":\"es\",\"countryOrRegion\":\"vlopwiyighx\"},\"parentClusterResourceId\":\"dwzbaiue\",\"privateLinkScopeResourceId\":\"a\"},\"tags\":{\"mtxpsiebtfh\":\"yqupedeojnabckh\",\"htldwk\":\"pesapskrdqmhjj\",\"otogtwrupqs\":\"zxuutkncwscwsvl\",\"cykvceo\":\"vnm\"}}") - .toObject(MachineUpdate.class); - Assertions.assertEquals("yqupedeojnabckh", model.tags().get("mtxpsiebtfh")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ukkfplgmgs", model.properties().locationData().name()); - Assertions.assertEquals("kjz", model.properties().locationData().city()); - Assertions.assertEquals("es", model.properties().locationData().district()); - Assertions.assertEquals("vlopwiyighx", model.properties().locationData().countryOrRegion()); - Assertions.assertEquals("dwzbaiue", model.properties().parentClusterResourceId()); - Assertions.assertEquals("a", model.properties().privateLinkScopeResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MachineUpdate model = - new MachineUpdate() - .withTags( - mapOf( - "mtxpsiebtfh", - "yqupedeojnabckh", - "htldwk", - "pesapskrdqmhjj", - "otogtwrupqs", - "zxuutkncwscwsvl", - "cykvceo", - "vnm")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties( - new MachineUpdateProperties() - .withLocationData( - new LocationData() - .withName("ukkfplgmgs") - .withCity("kjz") - .withDistrict("es") - .withCountryOrRegion("vlopwiyighx")) - .withParentClusterResourceId("dwzbaiue") - .withPrivateLinkScopeResourceId("a")); - model = BinaryData.fromObject(model).toObject(MachineUpdate.class); - Assertions.assertEquals("yqupedeojnabckh", model.tags().get("mtxpsiebtfh")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("ukkfplgmgs", model.properties().locationData().name()); - Assertions.assertEquals("kjz", model.properties().locationData().city()); - Assertions.assertEquals("es", model.properties().locationData().district()); - Assertions.assertEquals("vlopwiyighx", model.properties().locationData().countryOrRegion()); - Assertions.assertEquals("dwzbaiue", model.properties().parentClusterResourceId()); - Assertions.assertEquals("a", model.properties().privateLinkScopeResourceId()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteByResourceGroupWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index afa199a279163..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/MachinesDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MachinesDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.machines().deleteByResourceGroupWithResponse("eil", "vnotyfjfcnj", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OSProfileTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OSProfileTests.java deleted file mode 100644 index 108f95862b3e8..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OSProfileTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.OSProfile; - -public final class OSProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OSProfile model = BinaryData.fromString("{\"computerName\":\"kknryrtihf\"}").toObject(OSProfile.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OSProfile model = new OSProfile(); - model = BinaryData.fromObject(model).toObject(OSProfile.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationListResultTests.java deleted file mode 100644 index ebffd08e48176..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"origin\":\"bkbfkgukdkex\",\"name\":\"pofm\",\"display\":{\"operation\":\"c\",\"resource\":\"pg\",\"description\":\"toc\",\"provider\":\"xhvpmoue\"}}]}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueDisplayTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueDisplayTests.java deleted file mode 100644 index b0dfa7418ab90..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.OperationValueDisplay; - -public final class OperationValueDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationValueDisplay model = - BinaryData - .fromString( - "{\"operation\":\"t\",\"resource\":\"qkwpyeicxmqc\",\"description\":\"q\",\"provider\":\"khixuigdtopbo\"}") - .toObject(OperationValueDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationValueDisplay model = new OperationValueDisplay(); - model = BinaryData.fromObject(model).toObject(OperationValueDisplay.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueInnerTests.java deleted file mode 100644 index 8cd8d460b6395..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/OperationValueInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner; -import com.azure.resourcemanager.hybridcompute.models.OperationValueDisplay; - -public final class OperationValueInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationValueInner model = - BinaryData - .fromString( - "{\"origin\":\"dzxibqeojnxqbzvd\",\"name\":\"t\",\"display\":{\"operation\":\"eic\",\"resource\":\"w\",\"description\":\"zao\",\"provider\":\"uhrhcffcyddgl\"}}") - .toObject(OperationValueInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationValueInner model = new OperationValueInner().withDisplay(new OperationValueDisplay()); - model = BinaryData.fromObject(model).toObject(OperationValueInner.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionInnerTests.java deleted file mode 100644 index 6cca0fc8fd5b8..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionInnerTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"pbuxwgipwhon\"},\"privateLinkServiceConnectionState\":{\"status\":\"kgshwa\",\"description\":\"kix\",\"actionsRequired\":\"injep\"},\"provisioningState\":\"tmryw\"},\"id\":\"zoqftiyqzrnkcqvy\",\"name\":\"lwh\",\"type\":\"lsicohoqqnwv\"}") - .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("pbuxwgipwhon", model.properties().privateEndpoint().id()); - Assertions.assertEquals("kgshwa", model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("kix", model.properties().privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionInner model = - new PrivateEndpointConnectionInner() - .withProperties( - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpointProperty().withId("pbuxwgipwhon")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("kgshwa") - .withDescription("kix"))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals("pbuxwgipwhon", model.properties().privateEndpoint().id()); - Assertions.assertEquals("kgshwa", model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("kix", model.properties().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionListResultTests.java deleted file mode 100644 index ba65b04ee13c6..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionListResult; - -public final class PrivateEndpointConnectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"bebrjcxerfuwuttt\"},\"id\":\"vjrbirphxepcyvah\",\"name\":\"nljky\",\"type\":\"xjvuujqgidokg\"},{\"properties\":{\"provisioningState\":\"xgvcl\"},\"id\":\"gsncghkjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"},{\"properties\":{\"provisioningState\":\"odebfqkkrbmpu\"},\"id\":\"riwflzlfb\",\"name\":\"zpuzycisp\",\"type\":\"qzahmgkbrp\"}],\"nextLink\":\"dhibnuq\"}") - .toObject(PrivateEndpointConnectionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResult model = new PrivateEndpointConnectionListResult(); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResult.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionPropertiesTests.java deleted file mode 100644 index 94d93962e3a16..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionPropertiesTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointConnectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointConnectionProperties model = - BinaryData - .fromString( - "{\"privateEndpoint\":{\"id\":\"avwhheunm\"},\"privateLinkServiceConnectionState\":{\"status\":\"hgyxzkonoc\",\"description\":\"koklya\",\"actionsRequired\":\"conuqszfkbeype\"},\"provisioningState\":\"mjmwvvjektcx\"}") - .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("avwhheunm", model.privateEndpoint().id()); - Assertions.assertEquals("hgyxzkonoc", model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("koklya", model.privateLinkServiceConnectionState().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionProperties model = - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpointProperty().withId("avwhheunm")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty().withStatus("hgyxzkonoc").withDescription("koklya")); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals("avwhheunm", model.privateEndpoint().id()); - Assertions.assertEquals("hgyxzkonoc", model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("koklya", model.privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java deleted file mode 100644 index 7efc66f01f7ff..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnection; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnectionProperties; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"mxjezwlw\"},\"privateLinkServiceConnectionState\":{\"status\":\"xuqlcvydypat\",\"description\":\"ooaojkniodkooebw\",\"actionsRequired\":\"jhemms\"},\"provisioningState\":\"Succeeded\"},\"id\":\"nfwjlfltkacjvefk\",\"name\":\"lfoakg\",\"type\":\"kfpagao\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .define("gsexne") - .withExistingPrivateLinkScope("ayffim", "zrtuzq") - .withProperties( - new PrivateEndpointConnectionProperties() - .withPrivateEndpoint(new PrivateEndpointProperty().withId("wnwmewzs")) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionStateProperty() - .withStatus("ceuzsoibjudpfr") - .withDescription("trthzvaytdwkqbr"))) - .create(); - - Assertions.assertEquals("mxjezwlw", response.properties().privateEndpoint().id()); - Assertions.assertEquals("xuqlcvydypat", response.properties().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("ooaojkniodkooebw", response.properties().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteMockTests.java deleted file mode 100644 index 989d8d2db0a6d..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .privateEndpointConnections() - .delete("unygaeqid", "qfatpxllrxcyjm", "a", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java deleted file mode 100644 index f893b9e6f44cb..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"privateEndpoint\":{\"id\":\"jhwuaanozjos\"},\"privateLinkServiceConnectionState\":{\"status\":\"youlp\",\"description\":\"rvxaglrvimjwosy\",\"actionsRequired\":\"itc\"},\"provisioningState\":\"fcktqumiekke\"},\"id\":\"ikh\",\"name\":\"yf\",\"type\":\"hdgqggeb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateEndpointConnection response = - manager - .privateEndpointConnections() - .getWithResponse("wczelpci", "elsfeaen", "abfatkl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jhwuaanozjos", response.properties().privateEndpoint().id()); - Assertions.assertEquals("youlp", response.properties().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals("rvxaglrvimjwosy", response.properties().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeMockTests.java deleted file mode 100644 index fa79154ec67f3..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointConnectionsListByPrivateLinkScopeMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointConnection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateEndpointConnectionsListByPrivateLinkScopeMockTests { - @Test - public void testListByPrivateLinkScope() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"jsjqbjhhyx\"},\"privateLinkServiceConnectionState\":{\"status\":\"wlycoduhpkxkg\",\"description\":\"mareqnajxqugj\",\"actionsRequired\":\"ycubeddgs\"},\"provisioningState\":\"fwqmzqalkrmn\"},\"id\":\"jpxac\",\"name\":\"qudf\",\"type\":\"byxbaaabjy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateEndpointConnections().listByPrivateLinkScope("su", "arm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jsjqbjhhyx", response.iterator().next().properties().privateEndpoint().id()); - Assertions - .assertEquals( - "wlycoduhpkxkg", response.iterator().next().properties().privateLinkServiceConnectionState().status()); - Assertions - .assertEquals( - "mareqnajxqugj", - response.iterator().next().properties().privateLinkServiceConnectionState().description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointPropertyTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointPropertyTests.java deleted file mode 100644 index 9b6bf32e381df..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateEndpointPropertyTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateEndpointProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateEndpointPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateEndpointProperty model = - BinaryData.fromString("{\"id\":\"nhwlrsffrzpwvl\"}").toObject(PrivateEndpointProperty.class); - Assertions.assertEquals("nhwlrsffrzpwvl", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointProperty model = new PrivateEndpointProperty().withId("nhwlrsffrzpwvl"); - model = BinaryData.fromObject(model).toObject(PrivateEndpointProperty.class); - Assertions.assertEquals("nhwlrsffrzpwvl", model.id()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceInnerTests.java deleted file mode 100644 index b2b51e7f1ffff..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"groupId\":\"vfaxkffeiith\",\"requiredMembers\":[\"ez\"],\"requiredZoneNames\":[\"hxmzsbbzoggig\",\"xwburvjxxjns\",\"ydptkoen\",\"ou\"]},\"id\":\"vudwtiukbldng\",\"name\":\"pocipazyxoegu\",\"type\":\"g\"}") - .toObject(PrivateLinkResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceInner model = - new PrivateLinkResourceInner().withProperties(new PrivateLinkResourceProperties()); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceInner.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceListResultTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceListResultTests.java deleted file mode 100644 index f9b77830d39e9..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourceListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResourceListResult; - -public final class PrivateLinkResourceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"stkiiuxhqyud\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"qn\",\"name\":\"poczvyifqrvkdvjs\",\"type\":\"lrmv\"},{\"properties\":{\"groupId\":\"watkpnpulexxb\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"ruwiqzbqjvsov\",\"name\":\"yokacspkw\",\"type\":\"hzdobpxjmflbvvnc\"},{\"properties\":{\"groupId\":\"cciw\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"qkhr\",\"name\":\"ajiwkuo\",\"type\":\"oskg\"},{\"properties\":{\"groupId\":\"uuimjmvxieduug\",\"requiredMembers\":[],\"requiredZoneNames\":[]},\"id\":\"rrfbyaosvexcson\",\"name\":\"clhocohsl\",\"type\":\"ev\"}],\"nextLink\":\"ggzfbu\"}") - .toObject(PrivateLinkResourceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResult model = new PrivateLinkResourceListResult(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResult.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcePropertiesTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcePropertiesTests.java deleted file mode 100644 index 666c08c9cca29..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResourceProperties; - -public final class PrivateLinkResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkResourceProperties model = - BinaryData - .fromString( - "{\"groupId\":\"piu\",\"requiredMembers\":[\"gevqznty\",\"mrbpizcdrqj\",\"dpydn\",\"yhxdeoejzicwi\"],\"requiredZoneNames\":[\"ttgzfbis\",\"cbkhajdeyeamdph\"]}") - .toObject(PrivateLinkResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model = new PrivateLinkResourceProperties(); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetWithResponseMockTests.java deleted file mode 100644 index fbcb7424c0687..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"groupId\":\"v\",\"requiredMembers\":[\"piohgwxrtfu\",\"xepxgyqagvrvmn\",\"k\",\"kghimdblxgwimfnj\"],\"requiredZoneNames\":[\"xw\"]},\"id\":\"zk\",\"name\":\"foqreyfkzik\",\"type\":\"jawneaiv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkResource response = - manager - .privateLinkResources() - .getWithResponse("rdvstkwqqtch", "alm", "mtdaa", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeMockTests.java deleted file mode 100644 index 517504719c630..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkResourcesListByPrivateLinkScopeMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkResourcesListByPrivateLinkScopeMockTests { - @Test - public void testListByPrivateLinkScope() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"groupId\":\"otllxdyhgsyo\",\"requiredMembers\":[\"jlt\",\"tbnnha\",\"oocrkvcikhnv\",\"amqgxqquezikyw\"],\"requiredZoneNames\":[\"kallatmel\",\"uipiccjzk\"]},\"id\":\"v\",\"name\":\"vvcnayr\",\"type\":\"yrnxxmueedn\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateLinkResources().listByPrivateLinkScope("lwwrl", "dmtnc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopeValidationDetailsInnerTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopeValidationDetailsInnerTests.java deleted file mode 100644 index 7c38a6decb3d9..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopeValidationDetailsInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.fluent.models.PrivateLinkScopeValidationDetailsInner; -import com.azure.resourcemanager.hybridcompute.models.ConnectionDetail; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkScopeValidationDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkScopeValidationDetailsInner model = - BinaryData - .fromString( - "{\"id\":\"pikad\",\"publicNetworkAccess\":\"Enabled\",\"connectionDetails\":[{\"id\":\"gnbuy\",\"privateIpAddress\":\"ijggmebfsiar\",\"linkIdentifier\":\"trcvpnazzmh\",\"groupId\":\"unmpxttd\",\"memberName\":\"rbnlankxmyskp\"},{\"id\":\"enbtkcxywny\",\"privateIpAddress\":\"rsyn\",\"linkIdentifier\":\"idybyxczf\",\"groupId\":\"haaxdbabphl\",\"memberName\":\"qlfktsths\"}]}") - .toObject(PrivateLinkScopeValidationDetailsInner.class); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkScopeValidationDetailsInner model = - new PrivateLinkScopeValidationDetailsInner() - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED) - .withConnectionDetails(Arrays.asList(new ConnectionDetail(), new ConnectionDetail())); - model = BinaryData.fromObject(model).toObject(PrivateLinkScopeValidationDetailsInner.class); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 1cdeebaba0aea..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScopeProperties; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"puvks\",\"privateLinkScopeId\":\"lsa\"},\"location\":\"ynfs\",\"tags\":{\"ntorzihleosjswsr\":\"jphuopxodlqi\",\"qioxi\":\"slyzrpzbchckqq\",\"wyhqmibzyhwits\":\"suiizynkedyat\"},\"id\":\"ypyynpcdpumnzg\",\"name\":\"wznm\",\"type\":\"biknsorgjhxbld\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HybridComputePrivateLinkScope response = - manager - .privateLinkScopes() - .define("novvqfovljxy") - .withRegion("e") - .withExistingResourceGroup("mkcdyhbpkkpwdre") - .withTags(mapOf("jfqka", "arrwlquu")) - .withProperties( - new HybridComputePrivateLinkScopeProperties() - .withPublicNetworkAccess(PublicNetworkAccessType.ENABLED)) - .create(); - - Assertions.assertEquals("ynfs", response.location()); - Assertions.assertEquals("jphuopxodlqi", response.tags().get("ntorzihleosjswsr")); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.properties().publicNetworkAccess()); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteMockTests.java deleted file mode 100644 index d06b2fa281af3..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.privateLinkScopes().delete("fikdowwqu", "v", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index cb6cff41865ca..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"provisioningState\":\"fwdsj\",\"privateLinkScopeId\":\"aljutiiswac\"},\"location\":\"gdkz\",\"tags\":{\"pfuflrw\":\"kfvhqcrailvpn\",\"lxyjr\":\"mh\",\"fcnihgwq\":\"sag\",\"cvkcvqvpkeqdcv\":\"pnedgf\"},\"id\":\"rhvoods\",\"name\":\"tbobz\",\"type\":\"opcjwvnhd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - HybridComputePrivateLinkScope response = - manager - .privateLinkScopes() - .getByResourceGroupWithResponse("zx", "lvithhqzonosgg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gdkz", response.location()); - Assertions.assertEquals("kfvhqcrailvpn", response.tags().get("pfuflrw")); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.properties().publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests.java deleted file mode 100644 index 5701956da46af..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopeValidationDetails; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesGetValidationDetailsForMachineWithResponseMockTests { - @Test - public void testGetValidationDetailsForMachineWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"kpzksmondjmq\",\"publicNetworkAccess\":\"Disabled\",\"connectionDetails\":[{\"id\":\"mg\",\"privateIpAddress\":\"pkwhojvpa\",\"linkIdentifier\":\"gxysmocmbqfqvm\",\"groupId\":\"xozap\",\"memberName\":\"elxprglyatddck\"},{\"id\":\"cuejrjxgci\",\"privateIpAddress\":\"brh\",\"linkIdentifier\":\"xsdqrhzoymibmrqy\",\"groupId\":\"ahwfluszdtmhrk\",\"memberName\":\"fyyvoq\"},{\"id\":\"piexpbtgiw\",\"privateIpAddress\":\"oenwashr\",\"linkIdentifier\":\"tkcnqxwb\",\"groupId\":\"kulpiujwaasi\",\"memberName\":\"i\"},{\"id\":\"byuqerpqlp\",\"privateIpAddress\":\"cciuqgbdbutau\",\"linkIdentifier\":\"btkuwhh\",\"groupId\":\"ykojoxafnndlpic\",\"memberName\":\"o\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkScopeValidationDetails response = - manager - .privateLinkScopes() - .getValidationDetailsForMachineWithResponse("kcpwiy", "vqtmnub", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsWithResponseMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsWithResponseMockTests.java deleted file mode 100644 index e165c894ae72a..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesGetValidationDetailsWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopeValidationDetails; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesGetValidationDetailsWithResponseMockTests { - @Test - public void testGetValidationDetailsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"id\":\"wuoegrpk\",\"publicNetworkAccess\":\"Disabled\",\"connectionDetails\":[{\"id\":\"qsluicp\",\"privateIpAddress\":\"gk\",\"linkIdentifier\":\"lvmbmpaxmodfvuef\",\"groupId\":\"sbpfvmwyhr\",\"memberName\":\"uyfta\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PrivateLinkScopeValidationDetails response = - manager - .privateLinkScopes() - .getValidationDetailsWithResponse("d", "mgxcxrslpm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupMockTests.java deleted file mode 100644 index b52ea3c89b252..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListByResourceGroupMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"tkoievseotgq\",\"privateLinkScopeId\":\"ltmuwlauwzizx\"},\"location\":\"pgcjefuzmuvp\",\"tags\":{\"morppxebmnzbtbh\":\"d\"},\"id\":\"pglkf\",\"name\":\"ohdneuel\",\"type\":\"phsdyhto\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateLinkScopes().listByResourceGroup("bxmubyynt", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pgcjefuzmuvp", response.iterator().next().location()); - Assertions.assertEquals("d", response.iterator().next().tags().get("morppxebmnzbtbh")); - Assertions - .assertEquals( - PublicNetworkAccessType.DISABLED, response.iterator().next().properties().publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListMockTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListMockTests.java deleted file mode 100644 index 3f822ff383a49..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesListMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.hybridcompute.HybridComputeManager; -import com.azure.resourcemanager.hybridcompute.models.HybridComputePrivateLinkScope; -import com.azure.resourcemanager.hybridcompute.models.PublicNetworkAccessType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PrivateLinkScopesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"publicNetworkAccess\":\"Disabled\",\"provisioningState\":\"riofzpyqse\",\"privateLinkScopeId\":\"abnetshh\"},\"location\":\"h\",\"tags\":{\"nkww\":\"lvwiwubmwmbesl\",\"flcxoga\":\"pp\",\"mkqzeqqkdltfzxmh\":\"konzmnsik\",\"gureodkwobdag\":\"v\"},\"id\":\"tibqdxbxwakb\",\"name\":\"gqxndlkzgxhuripl\",\"type\":\"podxunkb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - HybridComputeManager manager = - HybridComputeManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.privateLinkScopes().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("h", response.iterator().next().location()); - Assertions.assertEquals("lvwiwubmwmbesl", response.iterator().next().tags().get("nkww")); - Assertions - .assertEquals( - PublicNetworkAccessType.DISABLED, response.iterator().next().properties().publicNetworkAccess()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesResourceTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesResourceTests.java deleted file mode 100644 index adc6d5b23050f..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkScopesResourceTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkScopesResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkScopesResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkScopesResource model = - BinaryData - .fromString( - "{\"location\":\"pfhyhl\",\"tags\":{\"atuokthfuiu\":\"mopjmc\",\"zydagfuaxbezyiuo\":\"odsfcpkvxodpuozm\"},\"id\":\"ktwh\",\"name\":\"dxwzywqsmbsurexi\",\"type\":\"o\"}") - .toObject(PrivateLinkScopesResource.class); - Assertions.assertEquals("pfhyhl", model.location()); - Assertions.assertEquals("mopjmc", model.tags().get("atuokthfuiu")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkScopesResource model = - new PrivateLinkScopesResource() - .withLocation("pfhyhl") - .withTags(mapOf("atuokthfuiu", "mopjmc", "zydagfuaxbezyiuo", "odsfcpkvxodpuozm")); - model = BinaryData.fromObject(model).toObject(PrivateLinkScopesResource.class); - Assertions.assertEquals("pfhyhl", model.location()); - Assertions.assertEquals("mopjmc", model.tags().get("atuokthfuiu")); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkServiceConnectionStatePropertyTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkServiceConnectionStatePropertyTests.java deleted file mode 100644 index 11076f01d7a0a..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/PrivateLinkServiceConnectionStatePropertyTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.PrivateLinkServiceConnectionStateProperty; -import org.junit.jupiter.api.Assertions; - -public final class PrivateLinkServiceConnectionStatePropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PrivateLinkServiceConnectionStateProperty model = - BinaryData - .fromString("{\"status\":\"dqgbiqylihkaetc\",\"description\":\"tvfcivfsn\",\"actionsRequired\":\"m\"}") - .toObject(PrivateLinkServiceConnectionStateProperty.class); - Assertions.assertEquals("dqgbiqylihkaetc", model.status()); - Assertions.assertEquals("tvfcivfsn", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkServiceConnectionStateProperty model = - new PrivateLinkServiceConnectionStateProperty().withStatus("dqgbiqylihkaetc").withDescription("tvfcivfsn"); - model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionStateProperty.class); - Assertions.assertEquals("dqgbiqylihkaetc", model.status()); - Assertions.assertEquals("tvfcivfsn", model.description()); - } -} diff --git a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ResourceUpdateTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ResourceUpdateTests.java deleted file mode 100644 index c5aebe4cd1ef1..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/ResourceUpdateTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.ResourceUpdate; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ResourceUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceUpdate model = - BinaryData - .fromString( - "{\"tags\":{\"phejkotynqgoulz\":\"dhsgcba\",\"gakeqsr\":\"dlikwyqkgfgibma\",\"qqedqytbciqfou\":\"yb\"}}") - .toObject(ResourceUpdate.class); - Assertions.assertEquals("dhsgcba", model.tags().get("phejkotynqgoulz")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceUpdate model = - new ResourceUpdate() - .withTags(mapOf("phejkotynqgoulz", "dhsgcba", "gakeqsr", "dlikwyqkgfgibma", "qqedqytbciqfou", "yb")); - model = BinaryData.fromObject(model).toObject(ResourceUpdate.class); - Assertions.assertEquals("dhsgcba", model.tags().get("phejkotynqgoulz")); - } - - @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/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/TagsResourceTests.java b/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/TagsResourceTests.java deleted file mode 100644 index 0defee5da8e40..0000000000000 --- a/sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/test/java/com/azure/resourcemanager/hybridcompute/generated/TagsResourceTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridcompute.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridcompute.models.TagsResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagsResource model = BinaryData.fromString("{\"tags\":{\"s\":\"cfsf\"}}").toObject(TagsResource.class); - Assertions.assertEquals("cfsf", model.tags().get("s")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagsResource model = new TagsResource().withTags(mapOf("s", "cfsf")); - model = BinaryData.fromObject(model).toObject(TagsResource.class); - Assertions.assertEquals("cfsf", model.tags().get("s")); - } - - @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; - } -}