diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/CHANGELOG.md index 8356f38d8ca0..d9396f83be05 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-05-10) + +- 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-2023-04-06. 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..663ea01ceb41 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 BareMetalInfrastructure Management client. Package tag package-2023-04-06. 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}) diff --git a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/SAMPLE.md b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/SAMPLE.md index 51d05a43fe83..9cef6948331c 100644 --- a/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/SAMPLE.md +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/SAMPLE.md @@ -8,6 +8,15 @@ - [ListByResourceGroup](#azurebaremetalinstances_listbyresourcegroup) - [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,7 +26,7 @@ /** 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/stable/2023-04-06/examples/AzureBareMetalInstances_Get.json */ /** * Sample code: Get an AzureBareMetal instance. @@ -40,7 +49,7 @@ 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/stable/2023-04-06/examples/AzureBareMetalInstances_ListBySubscription.json */ /** * Sample code: List all AzureBareMetal instances in a subscription. @@ -60,7 +69,7 @@ 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/stable/2023-04-06/examples/AzureBareMetalInstances_ListByResourceGroup.json */ /** * Sample code: List all AzureBareMetal instances in a resource group. @@ -84,7 +93,7 @@ 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/stable/2023-04-06/examples/AzureBareMetalInstances_PatchTags.json */ /** * Sample code: Update Tags field of an AzureBareMetal instance. @@ -103,7 +112,7 @@ public final class AzureBareMetalInstancesUpdateSamples { } /* - * 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/stable/2023-04-06/examples/AzureBareMetalInstances_PatchTags_Delete.json */ /** * Sample code: Delete Tags field of an AzureBareMetal instance. @@ -131,13 +140,215 @@ public final class AzureBareMetalInstancesUpdateSamples { } ``` +### 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/2023-04-06/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", "value")) + .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(); + } + + @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/stable/2023-04-06/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/stable/2023-04-06/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/stable/2023-04-06/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/stable/2023-04-06/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/stable/2023-04-06/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", "testvalue")).apply(); + } + + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2023-04-06/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(); + } + + @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; + } +} +``` + ### Operations_List ```java /** 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/stable/2023-04-06/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 43f878587975..9be407f26176 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 BareMetalInfrastructure Management client. Package tag package-2023-04-06. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 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..680cb5f9bba4 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; @@ -42,6 +44,8 @@ public final class BareMetalInfrastructureManager { 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(" (") @@ -291,6 +295,19 @@ public Operations operations() { return operations; } + /** + * 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; + } + /** * @return Wrapped service client BareMetalInfrastructureClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. 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..eff498e97e9f --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/fluent/AzureBareMetalStorageInstancesClient.java @@ -0,0 +1,215 @@ +// 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure 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 an Azure BareMetal 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure instance. + * @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 Storage instance for the specified subscription, resource group, and instance name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AzureBareMetalStorageInstanceInner getByResourceGroup( + String resourceGroupName, String azureBareMetalStorageInstanceName); + + /** + * Create an azure baremetal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the AzureBareMetalStorage on Azure instance. + * @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 baremetal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the AzureBareMetalStorage on Azure instance. + * @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 BareMetalStorage instance. + * + *

Patches the Tags field of a Azure BareMetalStorage 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 AzureBareMetalStorage on Azure instance. + * @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 BareMetalStorage instance. + * + *

Patches the Tags field of a Azure BareMetalStorage 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 AzureBareMetalStorage on Azure instance. + * @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 AzureBareMetalStorage on Azure 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 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 AzureBareMetalStorage on Azure instance. + * @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..8136f3bbdd58 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 @@ -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/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..85b528913f90 --- /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; + + /* + * The system metadata relating to this resource. + */ + @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: The system metadata relating to this resource. + * + * @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/implementation/AzureBareMetalInstancesClientImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalInstancesClientImpl.java index 16dc32c07b17..d68d740d432c 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 @@ -73,8 +73,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 +86,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 +100,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( 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..fd1a8ecf158c --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/AzureBareMetalStorageInstancesClientImpl.java @@ -0,0 +1,1371 @@ +// 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, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @QueryParam("api-version") String apiVersion, + @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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure 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 an Azure BareMetal 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure 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 an Azure BareMetal 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 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 baremetal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the AzureBareMetalStorage on Azure instance. + * @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.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + azureBareMetalStorageInstanceName, + requestBodyParameters, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create an azure baremetal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the AzureBareMetalStorage on Azure instance. + * @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.getSubscriptionId(), + resourceGroupName, + this.client.getApiVersion(), + azureBareMetalStorageInstanceName, + requestBodyParameters, + accept, + context); + } + + /** + * Create an azure baremetal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the AzureBareMetalStorage on Azure instance. + * @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 baremetal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the AzureBareMetalStorage on Azure instance. + * @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 baremetal storage resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param azureBareMetalStorageInstanceName Name of the AzureBareMetalStorage on Azure instance. + * @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 BareMetalStorage instance. + * + *

Patches the Tags field of a Azure BareMetalStorage 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 AzureBareMetalStorage on Azure instance. + * @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 BareMetalStorage instance. + * + *

Patches the Tags field of a Azure BareMetalStorage 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 AzureBareMetalStorage on Azure instance. + * @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 BareMetalStorage instance. + * + *

Patches the Tags field of a Azure BareMetalStorage 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 AzureBareMetalStorage on Azure instance. + * @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 BareMetalStorage instance. + * + *

Patches the Tags field of a Azure BareMetalStorage 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 AzureBareMetalStorage on Azure instance. + * @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 BareMetalStorage instance. + * + *

Patches the Tags field of a Azure BareMetalStorage 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 AzureBareMetalStorage on Azure instance. + * @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 AzureBareMetalStorage on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 AzureBareMetalStorage on Azure 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 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 AzureBareMetalStorage on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 AzureBareMetalStorage on Azure 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 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 AzureBareMetalStorage on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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/BareMetalInfrastructureClientImpl.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/implementation/BareMetalInfrastructureClientImpl.java index 412990fb034e..08a8571cb089 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; @@ -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. * @@ -155,9 +168,10 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-08-09"; + this.apiVersion = "2023-04-06"; 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/models/AzureBareMetalStorageInstance.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstance.java new file mode 100644 index 000000000000..9e3b97f5f989 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstance.java @@ -0,0 +1,253 @@ +// 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.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.baremetalinfrastructure.fluent.models.AzureBareMetalStorageInstanceInner; +import java.util.Map; + +/** An immutable client-side representation of AzureBareMetalStorageInstance. */ +public interface AzureBareMetalStorageInstance { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: The system metadata relating to this resource. + * + * @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..f57aad2c50ff --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/AzureBareMetalStorageInstances.java @@ -0,0 +1,187 @@ +// 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage instances in the specified subscription. + * + *

Gets a list of AzureBareMetalStorage instances in the specified subscription. The operations returns various + * properties of each Azure BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetalStorage 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 BareMetal 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure 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 an Azure BareMetal 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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 AzureBareMetalStorage on Azure instance. + * @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 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 AzureBareMetalStorage on Azure 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 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 AzureBareMetalStorage on Azure instance. + * @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 BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 BareMetal Storage instance for the specified subscription, resource group, and instance name + * along with {@link Response}. + */ + AzureBareMetalStorageInstance getById(String id); + + /** + * Gets an Azure BareMetal Storage instance. + * + *

Gets an Azure BareMetal 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 BareMetal 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/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/StorageProperties.java b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/main/java/com/azure/resourcemanager/baremetalinfrastructure/models/StorageProperties.java new file mode 100644 index 000000000000..6ca60f09b7f5 --- /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 baremetalstorage 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/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..97748dd4b2e3 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,7 +7,7 @@ /** 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/stable/2023-04-06/examples/AzureBareMetalInstances_Get.json */ /** * Sample code: Get an AzureBareMetal instance. 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..83f33ecd35dc 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,7 +7,7 @@ /** 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/stable/2023-04-06/examples/AzureBareMetalInstances_ListByResourceGroup.json */ /** * Sample code: List all AzureBareMetal instances in a resource group. 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..41bd607a80c3 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,7 +7,7 @@ /** 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/stable/2023-04-06/examples/AzureBareMetalInstances_ListBySubscription.json */ /** * Sample code: List all AzureBareMetal instances in a subscription. 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..cde96af4925e 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,7 +11,7 @@ /** 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/stable/2023-04-06/examples/AzureBareMetalInstances_PatchTags.json */ /** * Sample code: Update Tags field of an AzureBareMetal instance. @@ -30,7 +30,7 @@ public static void updateTagsFieldOfAnAzureBareMetalInstance( } /* - * 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/stable/2023-04-06/examples/AzureBareMetalInstances_PatchTags_Delete.json */ /** * Sample code: Delete Tags field of an AzureBareMetal instance. 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..e5abcce8e052 --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesCreateSamples.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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/stable/2023-04-06/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", "value")) + .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(); + } + + @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..664b2873918f --- /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/stable/2023-04-06/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..7e8bbf045a41 --- /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/stable/2023-04-06/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..d59a503623d0 --- /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/stable/2023-04-06/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..c550bfdc604a --- /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/stable/2023-04-06/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..0d77eb8cc3ee --- /dev/null +++ b/sdk/baremetalinfrastructure/azure-resourcemanager-baremetalinfrastructure/src/samples/java/com/azure/resourcemanager/baremetalinfrastructure/generated/AzureBareMetalStorageInstancesUpdateSamples.java @@ -0,0 +1,59 @@ +// 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/stable/2023-04-06/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", "testvalue")).apply(); + } + + /* + * x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2023-04-06/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(); + } + + @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..bfad8ad8f007 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/stable/2023-04-06/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; - } -}