diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md index 8356f38d8ca0..14b8b9fa5fff 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-09-06) + +- Azure Resource Manager BareMetalInfrastructure client library for Java. This package contains Microsoft Azure SDK for BareMetalInfrastructure Management SDK. The Bare Metal Infrastructure Management client. Package tag package-preview-2023-08. 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/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/README.md b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/README.md index 295b35a822b2..1d4010f45ad6 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/README.md +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/README.md @@ -2,7 +2,7 @@ Azure Resource Manager BareMetalInfrastructure client library for Java. -This package contains Microsoft Azure SDK for BareMetalInfrastructure Management SDK. The BareMetalInfrastructure Management client. Package tag package-2021-08-09. 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 BareMetalInfrastructure Management SDK. The Bare Metal Infrastructure Management client. Package tag package-preview-2023-08. 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-baremetalinfrastructure - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fbaremetalinfrastructure%2Fazure-resourcemanager-baremetalinfrastructure%2FREADME.png) diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/SAMPLE.md b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/SAMPLE.md index 51d05a43fe83..01375b088158 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/SAMPLE.md +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/SAMPLE.md @@ -6,8 +6,20 @@ - [GetByResourceGroup](#azurebaremetalinstances_getbyresourcegroup) - [List](#azurebaremetalinstances_list) - [ListByResourceGroup](#azurebaremetalinstances_listbyresourcegroup) +- [Restart](#azurebaremetalinstances_restart) +- [Shutdown](#azurebaremetalinstances_shutdown) +- [Start](#azurebaremetalinstances_start) - [Update](#azurebaremetalinstances_update) +## AzureBareMetalStorageInstances + +- [Create](#azurebaremetalstorageinstances_create) +- [Delete](#azurebaremetalstorageinstances_delete) +- [GetByResourceGroup](#azurebaremetalstorageinstances_getbyresourcegroup) +- [List](#azurebaremetalstorageinstances_list) +- [ListByResourceGroup](#azurebaremetalstorageinstances_listbyresourcegroup) +- [Update](#azurebaremetalstorageinstances_update) + ## Operations - [List](#operations_list) @@ -17,10 +29,10 @@ /** Samples for AzureBareMetalInstances GetByResourceGroup. */ public final class AzureBareMetalInstancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_Get.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_Get.json */ /** - * Sample code: Get an AzureBareMetal instance. + * Sample code: Get an Azure Bare Metal Instance. * * @param manager Entry point to BareMetalInfrastructureManager. */ @@ -40,10 +52,10 @@ public final class AzureBareMetalInstancesGetByResourceGroupSamples { /** Samples for AzureBareMetalInstances List. */ public final class AzureBareMetalInstancesListSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListBySubscription.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_ListBySubscription.json */ /** - * Sample code: List all AzureBareMetal instances in a subscription. + * Sample code: List all Azure Bare Metal Instances in a subscription. * * @param manager Entry point to BareMetalInfrastructureManager. */ @@ -60,10 +72,10 @@ public final class AzureBareMetalInstancesListSamples { /** Samples for AzureBareMetalInstances ListByResourceGroup. */ public final class AzureBareMetalInstancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListByResourceGroup.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_ListByResourceGroup.json */ /** - * Sample code: List all AzureBareMetal instances in a resource group. + * Sample code: List all Azure Bare Metal Instances in a resource group. * * @param manager Entry point to BareMetalInfrastructureManager. */ @@ -74,6 +86,70 @@ public final class AzureBareMetalInstancesListByResourceGroupSamples { } ``` +### AzureBareMetalInstances_Restart + +```java +/** Samples for AzureBareMetalInstances Restart. */ +public final class AzureBareMetalInstancesRestartSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_Restart.json + */ + /** + * Sample code: Restart an Azure Bare Metal Instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void restartAnAzureBareMetalInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalInstances() + .restart("myResourceGroup", "myABMInstance", null, com.azure.core.util.Context.NONE); + } +} +``` + +### AzureBareMetalInstances_Shutdown + +```java +/** Samples for AzureBareMetalInstances Shutdown. */ +public final class AzureBareMetalInstancesShutdownSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_Shutdown.json + */ + /** + * Sample code: Shutdown an Azure Bare Metal Instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void shutdownAnAzureBareMetalInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalInstances() + .shutdown("myResourceGroup", "myABMInstance", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureBareMetalInstances_Start + +```java +/** Samples for AzureBareMetalInstances Start. */ +public final class AzureBareMetalInstancesStartSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_Start.json + */ + /** + * Sample code: Start an Azure Bare Metal instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void startAnAzureBareMetalInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager.azureBareMetalInstances().start("myResourceGroup", "myABMInstance", com.azure.core.util.Context.NONE); + } +} +``` + ### AzureBareMetalInstances_Update ```java @@ -84,10 +160,26 @@ import java.util.Map; /** Samples for AzureBareMetalInstances Update. */ public final class AzureBareMetalInstancesUpdateSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_PatchTags_Delete.json + */ + /** + * Sample code: Delete Tags field of an Azure Bare Metal Instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void deleteTagsFieldOfAnAzureBareMetalInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalInstances() + .updateWithResponse( + "myResourceGroup", "myABMInstance", new Tags().withTags(mapOf()), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_PatchTags.json */ /** - * Sample code: Update Tags field of an AzureBareMetal instance. + * Sample code: Update Tags field of an Azure Bare Metal Instance. * * @param manager Entry point to BareMetalInfrastructureManager. */ @@ -98,26 +190,215 @@ public final class AzureBareMetalInstancesUpdateSamples { .updateWithResponse( "myResourceGroup", "myABMInstance", - new Tags().withTags(mapOf("testkey", "testvalue")), + new Tags().withTags(mapOf("testkey", "fakeTokenPlaceholder")), com.azure.core.util.Context.NONE); } + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AzureBareMetalStorageInstances_Create + +```java +import com.azure.resourcemanager.baremetalinfrastructure.models.ProvisioningState; +import com.azure.resourcemanager.baremetalinfrastructure.models.StorageBillingProperties; +import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AzureBareMetalStorageInstances Create. */ +public final class AzureBareMetalStorageInstancesCreateSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags_Delete.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_Create.json */ /** - * Sample code: Delete Tags field of an AzureBareMetal instance. + * Sample code: Put a new AzureBareMetalStorageInstance. * * @param manager Entry point to BareMetalInfrastructureManager. */ - public static void deleteTagsFieldOfAnAzureBareMetalInstance( + public static void putANewAzureBareMetalStorageInstance( com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { manager - .azureBareMetalInstances() - .updateWithResponse( - "myResourceGroup", "myABMInstance", new Tags().withTags(mapOf()), com.azure.core.util.Context.NONE); + .azureBareMetalStorageInstances() + .define("myAzureBareMetalStorageInstance") + .withRegion("westus2") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withAzureBareMetalStorageInstanceUniqueIdentifier("23415635-4d7e-41dc-9598-8194f22c24e9") + .withStorageProperties( + new StorageProperties() + .withProvisioningState(ProvisioningState.SUCCEEDED) + .withOfferingType("EPIC") + .withStorageType("FC") + .withGeneration("Gen4") + .withHardwareType("NetApp") + .withWorkloadType("ODB") + .withStorageBillingProperties( + new StorageBillingProperties() + .withBillingMode("PAYG") + .withAzureBareMetalStorageInstanceSize(""))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### AzureBareMetalStorageInstances_Delete + +```java +/** Samples for AzureBareMetalStorageInstances Delete. */ +public final class AzureBareMetalStorageInstancesDeleteSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_Delete.json + */ + /** + * Sample code: Delete an AzureBareMetalStorageInstance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void deleteAnAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalStorageInstances() + .deleteByResourceGroupWithResponse( + "myResourceGroup", "myAzureBareMetalStorageInstance", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureBareMetalStorageInstances_GetByResourceGroup + +```java +/** Samples for AzureBareMetalStorageInstances GetByResourceGroup. */ +public final class AzureBareMetalStorageInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_Get.json + */ + /** + * Sample code: Get an AzureBareMetalStorage instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void getAnAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalStorageInstances() + .getByResourceGroupWithResponse( + "myResourceGroup", "myAzureBareMetalStorageInstance", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureBareMetalStorageInstances_List + +```java +/** Samples for AzureBareMetalStorageInstances List. */ +public final class AzureBareMetalStorageInstancesListSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_ListBySubscription.json + */ + /** + * Sample code: List all AzureBareMetalStorage instances in a subscription. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void listAllAzureBareMetalStorageInstancesInASubscription( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager.azureBareMetalStorageInstances().list(com.azure.core.util.Context.NONE); + } +} +``` + +### AzureBareMetalStorageInstances_ListByResourceGroup + +```java +/** Samples for AzureBareMetalStorageInstances ListByResourceGroup. */ +public final class AzureBareMetalStorageInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_ListByResourceGroup.json + */ + /** + * Sample code: List all AzureBareMetalStorage instances in a resource group. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void listAllAzureBareMetalStorageInstancesInAResourceGroup( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalStorageInstances() + .listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} +``` + +### AzureBareMetalStorageInstances_Update + +```java +import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AzureBareMetalStorageInstances Update. */ +public final class AzureBareMetalStorageInstancesUpdateSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_PatchTags.json + */ + /** + * Sample code: Update Tags field of an AzureBareMetalStorage instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void updateTagsFieldOfAnAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + AzureBareMetalStorageInstance resource = + manager + .azureBareMetalStorageInstances() + .getByResourceGroupWithResponse("myResourceGroup", "myABMSInstance", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("testkey", "fakeTokenPlaceholder")).apply(); + } + + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_PatchTags_Delete.json + */ + /** + * Sample code: Delete Tags field of an AzureBareMetalStorage instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void deleteTagsFieldOfAnAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + AzureBareMetalStorageInstance resource = + manager + .azureBareMetalStorageInstances() + .getByResourceGroupWithResponse("myResourceGroup", "myABMSInstance", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf()).apply(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -137,7 +418,7 @@ public final class AzureBareMetalInstancesUpdateSamples { /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalOperations_List.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalOperations_List.json */ /** * Sample code: List all management operations supported by the AzureBareMetal RP. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/pom.xml b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/pom.xml index 6a258a7b7700..c148e4101807 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/pom.xml +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for BareMetalInfrastructure Management - This package contains Microsoft Azure SDK for BareMetalInfrastructure Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The BareMetalInfrastructure Management client. Package tag package-2021-08-09. + This package contains Microsoft Azure SDK for BareMetalInfrastructure Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Bare Metal Infrastructure Management client. Package tag package-preview-2023-08. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/BareMetalInfrastructureManager.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/BareMetalInfrastructureManager.java index 0e7299877104..5048d552e353 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/BareMetalInfrastructureManager.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/BareMetalInfrastructureManager.java @@ -25,9 +25,11 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.baremetalinfrastructure.fluent.BareMetalInfrastructureClient; import com.azure.resourcemanager.baremetalinfrastructure.implementation.AzureBareMetalInstancesImpl; +import com.azure.resourcemanager.baremetalinfrastructure.implementation.AzureBareMetalStorageInstancesImpl; import com.azure.resourcemanager.baremetalinfrastructure.implementation.BareMetalInfrastructureClientBuilder; import com.azure.resourcemanager.baremetalinfrastructure.implementation.OperationsImpl; import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstances; +import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstances; import com.azure.resourcemanager.baremetalinfrastructure.models.Operations; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -36,12 +38,14 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to BareMetalInfrastructureManager. The BareMetalInfrastructure Management client. */ +/** Entry point to BareMetalInfrastructureManager. The Bare Metal Infrastructure Management client. */ public final class BareMetalInfrastructureManager { private AzureBareMetalInstances azureBareMetalInstances; private Operations operations; + private AzureBareMetalStorageInstances azureBareMetalStorageInstances; + private final BareMetalInfrastructureClient clientObject; private BareMetalInfrastructureManager( @@ -209,7 +213,7 @@ public BareMetalInfrastructureManager authenticate(TokenCredential credential, A .append("-") .append("com.azure.resourcemanager.baremetalinfrastructure") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -292,8 +296,23 @@ public Operations operations() { } /** - * @return Wrapped service client BareMetalInfrastructureClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets the resource collection API of AzureBareMetalStorageInstances. It manages AzureBareMetalStorageInstance. + * + * @return Resource collection API of AzureBareMetalStorageInstances. + */ + public AzureBareMetalStorageInstances azureBareMetalStorageInstances() { + if (this.azureBareMetalStorageInstances == null) { + this.azureBareMetalStorageInstances = + new AzureBareMetalStorageInstancesImpl(clientObject.getAzureBareMetalStorageInstances(), this); + } + return azureBareMetalStorageInstances; + } + + /** + * Gets wrapped service client BareMetalInfrastructureClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client BareMetalInfrastructureClient. */ public BareMetalInfrastructureClient serviceClient() { return this.clientObject; diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalInstancesClient.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalInstancesClient.java index 4f78f629517d..c4d76f0ce8a3 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalInstancesClient.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalInstancesClient.java @@ -8,87 +8,294 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalInstanceInner; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.baremetalinfrastructure.models.ForceState; import com.azure.resourcemanager.baremetalinfrastructure.models.Tags; /** An instance of this class provides access to all the operations defined in AzureBareMetalInstancesClient. */ public interface AzureBareMetalInstancesClient { /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Start a Bare Metal Instance. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> beginStart( + String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> beginStart( + String resourceGroupName, String azureBareMetalInstanceName, Context context); + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner start(String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner start(String resourceGroupName, String azureBareMetalInstanceName, Context context); + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> beginRestart( + String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> beginRestart( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, Context context); + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner restart(String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner restart( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, Context context); + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> beginShutdown( + String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> beginShutdown( + String resourceGroupName, String azureBareMetalInstanceName, Context context); + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner shutdown(String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner shutdown(String resourceGroupName, String azureBareMetalInstanceName, Context context); + + /** + * Returns a list of Azure Bare Metal Instances in the specified subscription. + * + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link + * @return the response from the List Azure Bare Metal Instances operation as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Returns a list of Azure Bare Metal Instances in the specified subscription. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link + * @return the response from the List Azure Bare Metal Instances operation as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response - * with {@link PagedIterable}. + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response - * with {@link PagedIterable}. + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name along with + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name along with * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -96,28 +303,28 @@ Response getByResourceGroupWithResponse( String resourceGroupName, String azureBareMetalInstanceName, Context context); /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name. + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. */ @ServiceMethod(returns = ReturnType.SINGLE) AzureBareMetalInstanceInner getByResourceGroup(String resourceGroupName, String azureBareMetalInstanceName); /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -131,13 +338,13 @@ Response updateWithResponse( String resourceGroupName, String azureBareMetalInstanceName, Tags tagsParameter, Context context); /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalStorageInstancesClient.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalStorageInstancesClient.java new file mode 100644 index 000000000000..e22d441d065e --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalStorageInstancesClient.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.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.baremetalinfrastructure.fluent.models.AzureBareMetalStorageInstanceInner; +import com.azure.resourcemanager.baremetalinfrastructure.models.Tags; + +/** An instance of this class provides access to all the operations defined in AzureBareMetalStorageInstancesClient. */ +public interface AzureBareMetalStorageInstancesClient { + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Context context); + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureBareMetalStorageInstanceInner getByResourceGroup( + String resourceGroupName, String azureBareMetalStorageInstanceName); + + /** + * Create an azure bare metal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param requestBodyParameters request body for put call. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse( + String resourceGroupName, + String azureBareMetalStorageInstanceName, + AzureBareMetalStorageInstanceInner requestBodyParameters, + Context context); + + /** + * Create an azure bare metal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param requestBodyParameters request body for put call. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureBareMetalStorageInstanceInner create( + String resourceGroupName, + String azureBareMetalStorageInstanceName, + AzureBareMetalStorageInstanceInner requestBodyParameters); + + /** + * Patches the Tags field of a Azure Bare Metal Storage instance. + * + *

Patches the Tags field of a Azure Bare Metal Storage instance for the specified subscription, resource group, + * and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param tagsParameter Request body that only contains the new Tags field. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Tags tagsParameter, Context context); + + /** + * Patches the Tags field of a Azure Bare Metal Storage instance. + * + *

Patches the Tags field of a Azure Bare Metal Storage instance for the specified subscription, resource group, + * and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param tagsParameter Request body that only contains the new Tags field. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureBareMetalStorageInstanceInner update( + String resourceGroupName, String azureBareMetalStorageInstanceName, Tags tagsParameter); + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Context context); + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String azureBareMetalStorageInstanceName); +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/BareMetalInfrastructureClient.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/BareMetalInfrastructureClient.java index 0e679b0817ee..c54e2824692a 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/BareMetalInfrastructureClient.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/BareMetalInfrastructureClient.java @@ -10,7 +10,7 @@ /** The interface for BareMetalInfrastructureClient class. */ public interface BareMetalInfrastructureClient { /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -57,4 +57,11 @@ public interface BareMetalInfrastructureClient { * @return the OperationsClient object. */ OperationsClient getOperations(); + + /** + * Gets the AzureBareMetalStorageInstancesClient object to access its operations. + * + * @return the AzureBareMetalStorageInstancesClient object. + */ + AzureBareMetalStorageInstancesClient getAzureBareMetalStorageInstances(); } diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/OperationsClient.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/OperationsClient.java index cf5b554e1a66..adbd285172a7 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/OperationsClient.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/OperationsClient.java @@ -13,7 +13,9 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public interface OperationsClient { /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @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. @@ -23,7 +25,9 @@ public interface OperationsClient { PagedIterable list(); /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceInner.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceInner.java index fbacb532c39b..20541952745b 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceInner.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceInner.java @@ -26,7 +26,7 @@ public final class AzureBareMetalInstanceInner extends Resource { private AzureBareMetalInstanceProperties innerProperties; /* - * The system metadata relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; @@ -45,7 +45,7 @@ private AzureBareMetalInstanceProperties innerProperties() { } /** - * Get the systemData property: The system metadata relating to this resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -68,7 +68,7 @@ public AzureBareMetalInstanceInner withTags(Map tags) { } /** - * Get the hardwareProfile property: Specifies the hardware settings for the AzureBareMetal instance. + * Get the hardwareProfile property: Specifies the hardware settings for the Azure Bare Metal Instance. * * @return the hardwareProfile value. */ @@ -77,7 +77,7 @@ public HardwareProfile hardwareProfile() { } /** - * Set the hardwareProfile property: Specifies the hardware settings for the AzureBareMetal instance. + * Set the hardwareProfile property: Specifies the hardware settings for the Azure Bare Metal Instance. * * @param hardwareProfile the hardwareProfile value to set. * @return the AzureBareMetalInstanceInner object itself. @@ -91,7 +91,7 @@ public AzureBareMetalInstanceInner withHardwareProfile(HardwareProfile hardwareP } /** - * Get the storageProfile property: Specifies the storage settings for the AzureBareMetal instance disks. + * Get the storageProfile property: Specifies the storage settings for the Azure Bare Metal Instance disks. * * @return the storageProfile value. */ @@ -100,7 +100,7 @@ public StorageProfile storageProfile() { } /** - * Set the storageProfile property: Specifies the storage settings for the AzureBareMetal instance disks. + * Set the storageProfile property: Specifies the storage settings for the Azure Bare Metal Instance disks. * * @param storageProfile the storageProfile value to set. * @return the AzureBareMetalInstanceInner object itself. @@ -114,7 +114,7 @@ public AzureBareMetalInstanceInner withStorageProfile(StorageProfile storageProf } /** - * Get the osProfile property: Specifies the operating system settings for the AzureBareMetal instance. + * Get the osProfile property: Specifies the operating system settings for the Azure Bare Metal Instance. * * @return the osProfile value. */ @@ -123,7 +123,7 @@ public OSProfile osProfile() { } /** - * Set the osProfile property: Specifies the operating system settings for the AzureBareMetal instance. + * Set the osProfile property: Specifies the operating system settings for the Azure Bare Metal Instance. * * @param osProfile the osProfile value to set. * @return the AzureBareMetalInstanceInner object itself. @@ -137,7 +137,7 @@ public AzureBareMetalInstanceInner withOsProfile(OSProfile osProfile) { } /** - * Get the networkProfile property: Specifies the network settings for the AzureBareMetal instance. + * Get the networkProfile property: Specifies the network settings for the Azure Bare Metal Instance. * * @return the networkProfile value. */ @@ -146,7 +146,7 @@ public NetworkProfile networkProfile() { } /** - * Set the networkProfile property: Specifies the network settings for the AzureBareMetal instance. + * Set the networkProfile property: Specifies the network settings for the Azure Bare Metal Instance. * * @param networkProfile the networkProfile value to set. * @return the AzureBareMetalInstanceInner object itself. @@ -160,7 +160,7 @@ public AzureBareMetalInstanceInner withNetworkProfile(NetworkProfile networkProf } /** - * Get the azureBareMetalInstanceId property: Specifies the AzureBareMetal instance unique ID. + * Get the azureBareMetalInstanceId property: Specifies the Azure Bare Metal Instance unique ID. * * @return the azureBareMetalInstanceId value. */ @@ -187,7 +187,7 @@ public String proximityPlacementGroup() { } /** - * Get the hwRevision property: Hardware revision of an AzureBareMetal instance. + * Get the hwRevision property: Hardware revision of an Azure Bare Metal Instance. * * @return the hwRevision value. */ diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceProperties.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceProperties.java index 96f4ffbdc8d8..108ba91e02a6 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceProperties.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalInstanceProperties.java @@ -13,35 +13,35 @@ import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProfile; import com.fasterxml.jackson.annotation.JsonProperty; -/** Describes the properties of an AzureBareMetal instance. */ +/** Describes the properties of an Azure Bare Metal Instance. */ @Fluent public final class AzureBareMetalInstanceProperties { /* - * Specifies the hardware settings for the AzureBareMetal instance. + * Specifies the hardware settings for the Azure Bare Metal Instance. */ @JsonProperty(value = "hardwareProfile") private HardwareProfile hardwareProfile; /* - * Specifies the storage settings for the AzureBareMetal instance disks. + * Specifies the storage settings for the Azure Bare Metal Instance disks. */ @JsonProperty(value = "storageProfile") private StorageProfile storageProfile; /* - * Specifies the operating system settings for the AzureBareMetal instance. + * Specifies the operating system settings for the Azure Bare Metal Instance. */ @JsonProperty(value = "osProfile") private OSProfile osProfile; /* - * Specifies the network settings for the AzureBareMetal instance. + * Specifies the network settings for the Azure Bare Metal Instance. */ @JsonProperty(value = "networkProfile") private NetworkProfile networkProfile; /* - * Specifies the AzureBareMetal instance unique ID. + * Specifies the Azure Bare Metal Instance unique ID. */ @JsonProperty(value = "azureBareMetalInstanceId", access = JsonProperty.Access.WRITE_ONLY) private String azureBareMetalInstanceId; @@ -59,7 +59,7 @@ public final class AzureBareMetalInstanceProperties { private String proximityPlacementGroup; /* - * Hardware revision of an AzureBareMetal instance + * Hardware revision of an Azure Bare Metal Instance */ @JsonProperty(value = "hwRevision", access = JsonProperty.Access.WRITE_ONLY) private String hwRevision; @@ -81,7 +81,7 @@ public AzureBareMetalInstanceProperties() { } /** - * Get the hardwareProfile property: Specifies the hardware settings for the AzureBareMetal instance. + * Get the hardwareProfile property: Specifies the hardware settings for the Azure Bare Metal Instance. * * @return the hardwareProfile value. */ @@ -90,7 +90,7 @@ public HardwareProfile hardwareProfile() { } /** - * Set the hardwareProfile property: Specifies the hardware settings for the AzureBareMetal instance. + * Set the hardwareProfile property: Specifies the hardware settings for the Azure Bare Metal Instance. * * @param hardwareProfile the hardwareProfile value to set. * @return the AzureBareMetalInstanceProperties object itself. @@ -101,7 +101,7 @@ public AzureBareMetalInstanceProperties withHardwareProfile(HardwareProfile hard } /** - * Get the storageProfile property: Specifies the storage settings for the AzureBareMetal instance disks. + * Get the storageProfile property: Specifies the storage settings for the Azure Bare Metal Instance disks. * * @return the storageProfile value. */ @@ -110,7 +110,7 @@ public StorageProfile storageProfile() { } /** - * Set the storageProfile property: Specifies the storage settings for the AzureBareMetal instance disks. + * Set the storageProfile property: Specifies the storage settings for the Azure Bare Metal Instance disks. * * @param storageProfile the storageProfile value to set. * @return the AzureBareMetalInstanceProperties object itself. @@ -121,7 +121,7 @@ public AzureBareMetalInstanceProperties withStorageProfile(StorageProfile storag } /** - * Get the osProfile property: Specifies the operating system settings for the AzureBareMetal instance. + * Get the osProfile property: Specifies the operating system settings for the Azure Bare Metal Instance. * * @return the osProfile value. */ @@ -130,7 +130,7 @@ public OSProfile osProfile() { } /** - * Set the osProfile property: Specifies the operating system settings for the AzureBareMetal instance. + * Set the osProfile property: Specifies the operating system settings for the Azure Bare Metal Instance. * * @param osProfile the osProfile value to set. * @return the AzureBareMetalInstanceProperties object itself. @@ -141,7 +141,7 @@ public AzureBareMetalInstanceProperties withOsProfile(OSProfile osProfile) { } /** - * Get the networkProfile property: Specifies the network settings for the AzureBareMetal instance. + * Get the networkProfile property: Specifies the network settings for the Azure Bare Metal Instance. * * @return the networkProfile value. */ @@ -150,7 +150,7 @@ public NetworkProfile networkProfile() { } /** - * Set the networkProfile property: Specifies the network settings for the AzureBareMetal instance. + * Set the networkProfile property: Specifies the network settings for the Azure Bare Metal Instance. * * @param networkProfile the networkProfile value to set. * @return the AzureBareMetalInstanceProperties object itself. @@ -161,7 +161,7 @@ public AzureBareMetalInstanceProperties withNetworkProfile(NetworkProfile networ } /** - * Get the azureBareMetalInstanceId property: Specifies the AzureBareMetal instance unique ID. + * Get the azureBareMetalInstanceId property: Specifies the Azure Bare Metal Instance unique ID. * * @return the azureBareMetalInstanceId value. */ @@ -188,7 +188,7 @@ public String proximityPlacementGroup() { } /** - * Get the hwRevision property: Hardware revision of an AzureBareMetal instance. + * Get the hwRevision property: Hardware revision of an Azure Bare Metal Instance. * * @return the hwRevision value. */ diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalStorageInstanceInner.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalStorageInstanceInner.java new file mode 100644 index 000000000000..e157a32c4de4 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalStorageInstanceInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** AzureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties). */ +@Fluent +public final class AzureBareMetalStorageInstanceInner extends Resource { + /* + * AzureBareMetalStorageInstance properties + */ + @JsonProperty(value = "properties") + private AzureBareMetalStorageInstanceProperties 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 AzureBareMetalStorageInstanceInner class. */ + public AzureBareMetalStorageInstanceInner() { + } + + /** + * Get the innerProperties property: AzureBareMetalStorageInstance properties. + * + * @return the innerProperties value. + */ + private AzureBareMetalStorageInstanceProperties 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; + } + + /** {@inheritDoc} */ + @Override + public AzureBareMetalStorageInstanceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AzureBareMetalStorageInstanceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the azureBareMetalStorageInstanceUniqueIdentifier property: Specifies the AzureBareMetaStorageInstance unique + * ID. + * + * @return the azureBareMetalStorageInstanceUniqueIdentifier value. + */ + public String azureBareMetalStorageInstanceUniqueIdentifier() { + return this.innerProperties() == null + ? null + : this.innerProperties().azureBareMetalStorageInstanceUniqueIdentifier(); + } + + /** + * Set the azureBareMetalStorageInstanceUniqueIdentifier property: Specifies the AzureBareMetaStorageInstance unique + * ID. + * + * @param azureBareMetalStorageInstanceUniqueIdentifier the azureBareMetalStorageInstanceUniqueIdentifier value to + * set. + * @return the AzureBareMetalStorageInstanceInner object itself. + */ + public AzureBareMetalStorageInstanceInner withAzureBareMetalStorageInstanceUniqueIdentifier( + String azureBareMetalStorageInstanceUniqueIdentifier) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureBareMetalStorageInstanceProperties(); + } + this + .innerProperties() + .withAzureBareMetalStorageInstanceUniqueIdentifier(azureBareMetalStorageInstanceUniqueIdentifier); + return this; + } + + /** + * Get the storageProperties property: Specifies the storage properties for the AzureBareMetalStorage instance. + * + * @return the storageProperties value. + */ + public StorageProperties storageProperties() { + return this.innerProperties() == null ? null : this.innerProperties().storageProperties(); + } + + /** + * Set the storageProperties property: Specifies the storage properties for the AzureBareMetalStorage instance. + * + * @param storageProperties the storageProperties value to set. + * @return the AzureBareMetalStorageInstanceInner object itself. + */ + public AzureBareMetalStorageInstanceInner withStorageProperties(StorageProperties storageProperties) { + if (this.innerProperties() == null) { + this.innerProperties = new AzureBareMetalStorageInstanceProperties(); + } + this.innerProperties().withStorageProperties(storageProperties); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalStorageInstanceProperties.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalStorageInstanceProperties.java new file mode 100644 index 000000000000..a3ec955ab37e --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/AzureBareMetalStorageInstanceProperties.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.baremetalinfrastructure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the properties of an AzureBareMetalStorageInstance. */ +@Fluent +public final class AzureBareMetalStorageInstanceProperties { + /* + * Specifies the AzureBareMetaStorageInstance unique ID. + */ + @JsonProperty(value = "azureBareMetalStorageInstanceUniqueIdentifier") + private String azureBareMetalStorageInstanceUniqueIdentifier; + + /* + * Specifies the storage properties for the AzureBareMetalStorage instance. + */ + @JsonProperty(value = "storageProperties") + private StorageProperties storageProperties; + + /** Creates an instance of AzureBareMetalStorageInstanceProperties class. */ + public AzureBareMetalStorageInstanceProperties() { + } + + /** + * Get the azureBareMetalStorageInstanceUniqueIdentifier property: Specifies the AzureBareMetaStorageInstance unique + * ID. + * + * @return the azureBareMetalStorageInstanceUniqueIdentifier value. + */ + public String azureBareMetalStorageInstanceUniqueIdentifier() { + return this.azureBareMetalStorageInstanceUniqueIdentifier; + } + + /** + * Set the azureBareMetalStorageInstanceUniqueIdentifier property: Specifies the AzureBareMetaStorageInstance unique + * ID. + * + * @param azureBareMetalStorageInstanceUniqueIdentifier the azureBareMetalStorageInstanceUniqueIdentifier value to + * set. + * @return the AzureBareMetalStorageInstanceProperties object itself. + */ + public AzureBareMetalStorageInstanceProperties withAzureBareMetalStorageInstanceUniqueIdentifier( + String azureBareMetalStorageInstanceUniqueIdentifier) { + this.azureBareMetalStorageInstanceUniqueIdentifier = azureBareMetalStorageInstanceUniqueIdentifier; + return this; + } + + /** + * Get the storageProperties property: Specifies the storage properties for the AzureBareMetalStorage instance. + * + * @return the storageProperties value. + */ + public StorageProperties storageProperties() { + return this.storageProperties; + } + + /** + * Set the storageProperties property: Specifies the storage properties for the AzureBareMetalStorage instance. + * + * @param storageProperties the storageProperties value to set. + * @return the AzureBareMetalStorageInstanceProperties object itself. + */ + public AzureBareMetalStorageInstanceProperties withStorageProperties(StorageProperties storageProperties) { + this.storageProperties = storageProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageProperties() != null) { + storageProperties().validate(); + } + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationInner.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationInner.java index 113f9a48b39e..ac5127c61065 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationInner.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationInner.java @@ -5,38 +5,58 @@ package com.azure.resourcemanager.baremetalinfrastructure.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.baremetalinfrastructure.models.Display; +import com.azure.resourcemanager.baremetalinfrastructure.models.ActionType; +import com.azure.resourcemanager.baremetalinfrastructure.models.OperationDisplay; +import com.azure.resourcemanager.baremetalinfrastructure.models.Origin; import com.fasterxml.jackson.annotation.JsonProperty; -/** AzureBareMetal operation information. */ +/** + * REST API Operation + * + *

Details of a REST API operation, returned from the Resource Provider Operations API. + */ @Fluent public final class OperationInner { /* - * The name of the operation being performed on this particular object. This name should match the action name that - * appears in RBAC / the event service. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * Displayed AzureBareMetal operation information + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. */ @JsonProperty(value = "display") - private Display display; + private OperationDisplay display; /* - * indicates whether an operation is a data action or not. + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDataAction; + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) + private ActionType actionType; /** Creates an instance of OperationInner class. */ public OperationInner() { } /** - * Get the name property: The name of the operation being performed on this particular object. This name should - * match the action name that appears in RBAC / the event service. + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ @@ -45,32 +65,53 @@ public String name() { } /** - * Get the display property: Displayed AzureBareMetal operation information. + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. * * @return the display value. */ - public Display display() { + public OperationDisplay display() { return this.display; } /** - * Set the display property: Displayed AzureBareMetal operation information. + * Set the display property: Localized display information for this particular operation. * * @param display the display value to set. * @return the OperationInner object itself. */ - public OperationInner withDisplay(Display display) { + public OperationInner withDisplay(OperationDisplay display) { this.display = display; return this; } /** - * Get the isDataAction property: indicates whether an operation is a data action or not. + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * - * @return the isDataAction value. + * @return the origin value. */ - public Boolean isDataAction() { - return this.isDataAction; + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; } /** diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationStatusInner.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationStatusInner.java new file mode 100644 index 000000000000..7cc0a85986b0 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/OperationStatusInner.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.baremetalinfrastructure.models.AsyncOperationStatus; +import com.azure.resourcemanager.baremetalinfrastructure.models.OperationStatusError; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The OperationStatus object returns the state of an asynchronous operation. */ +@Fluent +public final class OperationStatusInner { + /* + * Unique Operation Status Identifier. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Status of the operation. + */ + @JsonProperty(value = "status") + private AsyncOperationStatus status; + + /* + * Start Time when the operation was initially executed. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /* + * An error from the Azure Bare Metal Infrastructure service. + */ + @JsonProperty(value = "error") + private OperationStatusError error; + + /** Creates an instance of OperationStatusInner class. */ + public OperationStatusInner() { + } + + /** + * Get the name property: Unique Operation Status Identifier. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Unique Operation Status Identifier. + * + * @param name the name value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Status of the operation. + * + * @return the status value. + */ + public AsyncOperationStatus status() { + return this.status; + } + + /** + * Set the status property: Status of the operation. + * + * @param status the status value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStatus(AsyncOperationStatus status) { + this.status = status; + return this; + } + + /** + * Get the startTime property: Start Time when the operation was initially executed. + * + * @return the startTime value. + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the startTime property: Start Time when the operation was initially executed. + * + * @param startTime the startTime value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the error property: An error from the Azure Bare Metal Infrastructure service. + * + * @return the error value. + */ + public OperationStatusError error() { + return this.error; + } + + /** + * Set the error property: An error from the Azure Bare Metal Infrastructure service. + * + * @param error the error value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withError(OperationStatusError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (error() != null) { + error().validate(); + } + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/package-info.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/package-info.java index 5557ef276a7c..01de396af20e 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/package-info.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for BareMetalInfrastructureClient. The BareMetalInfrastructure Management + * Package containing the inner data models for BareMetalInfrastructureClient. The Bare Metal Infrastructure Management * client. */ package com.azure.resourcemanager.baremetalinfrastructure.fluent.models; diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/package-info.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/package-info.java index e4a08b47d8b1..ef479b8430eb 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/package-info.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for BareMetalInfrastructureClient. The BareMetalInfrastructure Management + * Package containing the service clients for BareMetalInfrastructureClient. The Bare Metal Infrastructure Management * client. */ package com.azure.resourcemanager.baremetalinfrastructure.fluent; diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java index 16dc32c07b17..21df0c4affff 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java @@ -13,6 +13,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; 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; @@ -25,12 +26,19 @@ 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.baremetalinfrastructure.fluent.AzureBareMetalInstancesClient; import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalInstanceInner; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationStatusInner; import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstancesListResult; +import com.azure.resourcemanager.baremetalinfrastructure.models.ForceState; import com.azure.resourcemanager.baremetalinfrastructure.models.Tags; +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 AzureBareMetalInstancesClient. */ @@ -60,6 +68,49 @@ public final class AzureBareMetalInstancesClientImpl implements AzureBareMetalIn @Host("{$host}") @ServiceInterface(name = "BareMetalInfrastruct") public interface AzureBareMetalInstancesService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/start") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureBareMetalInstanceName") String azureBareMetalInstanceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/restart") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureBareMetalInstanceName") String azureBareMetalInstanceName, + @BodyParam("application/json") ForceState forceParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}/shutdown") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> shutdown( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureBareMetalInstanceName") String azureBareMetalInstanceName, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances") @ExpectedResponses({200}) @@ -73,8 +124,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.BareMetalInfrastructure/bareMetalInstances") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroup( @@ -87,8 +137,7 @@ Mono> listByResourceGroup( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup( @@ -102,8 +151,7 @@ Mono> getByResourceGroup( @Headers({"Content-Type: application/json"}) @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}") + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -138,14 +186,921 @@ Mono> listByResourceGroupNext( } /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String azureBareMetalInstanceName) { + 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 (azureBareMetalInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync( + String resourceGroupName, String azureBareMetalInstanceName, 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 (azureBareMetalInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .start( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalInstanceName, + accept, + context); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginStartAsync( + String resourceGroupName, String azureBareMetalInstanceName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, azureBareMetalInstanceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + this.client.getContext()); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginStartAsync( + String resourceGroupName, String azureBareMetalInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + startWithResponseAsync(resourceGroupName, azureBareMetalInstanceName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> beginStart( + String resourceGroupName, String azureBareMetalInstanceName) { + return this.beginStartAsync(resourceGroupName, azureBareMetalInstanceName).getSyncPoller(); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> beginStart( + String resourceGroupName, String azureBareMetalInstanceName, Context context) { + return this.beginStartAsync(resourceGroupName, azureBareMetalInstanceName, context).getSyncPoller(); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String azureBareMetalInstanceName) { + return beginStartAsync(resourceGroupName, azureBareMetalInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync( + String resourceGroupName, String azureBareMetalInstanceName, Context context) { + return beginStartAsync(resourceGroupName, azureBareMetalInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner start(String resourceGroupName, String azureBareMetalInstanceName) { + return startAsync(resourceGroupName, azureBareMetalInstanceName).block(); + } + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner start(String resourceGroupName, String azureBareMetalInstanceName, Context context) { + return startAsync(resourceGroupName, azureBareMetalInstanceName, context).block(); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 OperationStatus object returns the state of an asynchronous operation along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter) { + 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 (azureBareMetalInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalInstanceName is required and cannot be null.")); + } + if (forceParameter != null) { + forceParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalInstanceName, + forceParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 OperationStatus object returns the state of an asynchronous operation along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, 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 (azureBareMetalInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalInstanceName is required and cannot be null.")); + } + if (forceParameter != null) { + forceParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalInstanceName, + forceParameter, + accept, + context); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginRestartAsync( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter) { + Mono>> mono = + restartWithResponseAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + this.client.getContext()); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginRestartAsync( + String resourceGroupName, String azureBareMetalInstanceName) { + final ForceState forceParameter = null; + Mono>> mono = + restartWithResponseAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + this.client.getContext()); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginRestartAsync( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + restartWithResponseAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> beginRestart( + String resourceGroupName, String azureBareMetalInstanceName) { + final ForceState forceParameter = null; + return this.beginRestartAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter).getSyncPoller(); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> beginRestart( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, Context context) { + return this + .beginRestartAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter, context) + .getSyncPoller(); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 OperationStatus object returns the state of an asynchronous operation on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter) { + return beginRestartAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String azureBareMetalInstanceName) { + final ForceState forceParameter = null; + return beginRestartAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 OperationStatus object returns the state of an asynchronous operation on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, Context context) { + return beginRestartAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner restart(String resourceGroupName, String azureBareMetalInstanceName) { + final ForceState forceParameter = null; + return restartAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter).block(); + } + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner restart( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, Context context) { + return restartAsync(resourceGroupName, azureBareMetalInstanceName, forceParameter, context).block(); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> shutdownWithResponseAsync( + String resourceGroupName, String azureBareMetalInstanceName) { + 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 (azureBareMetalInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .shutdown( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> shutdownWithResponseAsync( + String resourceGroupName, String azureBareMetalInstanceName, 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 (azureBareMetalInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .shutdown( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalInstanceName, + accept, + context); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginShutdownAsync( + String resourceGroupName, String azureBareMetalInstanceName) { + Mono>> mono = + shutdownWithResponseAsync(resourceGroupName, azureBareMetalInstanceName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + this.client.getContext()); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginShutdownAsync( + String resourceGroupName, String azureBareMetalInstanceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + shutdownWithResponseAsync(resourceGroupName, azureBareMetalInstanceName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> beginShutdown( + String resourceGroupName, String azureBareMetalInstanceName) { + return this.beginShutdownAsync(resourceGroupName, azureBareMetalInstanceName).getSyncPoller(); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 the OperationStatus object returns the state of an asynchronous + * operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> beginShutdown( + String resourceGroupName, String azureBareMetalInstanceName, Context context) { + return this.beginShutdownAsync(resourceGroupName, azureBareMetalInstanceName, context).getSyncPoller(); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono shutdownAsync(String resourceGroupName, String azureBareMetalInstanceName) { + return beginShutdownAsync(resourceGroupName, azureBareMetalInstanceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono shutdownAsync( + String resourceGroupName, String azureBareMetalInstanceName, Context context) { + return beginShutdownAsync(resourceGroupName, azureBareMetalInstanceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner shutdown(String resourceGroupName, String azureBareMetalInstanceName) { + return shutdownAsync(resourceGroupName, azureBareMetalInstanceName).block(); + } + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner shutdown(String resourceGroupName, String azureBareMetalInstanceName, Context context) { + return shutdownAsync(resourceGroupName, azureBareMetalInstanceName, context).block(); + } + + /** + * Returns a list of Azure Bare Metal Instances in the specified subscription. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @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 list of AzureBareMetal instances in the specified subscription along with {@link PagedResponse} on + * @return the response from the List Azure Bare Metal Instances operation along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -186,16 +1141,16 @@ private Mono> listSinglePageAsync() { } /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Returns a list of Azure Bare Metal Instances in the specified subscription. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @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 list of AzureBareMetal instances in the specified subscription along with {@link PagedResponse} on + * @return the response from the List Azure Bare Metal Instances operation along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -233,14 +1188,14 @@ private Mono> listSinglePageAsync(Con } /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Returns a list of Azure Bare Metal Instances in the specified subscription. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @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 list of AzureBareMetal instances in the specified subscription as paginated response with {@link + * @return the response from the List Azure Bare Metal Instances operation as paginated response with {@link * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -250,16 +1205,16 @@ private PagedFlux listAsync() { } /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Returns a list of Azure Bare Metal Instances in the specified subscription. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @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 list of AzureBareMetal instances in the specified subscription as paginated response with {@link + * @return the response from the List Azure Bare Metal Instances operation as paginated response with {@link * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -269,14 +1224,14 @@ private PagedFlux listAsync(Context context) { } /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Returns a list of Azure Bare Metal Instances in the specified subscription. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @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 list of AzureBareMetal instances in the specified subscription as paginated response with {@link + * @return the response from the List Azure Bare Metal Instances operation as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -285,16 +1240,16 @@ public PagedIterable list() { } /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Returns a list of Azure Bare Metal Instances in the specified subscription. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @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 list of AzureBareMetal instances in the specified subscription as paginated response with {@link + * @return the response from the List Azure Bare Metal Instances operation as paginated response with {@link * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -303,16 +1258,16 @@ public PagedIterable list(Context context) { } /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group along with {@link + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group along with {@link * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -359,17 +1314,17 @@ private Mono> listByResourceGroupSing } /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group along with {@link + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group along with {@link * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -413,17 +1368,17 @@ private Mono> listByResourceGroupSing } /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response - * with {@link PagedFlux}. + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -433,18 +1388,18 @@ private PagedFlux listByResourceGroupAsync(String r } /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response - * with {@link PagedFlux}. + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -454,17 +1409,17 @@ private PagedFlux listByResourceGroupAsync(String r } /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response - * with {@link PagedIterable}. + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -472,18 +1427,18 @@ public PagedIterable listByResourceGroup(String res } /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response - * with {@link PagedIterable}. + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -491,16 +1446,16 @@ public PagedIterable listByResourceGroup(String res } /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name along with + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name along with * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -545,17 +1500,17 @@ private Mono> getByResourceGroupWithRespon } /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name along with + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name along with * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -597,16 +1552,16 @@ private Mono> getByResourceGroupWithRespon } /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name on + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -617,17 +1572,17 @@ private Mono getByResourceGroupAsync( } /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name along with + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name along with * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -637,16 +1592,16 @@ public Response getByResourceGroupWithResponse( } /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name. + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. */ @ServiceMethod(returns = ReturnType.SINGLE) public AzureBareMetalInstanceInner getByResourceGroup(String resourceGroupName, String azureBareMetalInstanceName) { @@ -654,13 +1609,13 @@ public AzureBareMetalInstanceInner getByResourceGroup(String resourceGroupName, } /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -716,13 +1671,13 @@ private Mono> updateWithResponseAsync( } /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -776,13 +1731,13 @@ private Mono> updateWithResponseAsync( } /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -798,13 +1753,13 @@ private Mono updateAsync( } /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -820,13 +1775,13 @@ public Response updateWithResponse( } /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -848,7 +1803,7 @@ public AzureBareMetalInstanceInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List AzureBareMetal Instances operation along with {@link PagedResponse} on + * @return the response from the List Azure Bare Metal Instances operation along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -887,7 +1842,7 @@ private Mono> listBySubscriptionNextS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List AzureBareMetal Instances operation along with {@link PagedResponse} on + * @return the response from the List Azure Bare Metal Instances operation along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -925,7 +1880,7 @@ private Mono> listBySubscriptionNextS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List AzureBareMetal Instances operation along with {@link PagedResponse} on + * @return the response from the List Azure Bare Metal Instances operation along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -964,7 +1919,7 @@ private Mono> listByResourceGroupNext * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List AzureBareMetal Instances operation along with {@link PagedResponse} on + * @return the response from the List Azure Bare Metal Instances operation along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesImpl.java index 0de2e3f6f7a4..b55bee404522 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesImpl.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesImpl.java @@ -11,8 +11,11 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.baremetalinfrastructure.fluent.AzureBareMetalInstancesClient; import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalInstanceInner; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationStatusInner; import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstance; import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstances; +import com.azure.resourcemanager.baremetalinfrastructure.models.ForceState; +import com.azure.resourcemanager.baremetalinfrastructure.models.OperationStatus; import com.azure.resourcemanager.baremetalinfrastructure.models.Tags; public final class AzureBareMetalInstancesImpl implements AzureBareMetalInstances { @@ -29,6 +32,63 @@ public AzureBareMetalInstancesImpl( this.serviceManager = serviceManager; } + public OperationStatus start(String resourceGroupName, String azureBareMetalInstanceName) { + OperationStatusInner inner = this.serviceClient().start(resourceGroupName, azureBareMetalInstanceName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus start(String resourceGroupName, String azureBareMetalInstanceName, Context context) { + OperationStatusInner inner = this.serviceClient().start(resourceGroupName, azureBareMetalInstanceName, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus restart(String resourceGroupName, String azureBareMetalInstanceName) { + OperationStatusInner inner = this.serviceClient().restart(resourceGroupName, azureBareMetalInstanceName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus restart( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, Context context) { + OperationStatusInner inner = + this.serviceClient().restart(resourceGroupName, azureBareMetalInstanceName, forceParameter, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus shutdown(String resourceGroupName, String azureBareMetalInstanceName) { + OperationStatusInner inner = this.serviceClient().shutdown(resourceGroupName, azureBareMetalInstanceName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus shutdown(String resourceGroupName, String azureBareMetalInstanceName, Context context) { + OperationStatusInner inner = + this.serviceClient().shutdown(resourceGroupName, azureBareMetalInstanceName, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); return Utils.mapPage(inner, inner1 -> new AzureBareMetalInstanceImpl(inner1, this.manager())); diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstanceImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstanceImpl.java new file mode 100644 index 000000000000..29503cde54bd --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstanceImpl.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalStorageInstanceInner; +import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstance; +import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProperties; +import com.azure.resourcemanager.baremetalinfrastructure.models.Tags; +import java.util.Collections; +import java.util.Map; + +public final class AzureBareMetalStorageInstanceImpl + implements AzureBareMetalStorageInstance, + AzureBareMetalStorageInstance.Definition, + AzureBareMetalStorageInstance.Update { + private AzureBareMetalStorageInstanceInner innerObject; + + private final com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String azureBareMetalStorageInstanceUniqueIdentifier() { + return this.innerModel().azureBareMetalStorageInstanceUniqueIdentifier(); + } + + public StorageProperties storageProperties() { + return this.innerModel().storageProperties(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AzureBareMetalStorageInstanceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String azureBareMetalStorageInstanceName; + + private Tags updateTagsParameter; + + public AzureBareMetalStorageInstanceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public AzureBareMetalStorageInstance create() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureBareMetalStorageInstances() + .createWithResponse( + resourceGroupName, azureBareMetalStorageInstanceName, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public AzureBareMetalStorageInstance create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureBareMetalStorageInstances() + .createWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, this.innerModel(), context) + .getValue(); + return this; + } + + AzureBareMetalStorageInstanceImpl( + String name, com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager serviceManager) { + this.innerObject = new AzureBareMetalStorageInstanceInner(); + this.serviceManager = serviceManager; + this.azureBareMetalStorageInstanceName = name; + } + + public AzureBareMetalStorageInstanceImpl update() { + this.updateTagsParameter = new Tags(); + return this; + } + + public AzureBareMetalStorageInstance apply() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureBareMetalStorageInstances() + .updateWithResponse( + resourceGroupName, azureBareMetalStorageInstanceName, updateTagsParameter, Context.NONE) + .getValue(); + return this; + } + + public AzureBareMetalStorageInstance apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureBareMetalStorageInstances() + .updateWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, updateTagsParameter, context) + .getValue(); + return this; + } + + AzureBareMetalStorageInstanceImpl( + AzureBareMetalStorageInstanceInner innerObject, + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.azureBareMetalStorageInstanceName = + Utils.getValueFromIdByName(innerObject.id(), "bareMetalStorageInstances"); + } + + public AzureBareMetalStorageInstance refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getAzureBareMetalStorageInstances() + .getByResourceGroupWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, Context.NONE) + .getValue(); + return this; + } + + public AzureBareMetalStorageInstance refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getAzureBareMetalStorageInstances() + .getByResourceGroupWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, context) + .getValue(); + return this; + } + + public AzureBareMetalStorageInstanceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public AzureBareMetalStorageInstanceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public AzureBareMetalStorageInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateTagsParameter.withTags(tags); + return this; + } + } + + public AzureBareMetalStorageInstanceImpl withAzureBareMetalStorageInstanceUniqueIdentifier( + String azureBareMetalStorageInstanceUniqueIdentifier) { + this + .innerModel() + .withAzureBareMetalStorageInstanceUniqueIdentifier(azureBareMetalStorageInstanceUniqueIdentifier); + return this; + } + + public AzureBareMetalStorageInstanceImpl withStorageProperties(StorageProperties storageProperties) { + this.innerModel().withStorageProperties(storageProperties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstancesClientImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstancesClientImpl.java new file mode 100644 index 000000000000..124151b4bac3 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstancesClientImpl.java @@ -0,0 +1,1391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.AzureBareMetalStorageInstancesClient; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalStorageInstanceInner; +import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstancesListResult; +import com.azure.resourcemanager.baremetalinfrastructure.models.Tags; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in AzureBareMetalStorageInstancesClient. */ +public final class AzureBareMetalStorageInstancesClientImpl implements AzureBareMetalStorageInstancesClient { + /** The proxy service used to perform REST calls. */ + private final AzureBareMetalStorageInstancesService service; + + /** The service client containing this operation class. */ + private final BareMetalInfrastructureClientImpl client; + + /** + * Initializes an instance of AzureBareMetalStorageInstancesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AzureBareMetalStorageInstancesClientImpl(BareMetalInfrastructureClientImpl client) { + this.service = + RestProxy + .create( + AzureBareMetalStorageInstancesService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for BareMetalInfrastructureClientAzureBareMetalStorageInstances to be + * used by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "BareMetalInfrastruct") + public interface AzureBareMetalStorageInstancesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances/{azureBareMetalStorageInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureBareMetalStorageInstanceName") String azureBareMetalStorageInstanceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances/{azureBareMetalStorageInstanceName}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureBareMetalStorageInstanceName") String azureBareMetalStorageInstanceName, + @BodyParam("application/json") AzureBareMetalStorageInstanceInner requestBodyParameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances/{azureBareMetalStorageInstanceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureBareMetalStorageInstanceName") String azureBareMetalStorageInstanceName, + @BodyParam("application/json") Tags tagsParameter, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalStorageInstances/{azureBareMetalStorageInstanceName}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("azureBareMetalStorageInstanceName") String azureBareMetalStorageInstanceName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @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 list of AzureBareMetalStorage instances in the specified subscription along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @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 list of AzureBareMetalStorage instances in the specified subscription along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @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 list of AzureBareMetalStorage instances in the specified subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @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 list of AzureBareMetalStorage instances in the specified subscription as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @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 list of AzureBareMetalStorage instances in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @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 list of AzureBareMetalStorage instances in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync( + String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup( + String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String azureBareMetalStorageInstanceName) { + 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 (azureBareMetalStorageInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalStorageInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalStorageInstanceName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String azureBareMetalStorageInstanceName, 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 (azureBareMetalStorageInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalStorageInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalStorageInstanceName, + accept, + context); + } + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync( + String resourceGroupName, String azureBareMetalStorageInstanceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureBareMetalStorageInstanceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, azureBareMetalStorageInstanceName, context) + .block(); + } + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureBareMetalStorageInstanceInner getByResourceGroup( + String resourceGroupName, String azureBareMetalStorageInstanceName) { + return getByResourceGroupWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, Context.NONE) + .getValue(); + } + + /** + * Create an azure bare metal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param requestBodyParameters request body for put call. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String azureBareMetalStorageInstanceName, + AzureBareMetalStorageInstanceInner requestBodyParameters) { + 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 (azureBareMetalStorageInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalStorageInstanceName is required and cannot be null.")); + } + if (requestBodyParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter requestBodyParameters is required and cannot be null.")); + } else { + requestBodyParameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalStorageInstanceName, + requestBodyParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an azure bare metal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param requestBodyParameters request body for put call. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync( + String resourceGroupName, + String azureBareMetalStorageInstanceName, + AzureBareMetalStorageInstanceInner requestBodyParameters, + 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 (azureBareMetalStorageInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalStorageInstanceName is required and cannot be null.")); + } + if (requestBodyParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter requestBodyParameters is required and cannot be null.")); + } else { + requestBodyParameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .create( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalStorageInstanceName, + requestBodyParameters, + accept, + context); + } + + /** + * Create an azure bare metal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param requestBodyParameters request body for put call. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync( + String resourceGroupName, + String azureBareMetalStorageInstanceName, + AzureBareMetalStorageInstanceInner requestBodyParameters) { + return createWithResponseAsync(resourceGroupName, azureBareMetalStorageInstanceName, requestBodyParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create an azure bare metal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param requestBodyParameters request body for put call. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse( + String resourceGroupName, + String azureBareMetalStorageInstanceName, + AzureBareMetalStorageInstanceInner requestBodyParameters, + Context context) { + return createWithResponseAsync( + resourceGroupName, azureBareMetalStorageInstanceName, requestBodyParameters, context) + .block(); + } + + /** + * Create an azure bare metal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param requestBodyParameters request body for put call. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureBareMetalStorageInstanceInner create( + String resourceGroupName, + String azureBareMetalStorageInstanceName, + AzureBareMetalStorageInstanceInner requestBodyParameters) { + return createWithResponse( + resourceGroupName, azureBareMetalStorageInstanceName, requestBodyParameters, Context.NONE) + .getValue(); + } + + /** + * Patches the Tags field of a Azure Bare Metal Storage instance. + * + *

Patches the Tags field of a Azure Bare Metal Storage instance for the specified subscription, resource group, + * and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param tagsParameter Request body that only contains the new Tags field. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String azureBareMetalStorageInstanceName, Tags tagsParameter) { + 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 (azureBareMetalStorageInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalStorageInstanceName is required and cannot be null.")); + } + if (tagsParameter == null) { + return Mono.error(new IllegalArgumentException("Parameter tagsParameter is required and cannot be null.")); + } else { + tagsParameter.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalStorageInstanceName, + tagsParameter, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches the Tags field of a Azure Bare Metal Storage instance. + * + *

Patches the Tags field of a Azure Bare Metal Storage instance for the specified subscription, resource group, + * and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param tagsParameter Request body that only contains the new Tags field. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String azureBareMetalStorageInstanceName, Tags tagsParameter, 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 (azureBareMetalStorageInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalStorageInstanceName is required and cannot be null.")); + } + if (tagsParameter == null) { + return Mono.error(new IllegalArgumentException("Parameter tagsParameter is required and cannot be null.")); + } else { + tagsParameter.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalStorageInstanceName, + tagsParameter, + accept, + context); + } + + /** + * Patches the Tags field of a Azure Bare Metal Storage instance. + * + *

Patches the Tags field of a Azure Bare Metal Storage instance for the specified subscription, resource group, + * and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param tagsParameter Request body that only contains the new Tags field. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String azureBareMetalStorageInstanceName, Tags tagsParameter) { + return updateWithResponseAsync(resourceGroupName, azureBareMetalStorageInstanceName, tagsParameter) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Patches the Tags field of a Azure Bare Metal Storage instance. + * + *

Patches the Tags field of a Azure Bare Metal Storage instance for the specified subscription, resource group, + * and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param tagsParameter Request body that only contains the new Tags field. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties) along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Tags tagsParameter, Context context) { + return updateWithResponseAsync(resourceGroupName, azureBareMetalStorageInstanceName, tagsParameter, context) + .block(); + } + + /** + * Patches the Tags field of a Azure Bare Metal Storage instance. + * + *

Patches the Tags field of a Azure Bare Metal Storage instance for the specified subscription, resource group, + * and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param tagsParameter Request body that only contains the new Tags field. + * @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 azureBareMetalStorageInstance info on Azure (ARM properties and AzureBareMetalStorage properties). + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AzureBareMetalStorageInstanceInner update( + String resourceGroupName, String azureBareMetalStorageInstanceName, Tags tagsParameter) { + return updateWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, tagsParameter, Context.NONE) + .getValue(); + } + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String azureBareMetalStorageInstanceName) { + 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 (azureBareMetalStorageInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalStorageInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalStorageInstanceName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync( + String resourceGroupName, String azureBareMetalStorageInstanceName, 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 (azureBareMetalStorageInstanceName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter azureBareMetalStorageInstanceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + azureBareMetalStorageInstanceName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String azureBareMetalStorageInstanceName) { + return deleteWithResponseAsync(resourceGroupName, azureBareMetalStorageInstanceName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Context context) { + return deleteWithResponseAsync(resourceGroupName, azureBareMetalStorageInstanceName, context).block(); + } + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String azureBareMetalStorageInstanceName) { + deleteWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, Context.NONE); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the Get AzureBareMetalStorageInstances operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the Get AzureBareMetalStorageInstances operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the Get AzureBareMetalStorageInstances operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the Get AzureBareMetalStorageInstances operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstancesImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstancesImpl.java new file mode 100644 index 000000000000..5498e6e87857 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstancesImpl.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.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.baremetalinfrastructure.fluent.AzureBareMetalStorageInstancesClient; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalStorageInstanceInner; +import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstance; +import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstances; + +public final class AzureBareMetalStorageInstancesImpl implements AzureBareMetalStorageInstances { + private static final ClientLogger LOGGER = new ClientLogger(AzureBareMetalStorageInstancesImpl.class); + + private final AzureBareMetalStorageInstancesClient innerClient; + + private final com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager serviceManager; + + public AzureBareMetalStorageInstancesImpl( + AzureBareMetalStorageInstancesClient innerClient, + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new AzureBareMetalStorageInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new AzureBareMetalStorageInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new AzureBareMetalStorageInstanceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new AzureBareMetalStorageInstanceImpl(inner1, this.manager())); + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Context context) { + Response inner = + this + .serviceClient() + .getByResourceGroupWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new AzureBareMetalStorageInstanceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AzureBareMetalStorageInstance getByResourceGroup( + String resourceGroupName, String azureBareMetalStorageInstanceName) { + AzureBareMetalStorageInstanceInner inner = + this.serviceClient().getByResourceGroup(resourceGroupName, azureBareMetalStorageInstanceName); + if (inner != null) { + return new AzureBareMetalStorageInstanceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String azureBareMetalStorageInstanceName) { + this.serviceClient().delete(resourceGroupName, azureBareMetalStorageInstanceName); + } + + public AzureBareMetalStorageInstance getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureBareMetalStorageInstanceName = Utils.getValueFromIdByName(id, "bareMetalStorageInstances"); + if (azureBareMetalStorageInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalStorageInstances'.", + id))); + } + return this + .getByResourceGroupWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureBareMetalStorageInstanceName = Utils.getValueFromIdByName(id, "bareMetalStorageInstances"); + if (azureBareMetalStorageInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalStorageInstances'.", + id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureBareMetalStorageInstanceName = Utils.getValueFromIdByName(id, "bareMetalStorageInstances"); + if (azureBareMetalStorageInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalStorageInstances'.", + id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String azureBareMetalStorageInstanceName = Utils.getValueFromIdByName(id, "bareMetalStorageInstances"); + if (azureBareMetalStorageInstanceName == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'bareMetalStorageInstances'.", + id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, azureBareMetalStorageInstanceName, context); + } + + private AzureBareMetalStorageInstancesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager() { + return this.serviceManager; + } + + public AzureBareMetalStorageInstanceImpl define(String name) { + return new AzureBareMetalStorageInstanceImpl(name, this.manager()); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientBuilder.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientBuilder.java index 3b4067d0a7d1..34241218ab52 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientBuilder.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientBuilder.java @@ -18,12 +18,12 @@ @ServiceClientBuilder(serviceClients = {BareMetalInfrastructureClientImpl.class}) public final class BareMetalInfrastructureClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. + * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. * @return the BareMetalInfrastructureClientBuilder. @@ -137,7 +137,7 @@ public BareMetalInfrastructureClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java index 412990fb034e..021df8d9d559 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java @@ -23,6 +23,7 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.baremetalinfrastructure.fluent.AzureBareMetalInstancesClient; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.AzureBareMetalStorageInstancesClient; import com.azure.resourcemanager.baremetalinfrastructure.fluent.BareMetalInfrastructureClient; import com.azure.resourcemanager.baremetalinfrastructure.fluent.OperationsClient; import java.io.IOException; @@ -37,11 +38,11 @@ /** Initializes a new instance of the BareMetalInfrastructureClientImpl type. */ @ServiceClient(builder = BareMetalInfrastructureClientBuilder.class) public final class BareMetalInfrastructureClientImpl implements BareMetalInfrastructureClient { - /** The ID of the target subscription. */ + /** The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -133,6 +134,18 @@ public OperationsClient getOperations() { return this.operations; } + /** The AzureBareMetalStorageInstancesClient object to access its operations. */ + private final AzureBareMetalStorageInstancesClient azureBareMetalStorageInstances; + + /** + * Gets the AzureBareMetalStorageInstancesClient object to access its operations. + * + * @return the AzureBareMetalStorageInstancesClient object. + */ + public AzureBareMetalStorageInstancesClient getAzureBareMetalStorageInstances() { + return this.azureBareMetalStorageInstances; + } + /** * Initializes an instance of BareMetalInfrastructureClient client. * @@ -140,7 +153,7 @@ public OperationsClient getOperations() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ BareMetalInfrastructureClientImpl( @@ -155,9 +168,10 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-08-09"; + this.apiVersion = "2023-08-04-preview"; this.azureBareMetalInstances = new AzureBareMetalInstancesClientImpl(this); this.operations = new OperationsClientImpl(this); + this.azureBareMetalStorageInstances = new AzureBareMetalStorageInstancesClientImpl(this); } /** diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationImpl.java index 5ee62d637803..b08e3ffb42fd 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationImpl.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationImpl.java @@ -5,8 +5,10 @@ package com.azure.resourcemanager.baremetalinfrastructure.implementation; import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationInner; -import com.azure.resourcemanager.baremetalinfrastructure.models.Display; +import com.azure.resourcemanager.baremetalinfrastructure.models.ActionType; import com.azure.resourcemanager.baremetalinfrastructure.models.Operation; +import com.azure.resourcemanager.baremetalinfrastructure.models.OperationDisplay; +import com.azure.resourcemanager.baremetalinfrastructure.models.Origin; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -24,12 +26,20 @@ public String name() { return this.innerModel().name(); } - public Display display() { + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { return this.innerModel().display(); } - public Boolean isDataAction() { - return this.innerModel().isDataAction(); + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); } public OperationInner innerModel() { diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationStatusImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationStatusImpl.java new file mode 100644 index 000000000000..ef4a3ce7c619 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationStatusImpl.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.baremetalinfrastructure.implementation; + +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.baremetalinfrastructure.models.AsyncOperationStatus; +import com.azure.resourcemanager.baremetalinfrastructure.models.OperationStatus; +import com.azure.resourcemanager.baremetalinfrastructure.models.OperationStatusError; + +public final class OperationStatusImpl implements OperationStatus { + private OperationStatusInner innerObject; + + private final com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager serviceManager; + + OperationStatusImpl( + OperationStatusInner innerObject, + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public AsyncOperationStatus status() { + return this.innerModel().status(); + } + + public String startTime() { + return this.innerModel().startTime(); + } + + public OperationStatusError error() { + return this.innerModel().error(); + } + + public OperationStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationsClientImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationsClientImpl.java index d297d03dbef2..d510cd84bc09 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationsClientImpl.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/OperationsClientImpl.java @@ -26,7 +26,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.baremetalinfrastructure.fluent.OperationsClient; import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationInner; -import com.azure.resourcemanager.baremetalinfrastructure.models.OperationList; +import com.azure.resourcemanager.baremetalinfrastructure.models.OperationListResult; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in OperationsClient. */ @@ -59,7 +59,7 @@ public interface OperationsService { @Get("/providers/Microsoft.BareMetalInfrastructure/operations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> list( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @@ -67,7 +67,9 @@ Mono> list( } /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -94,7 +96,9 @@ private Mono> listSinglePageAsync() { } /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -122,7 +126,9 @@ private Mono> listSinglePageAsync(Context context) } /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -134,7 +140,9 @@ private PagedFlux listAsync() { } /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -148,7 +156,9 @@ private PagedFlux listAsync(Context context) { } /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -160,7 +170,9 @@ public PagedIterable list() { } /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/package-info.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/package-info.java index a1ef9fc0432c..4ea7d153a2c2 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/package-info.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for BareMetalInfrastructureClient. The BareMetalInfrastructure Management + * Package containing the implementations for BareMetalInfrastructureClient. The Bare Metal Infrastructure Management * client. */ package com.azure.resourcemanager.baremetalinfrastructure.implementation; diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ActionType.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ActionType.java new file mode 100644 index 000000000000..e9c62398e92d --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ActionType.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.baremetalinfrastructure.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +public final class ActionType extends ExpandableStringEnum { + /** Static value Internal for ActionType. */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + @JsonCreator + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AsyncOperationStatus.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AsyncOperationStatus.java new file mode 100644 index 000000000000..efef82f67ee1 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AsyncOperationStatus.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.baremetalinfrastructure.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Status of the operation. */ +public final class AsyncOperationStatus extends ExpandableStringEnum { + /** Static value Requesting for AsyncOperationStatus. */ + public static final AsyncOperationStatus REQUESTING = fromString("Requesting"); + + /** Static value Executing for AsyncOperationStatus. */ + public static final AsyncOperationStatus EXECUTING = fromString("Executing"); + + /** Static value Succeeded for AsyncOperationStatus. */ + public static final AsyncOperationStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for AsyncOperationStatus. */ + public static final AsyncOperationStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of AsyncOperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AsyncOperationStatus() { + } + + /** + * Creates or finds a AsyncOperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding AsyncOperationStatus. + */ + @JsonCreator + public static AsyncOperationStatus fromString(String name) { + return fromString(name, AsyncOperationStatus.class); + } + + /** + * Gets known AsyncOperationStatus values. + * + * @return known AsyncOperationStatus values. + */ + public static Collection values() { + return values(AsyncOperationStatus.class); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalHardwareTypeNamesEnum.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalHardwareTypeNamesEnum.java index feb6b3a75ced..0ffd83eb7d46 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalHardwareTypeNamesEnum.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalHardwareTypeNamesEnum.java @@ -17,6 +17,9 @@ public final class AzureBareMetalHardwareTypeNamesEnum /** Static value HPE for AzureBareMetalHardwareTypeNamesEnum. */ public static final AzureBareMetalHardwareTypeNamesEnum HPE = fromString("HPE"); + /** Static value SDFLEX for AzureBareMetalHardwareTypeNamesEnum. */ + public static final AzureBareMetalHardwareTypeNamesEnum SDFLEX = fromString("SDFLEX"); + /** * Creates a new instance of AzureBareMetalHardwareTypeNamesEnum value. * diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstance.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstance.java index 80f78bb89aa3..2dabd46c813e 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstance.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstance.java @@ -46,42 +46,42 @@ public interface AzureBareMetalInstance { Map tags(); /** - * Gets the systemData property: The system metadata 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 hardwareProfile property: Specifies the hardware settings for the AzureBareMetal instance. + * Gets the hardwareProfile property: Specifies the hardware settings for the Azure Bare Metal Instance. * * @return the hardwareProfile value. */ HardwareProfile hardwareProfile(); /** - * Gets the storageProfile property: Specifies the storage settings for the AzureBareMetal instance disks. + * Gets the storageProfile property: Specifies the storage settings for the Azure Bare Metal Instance disks. * * @return the storageProfile value. */ StorageProfile storageProfile(); /** - * Gets the osProfile property: Specifies the operating system settings for the AzureBareMetal instance. + * Gets the osProfile property: Specifies the operating system settings for the Azure Bare Metal Instance. * * @return the osProfile value. */ OSProfile osProfile(); /** - * Gets the networkProfile property: Specifies the network settings for the AzureBareMetal instance. + * Gets the networkProfile property: Specifies the network settings for the Azure Bare Metal Instance. * * @return the networkProfile value. */ NetworkProfile networkProfile(); /** - * Gets the azureBareMetalInstanceId property: Specifies the AzureBareMetal instance unique ID. + * Gets the azureBareMetalInstanceId property: Specifies the Azure Bare Metal Instance unique ID. * * @return the azureBareMetalInstanceId value. */ @@ -102,7 +102,7 @@ public interface AzureBareMetalInstance { String proximityPlacementGroup(); /** - * Gets the hwRevision property: Hardware revision of an AzureBareMetal instance. + * Gets the hwRevision property: Hardware revision of an Azure Bare Metal Instance. * * @return the hwRevision value. */ diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstanceForcePowerState.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstanceForcePowerState.java new file mode 100644 index 000000000000..74ee8491d9b8 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstanceForcePowerState.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.baremetalinfrastructure.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Whether to force restart by shutting all processes. */ +public final class AzureBareMetalInstanceForcePowerState + extends ExpandableStringEnum { + /** Static value active for AzureBareMetalInstanceForcePowerState. */ + public static final AzureBareMetalInstanceForcePowerState ACTIVE = fromString("active"); + + /** Static value inactive for AzureBareMetalInstanceForcePowerState. */ + public static final AzureBareMetalInstanceForcePowerState INACTIVE = fromString("inactive"); + + /** + * Creates a new instance of AzureBareMetalInstanceForcePowerState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AzureBareMetalInstanceForcePowerState() { + } + + /** + * Creates or finds a AzureBareMetalInstanceForcePowerState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureBareMetalInstanceForcePowerState. + */ + @JsonCreator + public static AzureBareMetalInstanceForcePowerState fromString(String name) { + return fromString(name, AzureBareMetalInstanceForcePowerState.class); + } + + /** + * Gets known AzureBareMetalInstanceForcePowerState values. + * + * @return known AzureBareMetalInstanceForcePowerState values. + */ + public static Collection values() { + return values(AzureBareMetalInstanceForcePowerState.class); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstanceSizeNamesEnum.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstanceSizeNamesEnum.java index 6ac8a4a156b3..2aa5d02c6732 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstanceSizeNamesEnum.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstanceSizeNamesEnum.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Specifies the AzureBareMetal instance SKU. */ +/** Specifies the Azure Bare Metal Instance SKU. */ public final class AzureBareMetalInstanceSizeNamesEnum extends ExpandableStringEnum { /** Static value S72m for AzureBareMetalInstanceSizeNamesEnum. */ @@ -86,6 +86,9 @@ public final class AzureBareMetalInstanceSizeNamesEnum /** Static value S448ooo for AzureBareMetalInstanceSizeNamesEnum. */ public static final AzureBareMetalInstanceSizeNamesEnum S448OOO = fromString("S448ooo"); + /** Static value S448se for AzureBareMetalInstanceSizeNamesEnum. */ + public static final AzureBareMetalInstanceSizeNamesEnum S448SE = fromString("S448se"); + /** Static value S576m for AzureBareMetalInstanceSizeNamesEnum. */ public static final AzureBareMetalInstanceSizeNamesEnum S576M = fromString("S576m"); diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstances.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstances.java index 5b3720866717..5d49864df7ab 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstances.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstances.java @@ -11,103 +11,193 @@ /** Resource collection API of AzureBareMetalInstances. */ public interface AzureBareMetalInstances { /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Start a Bare Metal Instance. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + OperationStatus start(String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Start a Bare Metal Instance. + * + *

The operation to start an Azure Bare Metal instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + OperationStatus start(String resourceGroupName, String azureBareMetalInstanceName, Context context); + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + OperationStatus restart(String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Restart a Bare Metal Instance. + * + *

The operation to restart an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @param forceParameter When set to 'active', this parameter empowers the server with the ability to forcefully + * terminate and halt any existing processes that may be running on the server. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + OperationStatus restart( + String resourceGroupName, String azureBareMetalInstanceName, ForceState forceParameter, Context context); + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + OperationStatus shutdown(String resourceGroupName, String azureBareMetalInstanceName); + + /** + * Shutdown a Bare Metal Instance. + * + *

The operation to shutdown an Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. + * @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 OperationStatus object returns the state of an asynchronous operation. + */ + OperationStatus shutdown(String resourceGroupName, String azureBareMetalInstanceName, Context context); + + /** + * Returns a list of Azure Bare Metal Instances in the specified subscription. + * + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link + * @return the response from the List Azure Bare Metal Instances operation as paginated response with {@link * PagedIterable}. */ PagedIterable list(); /** - * Gets a list of Azure BareMetal instances in the specified subscription. + * Returns a list of Azure Bare Metal Instances in the specified subscription. * - *

Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various - * properties of each Azure BareMetal instance. + *

Returns a list of Azure Bare Metal Instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription as paginated response with {@link + * @return the response from the List Azure Bare Metal Instances operation as paginated response with {@link * PagedIterable}. */ PagedIterable list(Context context); /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response - * with {@link PagedIterable}. + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets a list of Azure BareMetal instances in the specified subscription and resource group. + * Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. * - *

Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations - * returns various properties of each Azure BareMetal instance. + *

Gets a list of Azure Bare Metal Instances in the specified subscription and resource group. The operations + * returns various properties of each Azure Bare Metal Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of AzureBareMetal instances in the specified subscription and resource group as paginated response - * with {@link PagedIterable}. + * @return a list of Azure Bare Metal Instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name along with + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name along with * {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String azureBareMetalInstanceName, Context context); /** - * Gets an Azure BareMetal instance. + * Gets an Azure Bare Metal Instance. * - *

Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. + *

Gets an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @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 Azure BareMetal instance for the specified subscription, resource group, and instance name. + * @return an Azure Bare Metal Instance for the specified subscription, resource group, and instance name. */ AzureBareMetalInstance getByResourceGroup(String resourceGroupName, String azureBareMetalInstanceName); /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -120,13 +210,13 @@ Response updateWithResponse( String resourceGroupName, String azureBareMetalInstanceName, Tags tagsParameter, Context context); /** - * Patches the Tags field of a Azure BareMetal instance. + * Patches the Tags field of a Azure Bare Metal Instance. * - *

Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and + *

Patches the Tags field of a Azure Bare Metal Instance for the specified subscription, resource group, and * instance name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance. + * @param azureBareMetalInstanceName Name of the Azure Bare Metal Instance, also known as the ResourceName. * @param tagsParameter Request body that only contains the new Tags field. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstancesListResult.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstancesListResult.java index 5fb5d8367f76..3598e972ea54 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstancesListResult.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalInstancesListResult.java @@ -9,17 +9,17 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response from the List AzureBareMetal Instances operation. */ +/** The response from the List Azure Bare Metal Instances operation. */ @Fluent public final class AzureBareMetalInstancesListResult { /* - * The list of Azure BareMetal instances. + * The list of Azure Bare Metal Instances. */ @JsonProperty(value = "value") private List value; /* - * The URL to get the next set of AzureBareMetal instances. + * The URL to get the next set of Azure Bare Metal Instances. */ @JsonProperty(value = "nextLink") private String nextLink; @@ -29,7 +29,7 @@ public AzureBareMetalInstancesListResult() { } /** - * Get the value property: The list of Azure BareMetal instances. + * Get the value property: The list of Azure Bare Metal Instances. * * @return the value value. */ @@ -38,7 +38,7 @@ public List value() { } /** - * Set the value property: The list of Azure BareMetal instances. + * Set the value property: The list of Azure Bare Metal Instances. * * @param value the value value to set. * @return the AzureBareMetalInstancesListResult object itself. @@ -49,7 +49,7 @@ public AzureBareMetalInstancesListResult withValue(List tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the azureBareMetalStorageInstanceUniqueIdentifier property: Specifies the AzureBareMetaStorageInstance + * unique ID. + * + * @return the azureBareMetalStorageInstanceUniqueIdentifier value. + */ + String azureBareMetalStorageInstanceUniqueIdentifier(); + + /** + * Gets the storageProperties property: Specifies the storage properties for the AzureBareMetalStorage instance. + * + * @return the storageProperties value. + */ + StorageProperties storageProperties(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalStorageInstanceInner + * object. + * + * @return the inner object. + */ + AzureBareMetalStorageInstanceInner innerModel(); + + /** The entirety of the AzureBareMetalStorageInstance definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + + /** The AzureBareMetalStorageInstance definition stages. */ + interface DefinitionStages { + /** The first stage of the AzureBareMetalStorageInstance definition. */ + interface Blank extends WithLocation { + } + + /** The stage of the AzureBareMetalStorageInstance definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** The stage of the AzureBareMetalStorageInstance definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the AzureBareMetalStorageInstance 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.WithAzureBareMetalStorageInstanceUniqueIdentifier, + DefinitionStages.WithStorageProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + AzureBareMetalStorageInstance create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AzureBareMetalStorageInstance create(Context context); + } + + /** The stage of the AzureBareMetalStorageInstance definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the AzureBareMetalStorageInstance definition allowing to specify + * azureBareMetalStorageInstanceUniqueIdentifier. + */ + interface WithAzureBareMetalStorageInstanceUniqueIdentifier { + /** + * Specifies the azureBareMetalStorageInstanceUniqueIdentifier property: Specifies the + * AzureBareMetaStorageInstance unique ID.. + * + * @param azureBareMetalStorageInstanceUniqueIdentifier Specifies the AzureBareMetaStorageInstance unique + * ID. + * @return the next definition stage. + */ + WithCreate withAzureBareMetalStorageInstanceUniqueIdentifier( + String azureBareMetalStorageInstanceUniqueIdentifier); + } + + /** The stage of the AzureBareMetalStorageInstance definition allowing to specify storageProperties. */ + interface WithStorageProperties { + /** + * Specifies the storageProperties property: Specifies the storage properties for the AzureBareMetalStorage + * instance.. + * + * @param storageProperties Specifies the storage properties for the AzureBareMetalStorage instance. + * @return the next definition stage. + */ + WithCreate withStorageProperties(StorageProperties storageProperties); + } + } + + /** + * Begins update for the AzureBareMetalStorageInstance resource. + * + * @return the stage of resource update. + */ + AzureBareMetalStorageInstance.Update update(); + + /** The template for AzureBareMetalStorageInstance update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AzureBareMetalStorageInstance apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AzureBareMetalStorageInstance apply(Context context); + } + + /** The AzureBareMetalStorageInstance update stages. */ + interface UpdateStages { + /** The stage of the AzureBareMetalStorageInstance update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Tags field of the AzureBareMetal/AzureBareMetaStorage instance.. + * + * @param tags Tags field of the AzureBareMetal/AzureBareMetaStorage instance. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AzureBareMetalStorageInstance refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AzureBareMetalStorageInstance refresh(Context context); +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstances.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstances.java new file mode 100644 index 000000000000..394103e27d6c --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstances.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.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 AzureBareMetalStorageInstances. */ +public interface AzureBareMetalStorageInstances { + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure Bare Metal Instance. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription as paginated response with {@link + * PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Gets a list of Azure Bare Metal Storage instances in the specified subscription and resource group. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription and resource group. The + * operations returns various properties of each Azure Bare Metal Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of AzureBareMetalStorage instances in the specified subscription and resource group as paginated + * response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name + * along with {@link Response}. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Context context); + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @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 Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + */ + AzureBareMetalStorageInstance getByResourceGroup( + String resourceGroupName, String azureBareMetalStorageInstanceName); + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse( + String resourceGroupName, String azureBareMetalStorageInstanceName, Context context); + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the Azure Bare Metal Storage Instance, also known as the + * ResourceName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String azureBareMetalStorageInstanceName); + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name + * along with {@link Response}. + */ + AzureBareMetalStorageInstance getById(String id); + + /** + * Gets an Azure Bare Metal Storage instance. + * + *

Gets an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Azure Bare Metal Storage instance for the specified subscription, resource group, and instance name + * along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete an AzureBareMetalStorageInstance. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AzureBareMetalStorageInstance resource. + * + * @param name resource name. + * @return the first stage of the new AzureBareMetalStorageInstance definition. + */ + AzureBareMetalStorageInstance.DefinitionStages.Blank define(String name); +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstancesListResult.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstancesListResult.java new file mode 100644 index 000000000000..5ba9caec6394 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstancesListResult.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.baremetalinfrastructure.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalStorageInstanceInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The response from the Get AzureBareMetalStorageInstances operation. */ +@Fluent +public final class AzureBareMetalStorageInstancesListResult { + /* + * The list of AzureBareMetalStorage instances. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL to get the next set of AzureBareMetalStorage instances. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** Creates an instance of AzureBareMetalStorageInstancesListResult class. */ + public AzureBareMetalStorageInstancesListResult() { + } + + /** + * Get the value property: The list of AzureBareMetalStorage instances. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The list of AzureBareMetalStorage instances. + * + * @param value the value value to set. + * @return the AzureBareMetalStorageInstancesListResult object itself. + */ + public AzureBareMetalStorageInstancesListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL to get the next set of AzureBareMetalStorage instances. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL to get the next set of AzureBareMetalStorage instances. + * + * @param nextLink the nextLink value to set. + * @return the AzureBareMetalStorageInstancesListResult object itself. + */ + public AzureBareMetalStorageInstancesListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * 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/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Disk.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Disk.java index b53998f0c5cc..4c62935072f8 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Disk.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Disk.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Specifies the disk information fo the AzureBareMetal instance. */ +/** Specifies the disk information fo the Azure Bare Metal Instance. */ @Fluent public final class Disk { /* diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ForceState.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ForceState.java new file mode 100644 index 000000000000..65a1159a64bf --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ForceState.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.baremetalinfrastructure.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The active state empowers the server with the ability to forcefully terminate and halt any existing processes that + * may be running on the server. + */ +@Fluent +public final class ForceState { + /* + * Whether to force restart by shutting all processes. + */ + @JsonProperty(value = "forceState") + private AzureBareMetalInstanceForcePowerState forceState; + + /** Creates an instance of ForceState class. */ + public ForceState() { + } + + /** + * Get the forceState property: Whether to force restart by shutting all processes. + * + * @return the forceState value. + */ + public AzureBareMetalInstanceForcePowerState forceState() { + return this.forceState; + } + + /** + * Set the forceState property: Whether to force restart by shutting all processes. + * + * @param forceState the forceState value to set. + * @return the ForceState object itself. + */ + public ForceState withForceState(AzureBareMetalInstanceForcePowerState forceState) { + this.forceState = forceState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/HardwareProfile.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/HardwareProfile.java index 4f66138e4454..d7fa92af402b 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/HardwareProfile.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/HardwareProfile.java @@ -7,7 +7,7 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Specifies the hardware settings for the AzureBareMetal instance. */ +/** Specifies the hardware settings for the Azure Bare Metal Instance. */ @Immutable public final class HardwareProfile { /* @@ -17,7 +17,7 @@ public final class HardwareProfile { private AzureBareMetalHardwareTypeNamesEnum hardwareType; /* - * Specifies the AzureBareMetal instance SKU. + * Specifies the Azure Bare Metal Instance SKU. */ @JsonProperty(value = "azureBareMetalInstanceSize", access = JsonProperty.Access.WRITE_ONLY) private AzureBareMetalInstanceSizeNamesEnum azureBareMetalInstanceSize; @@ -36,7 +36,7 @@ public AzureBareMetalHardwareTypeNamesEnum hardwareType() { } /** - * Get the azureBareMetalInstanceSize property: Specifies the AzureBareMetal instance SKU. + * Get the azureBareMetalInstanceSize property: Specifies the Azure Bare Metal Instance SKU. * * @return the azureBareMetalInstanceSize value. */ diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/IpAddress.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/NetworkInterface.java similarity index 77% rename from sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/IpAddress.java rename to sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/NetworkInterface.java index f1cde16f2007..658d9b4df909 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/IpAddress.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/NetworkInterface.java @@ -7,17 +7,17 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Specifies the IP address of the network interface. */ +/** Specifies the network interfaces of a bare metal resource. */ @Fluent -public final class IpAddress { +public final class NetworkInterface { /* * Specifies the IP address of the network interface. */ @JsonProperty(value = "ipAddress") private String ipAddress; - /** Creates an instance of IpAddress class. */ - public IpAddress() { + /** Creates an instance of NetworkInterface class. */ + public NetworkInterface() { } /** @@ -33,9 +33,9 @@ public String ipAddress() { * Set the ipAddress property: Specifies the IP address of the network interface. * * @param ipAddress the ipAddress value to set. - * @return the IpAddress object itself. + * @return the NetworkInterface object itself. */ - public IpAddress withIpAddress(String ipAddress) { + public NetworkInterface withIpAddress(String ipAddress) { this.ipAddress = ipAddress; return this; } diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/NetworkProfile.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/NetworkProfile.java index 4bce8031f2a8..d414742abd9e 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/NetworkProfile.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/NetworkProfile.java @@ -8,14 +8,14 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Specifies the network settings for the AzureBareMetal instance disks. */ +/** Specifies the network settings for the Azure Bare Metal Instance disks. */ @Fluent public final class NetworkProfile { /* - * Specifies the network interfaces for the AzureBareMetal instance. + * Specifies the network interfaces for the Azure Bare Metal Instance. */ @JsonProperty(value = "networkInterfaces") - private List networkInterfaces; + private List networkInterfaces; /* * Specifies the circuit id for connecting to express route. @@ -28,21 +28,21 @@ public NetworkProfile() { } /** - * Get the networkInterfaces property: Specifies the network interfaces for the AzureBareMetal instance. + * Get the networkInterfaces property: Specifies the network interfaces for the Azure Bare Metal Instance. * * @return the networkInterfaces value. */ - public List networkInterfaces() { + public List networkInterfaces() { return this.networkInterfaces; } /** - * Set the networkInterfaces property: Specifies the network interfaces for the AzureBareMetal instance. + * Set the networkInterfaces property: Specifies the network interfaces for the Azure Bare Metal Instance. * * @param networkInterfaces the networkInterfaces value to set. * @return the NetworkProfile object itself. */ - public NetworkProfile withNetworkInterfaces(List networkInterfaces) { + public NetworkProfile withNetworkInterfaces(List networkInterfaces) { this.networkInterfaces = networkInterfaces; return this; } diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OSProfile.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OSProfile.java index 9bff1794508c..f155ceae2bfe 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OSProfile.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OSProfile.java @@ -7,11 +7,11 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Specifies the operating system settings for the AzureBareMetal instance. */ +/** Specifies the operating system settings for the Azure Bare Metal instance. */ @Fluent public final class OSProfile { /* - * Specifies the host OS name of the AzureBareMetal instance. + * Specifies the host OS name of the Azure Bare Metal instance. */ @JsonProperty(value = "computerName") private String computerName; @@ -39,7 +39,7 @@ public OSProfile() { } /** - * Get the computerName property: Specifies the host OS name of the AzureBareMetal instance. + * Get the computerName property: Specifies the host OS name of the Azure Bare Metal instance. * * @return the computerName value. */ @@ -48,7 +48,7 @@ public String computerName() { } /** - * Set the computerName property: Specifies the host OS name of the AzureBareMetal instance. + * Set the computerName property: Specifies the host OS name of the Azure Bare Metal instance. * * @param computerName the computerName value to set. * @return the OSProfile object itself. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Operation.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Operation.java index 01e50981ba70..b4de29ce7307 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Operation.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Operation.java @@ -9,26 +9,43 @@ /** An immutable client-side representation of Operation. */ public interface Operation { /** - * Gets the name property: The name of the operation being performed on this particular object. This name should - * match the action name that appears in RBAC / the event service. + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ String name(); /** - * Gets the display property: Displayed AzureBareMetal operation information. + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. * * @return the display value. */ - Display display(); + OperationDisplay display(); /** - * Gets the isDataAction property: indicates whether an operation is a data action or not. + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * - * @return the isDataAction value. + * @return the origin value. */ - Boolean isDataAction(); + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationInner object. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Display.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationDisplay.java similarity index 56% rename from sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Display.java rename to sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationDisplay.java index 6054d6d59e6f..c6afdab04d92 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Display.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationDisplay.java @@ -7,39 +7,43 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Detailed BareMetal operation information. */ +/** Localized display information for this particular operation. */ @Immutable -public final class Display { +public final class OperationDisplay { /* - * The localized friendly form of the resource provider name. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + * Compute". */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly form of the resource type related to this action/operation. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + * Schedule Collections". */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The localized friendly name for the operation as shown to the user. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + * Machine", "Restart Virtual Machine". */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* - * The localized friendly description for the operation as shown to the user. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; - /** Creates an instance of Display class. */ - public Display() { + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { } /** - * Get the provider property: The localized friendly form of the resource provider name. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -48,7 +52,8 @@ public String provider() { } /** - * Get the resource property: The localized friendly form of the resource type related to this action/operation. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -57,7 +62,8 @@ public String resource() { } /** - * Get the operation property: The localized friendly name for the operation as shown to the user. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -66,7 +72,8 @@ public String operation() { } /** - * Get the description property: The localized friendly description for the operation as shown to the user. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationList.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationList.java deleted file mode 100644 index cd75ff596a3b..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationList.java +++ /dev/null @@ -1,55 +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.baremetalinfrastructure.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of AzureBareMetal operations. */ -@Fluent -public final class OperationList { - /* - * List of AzureBareMetal operations - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of OperationList class. */ - public OperationList() { - } - - /** - * Get the value property: List of AzureBareMetal operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of AzureBareMetal operations. - * - * @param value the value value to set. - * @return the OperationList object itself. - */ - public OperationList withValue(List value) { - this.value = value; - return this; - } - - /** - * 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/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationListResult.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationListResult.java new file mode 100644 index 000000000000..a2ebd3906d8b --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationListResult.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.models; + +import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult { + /* + * List of operations supported by the resource provider + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /* + * URL to get the next set of operation list results (if there are any). + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationStatus.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationStatus.java new file mode 100644 index 000000000000..7289bc54af9f --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationStatus.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.models; + +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationStatusInner; + +/** An immutable client-side representation of OperationStatus. */ +public interface OperationStatus { + /** + * Gets the name property: Unique Operation Status Identifier. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Status of the operation. + * + * @return the status value. + */ + AsyncOperationStatus status(); + + /** + * Gets the startTime property: Start Time when the operation was initially executed. + * + * @return the startTime value. + */ + String startTime(); + + /** + * Gets the error property: An error from the Azure Bare Metal Infrastructure service. + * + * @return the error value. + */ + OperationStatusError error(); + + /** + * Gets the inner com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationStatusInner object. + * + * @return the inner object. + */ + OperationStatusInner innerModel(); +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationStatusError.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationStatusError.java new file mode 100644 index 000000000000..a5556f3e9771 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/OperationStatusError.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.baremetalinfrastructure.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An error from the Azure Bare Metal Infrastructure service. */ +@Fluent +public final class OperationStatusError { + /* + * Server-defined set of error codes. + */ + @JsonProperty(value = "code") + private String code; + + /* + * Human-readable representation of the error. + */ + @JsonProperty(value = "message") + private String message; + + /** Creates an instance of OperationStatusError class. */ + public OperationStatusError() { + } + + /** + * Get the code property: Server-defined set of error codes. + * + * @return the code value. + */ + public String code() { + return this.code; + } + + /** + * Set the code property: Server-defined set of error codes. + * + * @param code the code value to set. + * @return the OperationStatusError object itself. + */ + public OperationStatusError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message property: Human-readable representation of the error. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Human-readable representation of the error. + * + * @param message the message value to set. + * @return the OperationStatusError object itself. + */ + public OperationStatusError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Operations.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Operations.java index ba225015a5db..926015598e3a 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Operations.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Operations.java @@ -10,7 +10,9 @@ /** Resource collection API of Operations. */ public interface Operations { /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @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. @@ -19,7 +21,9 @@ public interface Operations { PagedIterable list(); /** - * Gets a list of AzureBareMetal management operations. + * Lists all of the available consumption REST API operations. + * + *

Gets a list of AzureBareMetal management operations. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Origin.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Origin.java new file mode 100644 index 000000000000..c7f0d1182b53 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Origin.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.baremetalinfrastructure.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** Static value user for Origin. */ + public static final Origin USER = fromString("user"); + + /** Static value system for Origin. */ + public static final Origin SYSTEM = fromString("system"); + + /** Static value user,system for Origin. */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + @JsonCreator + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ProvisioningState.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ProvisioningState.java new file mode 100644 index 000000000000..0f209302d353 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/ProvisioningState.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** State of provisioning of the AzureBareMetalStorageInstance. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Accepted for ProvisioningState. */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Migrating for ProvisioningState. */ + public static final ProvisioningState MIGRATING = fromString("Migrating"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageBillingProperties.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageBillingProperties.java new file mode 100644 index 000000000000..a0295a14af0d --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageBillingProperties.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.baremetalinfrastructure.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Describes the billing related details of the AzureBareMetalStorageInstance. */ +@Fluent +public final class StorageBillingProperties { + /* + * the billing mode for the storage instance + */ + @JsonProperty(value = "billingMode") + private String billingMode; + + /* + * the SKU type that is provisioned + */ + @JsonProperty(value = "azureBareMetalStorageInstanceSize") + private String azureBareMetalStorageInstanceSize; + + /** Creates an instance of StorageBillingProperties class. */ + public StorageBillingProperties() { + } + + /** + * Get the billingMode property: the billing mode for the storage instance. + * + * @return the billingMode value. + */ + public String billingMode() { + return this.billingMode; + } + + /** + * Set the billingMode property: the billing mode for the storage instance. + * + * @param billingMode the billingMode value to set. + * @return the StorageBillingProperties object itself. + */ + public StorageBillingProperties withBillingMode(String billingMode) { + this.billingMode = billingMode; + return this; + } + + /** + * Get the azureBareMetalStorageInstanceSize property: the SKU type that is provisioned. + * + * @return the azureBareMetalStorageInstanceSize value. + */ + public String azureBareMetalStorageInstanceSize() { + return this.azureBareMetalStorageInstanceSize; + } + + /** + * Set the azureBareMetalStorageInstanceSize property: the SKU type that is provisioned. + * + * @param azureBareMetalStorageInstanceSize the azureBareMetalStorageInstanceSize value to set. + * @return the StorageBillingProperties object itself. + */ + public StorageBillingProperties withAzureBareMetalStorageInstanceSize(String azureBareMetalStorageInstanceSize) { + this.azureBareMetalStorageInstanceSize = azureBareMetalStorageInstanceSize; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageProfile.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageProfile.java index c4507dc870e0..d7b6ac839d9d 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageProfile.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageProfile.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Specifies the storage settings for the AzureBareMetal instance disks. */ +/** Specifies the storage settings for the Azure Bare Metal instance disks. */ @Fluent public final class StorageProfile { /* @@ -18,7 +18,7 @@ public final class StorageProfile { private String nfsIpAddress; /* - * Specifies information about the operating system disk used by baremetal instance. + * Specifies information about the operating system disk used by bare metal instance. */ @JsonProperty(value = "osDisks") private List osDisks; @@ -37,7 +37,7 @@ public String nfsIpAddress() { } /** - * Get the osDisks property: Specifies information about the operating system disk used by baremetal instance. + * Get the osDisks property: Specifies information about the operating system disk used by bare metal instance. * * @return the osDisks value. */ @@ -46,7 +46,7 @@ public List osDisks() { } /** - * Set the osDisks property: Specifies information about the operating system disk used by baremetal instance. + * Set the osDisks property: Specifies information about the operating system disk used by bare metal instance. * * @param osDisks the osDisks value to set. * @return the StorageProfile object itself. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageProperties.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageProperties.java new file mode 100644 index 000000000000..71df0c38a647 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageProperties.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** described the storage properties of the azure bare metal storage instance. */ +@Fluent +public final class StorageProperties { + /* + * State of provisioning of the AzureBareMetalStorageInstance + */ + @JsonProperty(value = "provisioningState") + private ProvisioningState provisioningState; + + /* + * the offering type for which the resource is getting provisioned + */ + @JsonProperty(value = "offeringType") + private String offeringType; + + /* + * the storage protocol for which the resource is getting provisioned + */ + @JsonProperty(value = "storageType") + private String storageType; + + /* + * the kind of storage instance + */ + @JsonProperty(value = "generation") + private String generation; + + /* + * the hardware type of the storage instance + */ + @JsonProperty(value = "hardwareType") + private String hardwareType; + + /* + * the workload for which the resource is getting provisioned + */ + @JsonProperty(value = "workloadType") + private String workloadType; + + /* + * the billing related information for the resource + */ + @JsonProperty(value = "storageBillingProperties") + private StorageBillingProperties storageBillingProperties; + + /** Creates an instance of StorageProperties class. */ + public StorageProperties() { + } + + /** + * Get the provisioningState property: State of provisioning of the AzureBareMetalStorageInstance. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: State of provisioning of the AzureBareMetalStorageInstance. + * + * @param provisioningState the provisioningState value to set. + * @return the StorageProperties object itself. + */ + public StorageProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the offeringType property: the offering type for which the resource is getting provisioned. + * + * @return the offeringType value. + */ + public String offeringType() { + return this.offeringType; + } + + /** + * Set the offeringType property: the offering type for which the resource is getting provisioned. + * + * @param offeringType the offeringType value to set. + * @return the StorageProperties object itself. + */ + public StorageProperties withOfferingType(String offeringType) { + this.offeringType = offeringType; + return this; + } + + /** + * Get the storageType property: the storage protocol for which the resource is getting provisioned. + * + * @return the storageType value. + */ + public String storageType() { + return this.storageType; + } + + /** + * Set the storageType property: the storage protocol for which the resource is getting provisioned. + * + * @param storageType the storageType value to set. + * @return the StorageProperties object itself. + */ + public StorageProperties withStorageType(String storageType) { + this.storageType = storageType; + return this; + } + + /** + * Get the generation property: the kind of storage instance. + * + * @return the generation value. + */ + public String generation() { + return this.generation; + } + + /** + * Set the generation property: the kind of storage instance. + * + * @param generation the generation value to set. + * @return the StorageProperties object itself. + */ + public StorageProperties withGeneration(String generation) { + this.generation = generation; + return this; + } + + /** + * Get the hardwareType property: the hardware type of the storage instance. + * + * @return the hardwareType value. + */ + public String hardwareType() { + return this.hardwareType; + } + + /** + * Set the hardwareType property: the hardware type of the storage instance. + * + * @param hardwareType the hardwareType value to set. + * @return the StorageProperties object itself. + */ + public StorageProperties withHardwareType(String hardwareType) { + this.hardwareType = hardwareType; + return this; + } + + /** + * Get the workloadType property: the workload for which the resource is getting provisioned. + * + * @return the workloadType value. + */ + public String workloadType() { + return this.workloadType; + } + + /** + * Set the workloadType property: the workload for which the resource is getting provisioned. + * + * @param workloadType the workloadType value to set. + * @return the StorageProperties object itself. + */ + public StorageProperties withWorkloadType(String workloadType) { + this.workloadType = workloadType; + return this; + } + + /** + * Get the storageBillingProperties property: the billing related information for the resource. + * + * @return the storageBillingProperties value. + */ + public StorageBillingProperties storageBillingProperties() { + return this.storageBillingProperties; + } + + /** + * Set the storageBillingProperties property: the billing related information for the resource. + * + * @param storageBillingProperties the storageBillingProperties value to set. + * @return the StorageProperties object itself. + */ + public StorageProperties withStorageBillingProperties(StorageBillingProperties storageBillingProperties) { + this.storageBillingProperties = storageBillingProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (storageBillingProperties() != null) { + storageBillingProperties().validate(); + } + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Tags.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Tags.java index 0ab27559e204..7f702ce4c13c 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Tags.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/Tags.java @@ -9,11 +9,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** Tags field of the AzureBareMetal instance. */ +/** Tags field of the AzureBareMetal/AzureBareMetaStorage instance. */ @Fluent public final class Tags { /* - * Tags field of the AzureBareMetal instance. + * Tags field of the AzureBareMetal/AzureBareMetaStorage instance. */ @JsonProperty(value = "tags") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) @@ -24,7 +24,7 @@ public Tags() { } /** - * Get the tags property: Tags field of the AzureBareMetal instance. + * Get the tags property: Tags field of the AzureBareMetal/AzureBareMetaStorage instance. * * @return the tags value. */ @@ -33,7 +33,7 @@ public Map tags() { } /** - * Set the tags property: Tags field of the AzureBareMetal instance. + * Set the tags property: Tags field of the AzureBareMetal/AzureBareMetaStorage instance. * * @param tags the tags value to set. * @return the Tags object itself. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/package-info.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/package-info.java index 41477dda82c7..39bc96b26200 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/package-info.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/package-info.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for BareMetalInfrastructureClient. The BareMetalInfrastructure Management client. + * Package containing the data models for BareMetalInfrastructureClient. The Bare Metal Infrastructure Management + * client. */ package com.azure.resourcemanager.baremetalinfrastructure.models; diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/package-info.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/package-info.java index 1c235e376a70..c123710775a2 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/package-info.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/package-info.java @@ -2,5 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for BareMetalInfrastructureClient. The BareMetalInfrastructure Management client. */ +/** + * Package containing the classes for BareMetalInfrastructureClient. The Bare Metal Infrastructure Management client. + */ package com.azure.resourcemanager.baremetalinfrastructure; diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesGetByResourceGroupSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesGetByResourceGroupSamples.java index bd279e40a577..64746b567833 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesGetByResourceGroupSamples.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesGetByResourceGroupSamples.java @@ -7,10 +7,10 @@ /** Samples for AzureBareMetalInstances GetByResourceGroup. */ public final class AzureBareMetalInstancesGetByResourceGroupSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_Get.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_Get.json */ /** - * Sample code: Get an AzureBareMetal instance. + * Sample code: Get an Azure Bare Metal Instance. * * @param manager Entry point to BareMetalInfrastructureManager. */ diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListByResourceGroupSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListByResourceGroupSamples.java index 65611b85f333..a4fdb1a6e146 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListByResourceGroupSamples.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListByResourceGroupSamples.java @@ -7,10 +7,10 @@ /** Samples for AzureBareMetalInstances ListByResourceGroup. */ public final class AzureBareMetalInstancesListByResourceGroupSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListByResourceGroup.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_ListByResourceGroup.json */ /** - * Sample code: List all AzureBareMetal instances in a resource group. + * Sample code: List all Azure Bare Metal Instances in a resource group. * * @param manager Entry point to BareMetalInfrastructureManager. */ diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListSamples.java index 00b8d2923eaa..ac2dc3c310ae 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListSamples.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListSamples.java @@ -7,10 +7,10 @@ /** Samples for AzureBareMetalInstances List. */ public final class AzureBareMetalInstancesListSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListBySubscription.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_ListBySubscription.json */ /** - * Sample code: List all AzureBareMetal instances in a subscription. + * Sample code: List all Azure Bare Metal Instances in a subscription. * * @param manager Entry point to BareMetalInfrastructureManager. */ diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesRestartSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesRestartSamples.java new file mode 100644 index 000000000000..674c006d9492 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesRestartSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.generated; + +/** Samples for AzureBareMetalInstances Restart. */ +public final class AzureBareMetalInstancesRestartSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_Restart.json + */ + /** + * Sample code: Restart an Azure Bare Metal Instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void restartAnAzureBareMetalInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalInstances() + .restart("myResourceGroup", "myABMInstance", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesShutdownSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesShutdownSamples.java new file mode 100644 index 000000000000..f52c4e09dcac --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesShutdownSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.generated; + +/** Samples for AzureBareMetalInstances Shutdown. */ +public final class AzureBareMetalInstancesShutdownSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_Shutdown.json + */ + /** + * Sample code: Shutdown an Azure Bare Metal Instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void shutdownAnAzureBareMetalInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalInstances() + .shutdown("myResourceGroup", "myABMInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesStartSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesStartSamples.java new file mode 100644 index 000000000000..fd4f4070efa0 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesStartSamples.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.baremetalinfrastructure.generated; + +/** Samples for AzureBareMetalInstances Start. */ +public final class AzureBareMetalInstancesStartSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_Start.json + */ + /** + * Sample code: Start an Azure Bare Metal instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void startAnAzureBareMetalInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager.azureBareMetalInstances().start("myResourceGroup", "myABMInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesUpdateSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesUpdateSamples.java index fffe29826c9b..b1ccc8316c8d 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesUpdateSamples.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesUpdateSamples.java @@ -11,40 +11,41 @@ /** Samples for AzureBareMetalInstances Update. */ public final class AzureBareMetalInstancesUpdateSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_PatchTags_Delete.json */ /** - * Sample code: Update Tags field of an AzureBareMetal instance. + * Sample code: Delete Tags field of an Azure Bare Metal Instance. * * @param manager Entry point to BareMetalInfrastructureManager. */ - public static void updateTagsFieldOfAnAzureBareMetalInstance( + public static void deleteTagsFieldOfAnAzureBareMetalInstance( com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { manager .azureBareMetalInstances() .updateWithResponse( - "myResourceGroup", - "myABMInstance", - new Tags().withTags(mapOf("testkey", "testvalue")), - com.azure.core.util.Context.NONE); + "myResourceGroup", "myABMInstance", new Tags().withTags(mapOf()), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags_Delete.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalInstances_PatchTags.json */ /** - * Sample code: Delete Tags field of an AzureBareMetal instance. + * Sample code: Update Tags field of an Azure Bare Metal Instance. * * @param manager Entry point to BareMetalInfrastructureManager. */ - public static void deleteTagsFieldOfAnAzureBareMetalInstance( + public static void updateTagsFieldOfAnAzureBareMetalInstance( com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { manager .azureBareMetalInstances() .updateWithResponse( - "myResourceGroup", "myABMInstance", new Tags().withTags(mapOf()), com.azure.core.util.Context.NONE); + "myResourceGroup", + "myABMInstance", + new Tags().withTags(mapOf("testkey", "fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesCreateSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesCreateSamples.java new file mode 100644 index 000000000000..f1ef3b89125b --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesCreateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.generated; + +import com.azure.resourcemanager.baremetalinfrastructure.models.ProvisioningState; +import com.azure.resourcemanager.baremetalinfrastructure.models.StorageBillingProperties; +import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProperties; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AzureBareMetalStorageInstances Create. */ +public final class AzureBareMetalStorageInstancesCreateSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_Create.json + */ + /** + * Sample code: Put a new AzureBareMetalStorageInstance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void putANewAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalStorageInstances() + .define("myAzureBareMetalStorageInstance") + .withRegion("westus2") + .withExistingResourceGroup("myResourceGroup") + .withTags(mapOf("key", "fakeTokenPlaceholder")) + .withAzureBareMetalStorageInstanceUniqueIdentifier("23415635-4d7e-41dc-9598-8194f22c24e9") + .withStorageProperties( + new StorageProperties() + .withProvisioningState(ProvisioningState.SUCCEEDED) + .withOfferingType("EPIC") + .withStorageType("FC") + .withGeneration("Gen4") + .withHardwareType("NetApp") + .withWorkloadType("ODB") + .withStorageBillingProperties( + new StorageBillingProperties() + .withBillingMode("PAYG") + .withAzureBareMetalStorageInstanceSize(""))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesDeleteSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesDeleteSamples.java new file mode 100644 index 000000000000..5b0abbc2eb40 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.generated; + +/** Samples for AzureBareMetalStorageInstances Delete. */ +public final class AzureBareMetalStorageInstancesDeleteSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_Delete.json + */ + /** + * Sample code: Delete an AzureBareMetalStorageInstance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void deleteAnAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalStorageInstances() + .deleteByResourceGroupWithResponse( + "myResourceGroup", "myAzureBareMetalStorageInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..f57203c644ee --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.generated; + +/** Samples for AzureBareMetalStorageInstances GetByResourceGroup. */ +public final class AzureBareMetalStorageInstancesGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_Get.json + */ + /** + * Sample code: Get an AzureBareMetalStorage instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void getAnAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalStorageInstances() + .getByResourceGroupWithResponse( + "myResourceGroup", "myAzureBareMetalStorageInstance", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesListByResourceGroupSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesListByResourceGroupSamples.java new file mode 100644 index 000000000000..29a57e03d6f7 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.baremetalinfrastructure.generated; + +/** Samples for AzureBareMetalStorageInstances ListByResourceGroup. */ +public final class AzureBareMetalStorageInstancesListByResourceGroupSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_ListByResourceGroup.json + */ + /** + * Sample code: List all AzureBareMetalStorage instances in a resource group. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void listAllAzureBareMetalStorageInstancesInAResourceGroup( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager + .azureBareMetalStorageInstances() + .listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesListSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesListSamples.java new file mode 100644 index 000000000000..1a02056a4ce8 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesListSamples.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.baremetalinfrastructure.generated; + +/** Samples for AzureBareMetalStorageInstances List. */ +public final class AzureBareMetalStorageInstancesListSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_ListBySubscription.json + */ + /** + * Sample code: List all AzureBareMetalStorage instances in a subscription. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void listAllAzureBareMetalStorageInstancesInASubscription( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + manager.azureBareMetalStorageInstances().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesUpdateSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesUpdateSamples.java new file mode 100644 index 000000000000..30e432e47abb --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesUpdateSamples.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.baremetalinfrastructure.generated; + +import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalStorageInstance; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AzureBareMetalStorageInstances Update. */ +public final class AzureBareMetalStorageInstancesUpdateSamples { + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_PatchTags.json + */ + /** + * Sample code: Update Tags field of an AzureBareMetalStorage instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void updateTagsFieldOfAnAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + AzureBareMetalStorageInstance resource = + manager + .azureBareMetalStorageInstances() + .getByResourceGroupWithResponse("myResourceGroup", "myABMSInstance", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf("testkey", "fakeTokenPlaceholder")).apply(); + } + + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalStorageInstances_PatchTags_Delete.json + */ + /** + * Sample code: Delete Tags field of an AzureBareMetalStorage instance. + * + * @param manager Entry point to BareMetalInfrastructureManager. + */ + public static void deleteTagsFieldOfAnAzureBareMetalStorageInstance( + com.azure.resourcemanager.baremetalinfrastructure.BareMetalInfrastructureManager manager) { + AzureBareMetalStorageInstance resource = + manager + .azureBareMetalStorageInstances() + .getByResourceGroupWithResponse("myResourceGroup", "myABMSInstance", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withTags(mapOf()).apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationsListSamples.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationsListSamples.java index 23c25705c9e3..98316641b783 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationsListSamples.java +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationsListSamples.java @@ -7,7 +7,7 @@ /** Samples for Operations List. */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalOperations_List.json + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/preview/2023-08-04-preview/examples/AzureBareMetalOperations_List.json */ /** * Sample code: List all management operations supported by the AzureBareMetal RP. diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListResultTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListResultTests.java deleted file mode 100644 index 256670295e16..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalInstancesListResultTests.java +++ /dev/null @@ -1,66 +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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalInstanceInner; -import com.azure.resourcemanager.baremetalinfrastructure.models.AzureBareMetalInstancesListResult; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AzureBareMetalInstancesListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureBareMetalInstancesListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"azureBareMetalInstanceId\":\"xpyb\",\"powerState\":\"stopped\",\"proximityPlacementGroup\":\"hmtzopbsphrup\",\"hwRevision\":\"gsybbejhp\",\"partnerNodeId\":\"ycm\",\"provisioningState\":\"Migrating\"},\"location\":\"bhdxbm\",\"tags\":{\"zhwlrxy\":\"oqjzehtbmufpowno\"},\"id\":\"qsoqijgkd\",\"name\":\"bpazlobcufpdzn\",\"type\":\"btcqq\"},{\"properties\":{\"azureBareMetalInstanceId\":\"gnufoooj\",\"powerState\":\"restarting\",\"proximityPlacementGroup\":\"sqe\",\"hwRevision\":\"agdfmglzlh\",\"partnerNodeId\":\"rifkwm\",\"provisioningState\":\"Updating\"},\"location\":\"siznto\",\"tags\":{\"uajpsquc\":\"a\"},\"id\":\"poyfdkfogkn\",\"name\":\"gjofjd\",\"type\":\"eqsrdeupewnwreit\"},{\"properties\":{\"azureBareMetalInstanceId\":\"arhmofcqhsmy\",\"powerState\":\"stopped\",\"proximityPlacementGroup\":\"tmlxhekuksjtx\",\"hwRevision\":\"cdm\",\"partnerNodeId\":\"rcryuanzwuxzdxta\",\"provisioningState\":\"Failed\"},\"location\":\"m\",\"tags\":{\"u\":\"pmrqobm\"},\"id\":\"knryrtihfxtij\",\"name\":\"pzvgnwzsymglzufc\",\"type\":\"zk\"}],\"nextLink\":\"dbihanufhfcbj\"}") - .toObject(AzureBareMetalInstancesListResult.class); - Assertions.assertEquals("bhdxbm", model.value().get(0).location()); - Assertions.assertEquals("oqjzehtbmufpowno", model.value().get(0).tags().get("zhwlrxy")); - Assertions.assertEquals("ycm", model.value().get(0).partnerNodeId()); - Assertions.assertEquals("dbihanufhfcbj", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureBareMetalInstancesListResult model = - new AzureBareMetalInstancesListResult() - .withValue( - Arrays - .asList( - new AzureBareMetalInstanceInner() - .withLocation("bhdxbm") - .withTags(mapOf("zhwlrxy", "oqjzehtbmufpowno")) - .withPartnerNodeId("ycm"), - new AzureBareMetalInstanceInner() - .withLocation("siznto") - .withTags(mapOf("uajpsquc", "a")) - .withPartnerNodeId("rifkwm"), - new AzureBareMetalInstanceInner() - .withLocation("m") - .withTags(mapOf("u", "pmrqobm")) - .withPartnerNodeId("rcryuanzwuxzdxta"))) - .withNextLink("dbihanufhfcbj"); - model = BinaryData.fromObject(model).toObject(AzureBareMetalInstancesListResult.class); - Assertions.assertEquals("bhdxbm", model.value().get(0).location()); - Assertions.assertEquals("oqjzehtbmufpowno", model.value().get(0).tags().get("zhwlrxy")); - Assertions.assertEquals("ycm", model.value().get(0).partnerNodeId()); - Assertions.assertEquals("dbihanufhfcbj", 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/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/DiskTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/DiskTests.java deleted file mode 100644 index ff6c5de3954f..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/DiskTests.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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.models.Disk; -import org.junit.jupiter.api.Assertions; - -public final class DiskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Disk model = - BinaryData - .fromString("{\"name\":\"fdatsc\",\"diskSizeGB\":311951623,\"lun\":902734826}") - .toObject(Disk.class); - Assertions.assertEquals("fdatsc", model.name()); - Assertions.assertEquals(311951623, model.diskSizeGB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Disk model = new Disk().withName("fdatsc").withDiskSizeGB(311951623); - model = BinaryData.fromObject(model).toObject(Disk.class); - Assertions.assertEquals("fdatsc", model.name()); - Assertions.assertEquals(311951623, model.diskSizeGB()); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/DisplayTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/DisplayTests.java deleted file mode 100644 index 4a7c28d40ab1..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/DisplayTests.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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.models.Display; - -public final class DisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Display model = - BinaryData - .fromString( - "{\"provider\":\"zrnf\",\"resource\":\"xgispemvtzfkufu\",\"operation\":\"jofxqe\",\"description\":\"jaeq\"}") - .toObject(Display.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Display model = new Display(); - model = BinaryData.fromObject(model).toObject(Display.class); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/HardwareProfileTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/HardwareProfileTests.java deleted file mode 100644 index 039c9a9b6e05..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/HardwareProfileTests.java +++ /dev/null @@ -1,24 +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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.models.HardwareProfile; - -public final class HardwareProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HardwareProfile model = - BinaryData - .fromString("{\"hardwareType\":\"HPE\",\"azureBareMetalInstanceSize\":\"S768xm\"}") - .toObject(HardwareProfile.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HardwareProfile model = new HardwareProfile(); - model = BinaryData.fromObject(model).toObject(HardwareProfile.class); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/IpAddressTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/IpAddressTests.java deleted file mode 100644 index 867a876965af..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/IpAddressTests.java +++ /dev/null @@ -1,24 +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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.models.IpAddress; -import org.junit.jupiter.api.Assertions; - -public final class IpAddressTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IpAddress model = BinaryData.fromString("{\"ipAddress\":\"dphlxaolt\"}").toObject(IpAddress.class); - Assertions.assertEquals("dphlxaolt", model.ipAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IpAddress model = new IpAddress().withIpAddress("dphlxaolt"); - model = BinaryData.fromObject(model).toObject(IpAddress.class); - Assertions.assertEquals("dphlxaolt", model.ipAddress()); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/NetworkProfileTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/NetworkProfileTests.java deleted file mode 100644 index a4b666b7378f..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/NetworkProfileTests.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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.models.IpAddress; -import com.azure.resourcemanager.baremetalinfrastructure.models.NetworkProfile; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NetworkProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NetworkProfile model = - BinaryData - .fromString( - "{\"networkInterfaces\":[{\"ipAddress\":\"j\"},{\"ipAddress\":\"hbcryffdfdosyge\"}],\"circuitId\":\"aojakhmsbzjhcrz\"}") - .toObject(NetworkProfile.class); - Assertions.assertEquals("j", model.networkInterfaces().get(0).ipAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkProfile model = - new NetworkProfile() - .withNetworkInterfaces( - Arrays - .asList(new IpAddress().withIpAddress("j"), new IpAddress().withIpAddress("hbcryffdfdosyge"))); - model = BinaryData.fromObject(model).toObject(NetworkProfile.class); - Assertions.assertEquals("j", model.networkInterfaces().get(0).ipAddress()); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationInnerTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationInnerTests.java deleted file mode 100644 index 77aeb6d827dd..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationInnerTests.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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationInner; -import com.azure.resourcemanager.baremetalinfrastructure.models.Display; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"xypininmayhuybbk\",\"display\":{\"provider\":\"epoo\",\"resource\":\"nuvamiheogna\",\"operation\":\"zxtheotusivyevcc\",\"description\":\"ihnhun\"},\"isDataAction\":true}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new Display()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationListTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationListTests.java deleted file mode 100644 index 0f5a69c1bf86..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationListTests.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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.OperationInner; -import com.azure.resourcemanager.baremetalinfrastructure.models.Display; -import com.azure.resourcemanager.baremetalinfrastructure.models.OperationList; -import java.util.Arrays; - -public final class OperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"gqjbpfzfsin\",\"display\":{\"provider\":\"f\",\"resource\":\"rwzoxxjtfelluwf\",\"operation\":\"tonpe\",\"description\":\"pjkjlxofpdv\"},\"isDataAction\":true}]}") - .toObject(OperationList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = - new OperationList().withValue(Arrays.asList(new OperationInner().withDisplay(new Display()))); - model = BinaryData.fromObject(model).toObject(OperationList.class); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationsListMockTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationsListMockTests.java deleted file mode 100644 index ccb2fc9b6dbc..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +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.baremetalinfrastructure.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.baremetalinfrastructure.BareMetalInfrastructureManager; -import com.azure.resourcemanager.baremetalinfrastructure.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"gzjaoyfhrtxilne\",\"display\":{\"provider\":\"jysvl\",\"resource\":\"uvfqawrlyxwj\",\"operation\":\"prbnwbxgjvtbv\",\"description\":\"sszdnru\"},\"isDataAction\":true}]}"; - - 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); - })); - - BareMetalInfrastructureManager manager = - BareMetalInfrastructureManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/StorageProfileTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/StorageProfileTests.java deleted file mode 100644 index 0366960f6e48..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/StorageProfileTests.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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.models.Disk; -import com.azure.resourcemanager.baremetalinfrastructure.models.StorageProfile; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StorageProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageProfile model = - BinaryData - .fromString( - "{\"nfsIpAddress\":\"eho\",\"osDisks\":[{\"name\":\"huxinpmqnj\",\"diskSizeGB\":956745772,\"lun\":288433409},{\"name\":\"sprozvcput\",\"diskSizeGB\":1721756309,\"lun\":1903590590}]}") - .toObject(StorageProfile.class); - Assertions.assertEquals("huxinpmqnj", model.osDisks().get(0).name()); - Assertions.assertEquals(956745772, model.osDisks().get(0).diskSizeGB()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageProfile model = - new StorageProfile() - .withOsDisks( - Arrays - .asList( - new Disk().withName("huxinpmqnj").withDiskSizeGB(956745772), - new Disk().withName("sprozvcput").withDiskSizeGB(1721756309))); - model = BinaryData.fromObject(model).toObject(StorageProfile.class); - Assertions.assertEquals("huxinpmqnj", model.osDisks().get(0).name()); - Assertions.assertEquals(956745772, model.osDisks().get(0).diskSizeGB()); - } -} diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/TagsTests.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/TagsTests.java deleted file mode 100644 index 3c7a2dee789a..000000000000 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/test/java/com/azure/resourcemanager/baremetalinfrastructure/generated/TagsTests.java +++ /dev/null @@ -1,40 +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.baremetalinfrastructure.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.baremetalinfrastructure.models.Tags; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Tags model = - BinaryData - .fromString("{\"tags\":{\"tnb\":\"jbasvmsmjqulngs\",\"wrljdouskc\":\"bkzgcwrwclx\"}}") - .toObject(Tags.class); - Assertions.assertEquals("jbasvmsmjqulngs", model.tags().get("tnb")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Tags model = new Tags().withTags(mapOf("tnb", "jbasvmsmjqulngs", "wrljdouskc", "bkzgcwrwclx")); - model = BinaryData.fromObject(model).toObject(Tags.class); - Assertions.assertEquals("jbasvmsmjqulngs", model.tags().get("tnb")); - } - - @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; - } -}